chore: We have a sleep at home. The sleep at home:

This commit is contained in:
cpojer
2026-02-02 21:34:47 +09:00
parent dfef943f0a
commit 6b0d6e2540
18 changed files with 69 additions and 49 deletions

View File

@@ -1,10 +1,9 @@
import { afterEach, expect, test } from "vitest";
import { sleep } from "../utils";
import { resetProcessRegistryForTests } from "./bash-process-registry";
import { createExecTool } from "./bash-tools.exec";
import { createProcessTool } from "./bash-tools.process";
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
afterEach(() => {
resetProcessRegistryForTests();
});
@@ -31,7 +30,7 @@ test("process send-keys encodes Enter for pty sessions", async () => {
const deadline = Date.now() + (process.platform === "win32" ? 4000 : 2000);
while (Date.now() < deadline) {
await wait(50);
await sleep(50);
const poll = await processTool.execute("toolcall", { action: "poll", sessionId });
const details = poll.details as { status?: string; aggregated?: string };
if (details.status !== "running") {
@@ -65,7 +64,7 @@ test("process submit sends Enter for pty sessions", async () => {
const deadline = Date.now() + (process.platform === "win32" ? 4000 : 2000);
while (Date.now() < deadline) {
await wait(50);
await sleep(50);
const poll = await processTool.execute("toolcall", { action: "poll", sessionId });
const details = poll.details as { status?: string; aggregated?: string };
if (details.status !== "running") {