sync: update from private repo (c764df2f)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-29 01:32:25 +00:00
parent b857c33ef6
commit a6d1879d63
75 changed files with 3874 additions and 334 deletions
+19
View File
@@ -53,6 +53,14 @@ describe('sanitizeQuery', () => {
it('preserves public IPs', () => {
expect(sanitizeQuery('query 8.8.8.8 dns', {})).toBe('query 8.8.8.8 dns');
});
it('returns null for missing / non-string query instead of throwing', () => {
// 退行したモデルが query なしの WebSearch を吐くと undefined が渡ってくる
expect(sanitizeQuery(undefined as unknown as string, {})).toBeNull();
expect(sanitizeQuery(null as unknown as string, {})).toBeNull();
expect(sanitizeQuery(123 as unknown as string, {})).toBeNull();
expect(sanitizeQuery('', {})).toBeNull();
expect(sanitizeQuery(' ', {})).toBeNull();
});
});
describe('web tools', () => {
@@ -148,6 +156,17 @@ describe('web tools', () => {
expect(fs.existsSync(path.join(workspacePath, 'logs', 'webfetch-screenshots'))).toBe(false);
});
it('returns a friendly error (not a crash) when WebSearch query is missing', async () => {
workspacePath = makeWorkspace();
// 引数欠落のツール呼び出し(退行モデル由来)でジョブ全体を巻き添えにしない
const result = await executeTool('WebSearch', {}, makeContext(workspacePath));
expect(result).not.toBeNull();
expect(result?.isError).toBe(true);
expect(result?.output).toContain('query');
});
it('records invalid URL attempts before fetch', async () => {
workspacePath = makeWorkspace();