From cccd7c7b8ef9fb9423a628a4907a684b9f769c5d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 17 Jan 2026 08:07:27 +0000 Subject: [PATCH] test: stabilize windows pty expectations --- src/agents/bash-tools.exec.pty.test.ts | 2 +- src/agents/bash-tools.process.send-keys.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agents/bash-tools.exec.pty.test.ts b/src/agents/bash-tools.exec.pty.test.ts index c890f7c42..4f251c5da 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('ok')\"", 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 8f64f2376..69ca95ce1 100644 --- a/src/agents/bash-tools.process.send-keys.test.ts +++ b/src/agents/bash-tools.process.send-keys.test.ts @@ -64,7 +64,8 @@ test("process submit sends Enter for pty sessions", async () => { sessionId, }); - for (let i = 0; i < 10; i += 1) { + const deadline = Date.now() + (process.platform === "win32" ? 4000 : 2000); + while (Date.now() < deadline) { await wait(50); const poll = await processTool.execute("toolcall", { action: "poll", sessionId }); const details = poll.details as { status?: string; aggregated?: string };