diff --git a/src/agents/bash-tools.exec.pty.test.ts b/src/agents/bash-tools.exec.pty.test.ts index 4f251c5da..8ada2ecca 100644 --- a/src/agents/bash-tools.exec.pty.test.ts +++ b/src/agents/bash-tools.exec.pty.test.ts @@ -10,7 +10,7 @@ afterEach(() => { test("exec supports pty output", async () => { const tool = createExecTool({ allowBackground: false }); const result = await tool.execute("toolcall", { - command: "node -e \"process.stdout.write('ok')\"", + command: 'node -e "process.stdout.write(String.fromCharCode(111,107))"', pty: true, }); diff --git a/src/agents/bash-tools.process.send-keys.test.ts b/src/agents/bash-tools.process.send-keys.test.ts index 69ca95ce1..765265a30 100644 --- a/src/agents/bash-tools.process.send-keys.test.ts +++ b/src/agents/bash-tools.process.send-keys.test.ts @@ -15,7 +15,7 @@ test("process send-keys encodes Enter for pty sessions", async () => { const processTool = createProcessTool(); const result = await execTool.execute("toolcall", { command: - "node -e \"process.stdin.on('data', d => { process.stdout.write(d); if (d.includes(10) || d.includes(13)) process.exit(0); });\"", + 'node -e "const dataEvent=String.fromCharCode(100,97,116,97);process.stdin.on(dataEvent,d=>{process.stdout.write(d);if(d.includes(10)||d.includes(13))process.exit(0);});"', pty: true, background: true, }); @@ -50,7 +50,7 @@ test("process submit sends Enter for pty sessions", async () => { const processTool = createProcessTool(); const result = await execTool.execute("toolcall", { command: - "node -e \"process.stdin.on('data', d => { if (d.includes(10) || d.includes(13)) { process.stdout.write('submitted'); process.exit(0); } });\"", + 'node -e "const dataEvent=String.fromCharCode(100,97,116,97);const submitted=String.fromCharCode(115,117,98,109,105,116,116,101,100);process.stdin.on(dataEvent,d=>{if(d.includes(10)||d.includes(13)){process.stdout.write(submitted);process.exit(0);}});"', pty: true, background: true, }); diff --git a/src/media-understanding/attachments.ts b/src/media-understanding/attachments.ts index 07c326e63..ff5daccd8 100644 --- a/src/media-understanding/attachments.ts +++ b/src/media-understanding/attachments.ts @@ -104,7 +104,7 @@ export function resolveAttachmentKind( attachment: MediaAttachment, ): "image" | "audio" | "video" | "document" | "unknown" { const kind = kindFromMime(attachment.mime); - if (kind !== "unknown") return kind; + if (kind === "image" || kind === "audio" || kind === "video") return kind; const ext = getFileExtension(attachment.path ?? attachment.url); if (!ext) return "unknown";