


























@@ -655,9 +655,7 @@ describe("runCodexAppServerAttempt", () => {
655655};
656656657657expect(
658-__testing
659-.filterCodexDynamicTools(tools, {}, privateQaCodexEnv)
660-.map((tool) => tool.name),
658+__testing.filterCodexDynamicTools(tools, {}, privateQaCodexEnv).map((tool) => tool.name),
661659).toEqual(["read", "write", "image_generate", "message"]);
662660expect(__testing.resolveCodexDynamicToolsLoading({}, privateQaCodexEnv)).toBe("direct");
663661});
@@ -1657,7 +1655,7 @@ describe("runCodexAppServerAttempt", () => {
16571655path.join(tempDir, "session.jsonl"),
16581656path.join(tempDir, "workspace"),
16591657);
1660-params.timeoutMs = 100;
1658+params.timeoutMs = 250;
1661165916621660const result = await runCodexAppServerAttempt(params);
16631661@@ -1694,6 +1692,13 @@ describe("runCodexAppServerAttempt", () => {
16941692turnTerminalIdleTimeoutMs: 300,
16951693});
16961694await harness.waitForMethod("turn/start");
1695+await vi.waitFor(
1696+() =>
1697+expect(onRunProgress).toHaveBeenCalledWith(
1698+expect.objectContaining({ reason: "turn:start" }),
1699+),
1700+fastWait,
1701+);
1697170216981703await new Promise((resolve) => setTimeout(resolve, 60));
16991704await harness.notify({
@@ -1756,6 +1761,13 @@ describe("runCodexAppServerAttempt", () => {
17561761turnTerminalIdleTimeoutMs: 500,
17571762});
17581763await harness.waitForMethod("turn/start");
1764+await vi.waitFor(
1765+() =>
1766+expect(onRunProgress).toHaveBeenCalledWith(
1767+expect.objectContaining({ reason: "turn:start" }),
1768+),
1769+fastWait,
1770+);
1759177117601772await new Promise((resolve) => setTimeout(resolve, 60));
17611773await harness.handleServerRequest({
@@ -1840,13 +1852,22 @@ describe("runCodexAppServerAttempt", () => {
18401852path.join(tempDir, "workspace"),
18411853);
18421854params.timeoutMs = 100;
1855+const onRunProgress = vi.fn();
1856+params.onRunProgress = onRunProgress;
1843185718441858const run = runCodexAppServerAttempt(params, {
18451859turnCompletionIdleTimeoutMs: 300,
18461860turnAssistantCompletionIdleTimeoutMs: 300,
18471861turnTerminalIdleTimeoutMs: 300,
18481862});
18491863await harness.waitForMethod("turn/start");
1864+await vi.waitFor(
1865+() =>
1866+expect(onRunProgress).toHaveBeenCalledWith(
1867+expect.objectContaining({ reason: "turn:start" }),
1868+),
1869+fastWait,
1870+);
1850187118511872await new Promise((resolve) => setTimeout(resolve, 60));
18521873await harness.handleServerRequest({
@@ -1879,17 +1900,26 @@ describe("runCodexAppServerAttempt", () => {
18791900path.join(tempDir, "session.jsonl"),
18801901path.join(tempDir, "workspace"),
18811902);
1882-params.timeoutMs = 100;
1903+params.timeoutMs = 250;
18831904params.onBlockReply = vi.fn();
1905+const onRunProgress = vi.fn();
1906+params.onRunProgress = onRunProgress;
1884190718851908const run = runCodexAppServerAttempt(params, {
1886-turnCompletionIdleTimeoutMs: 300,
1887-turnAssistantCompletionIdleTimeoutMs: 300,
1888-turnTerminalIdleTimeoutMs: 300,
1909+turnCompletionIdleTimeoutMs: 600,
1910+turnAssistantCompletionIdleTimeoutMs: 600,
1911+turnTerminalIdleTimeoutMs: 600,
18891912});
18901913await harness.waitForMethod("turn/start");
1914+await vi.waitFor(
1915+() =>
1916+expect(onRunProgress).toHaveBeenCalledWith(
1917+expect.objectContaining({ reason: "turn:start" }),
1918+),
1919+fastWait,
1920+);
189119211892-await new Promise((resolve) => setTimeout(resolve, 60));
1922+await new Promise((resolve) => setTimeout(resolve, 75));
18931923const response = harness.handleServerRequest({
18941924id: "request-user-input",
18951925method: "item/tool/requestUserInput",
@@ -1913,7 +1943,7 @@ describe("runCodexAppServerAttempt", () => {
19131943},
19141944});
19151945await vi.waitFor(() => expect(params.onBlockReply).toHaveBeenCalledTimes(1), fastWait);
1916-await new Promise((resolve) => setTimeout(resolve, 60));
1946+await new Promise((resolve) => setTimeout(resolve, 125));
1917194719181948expect(harness.request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);
19191949expect(queueActiveRunMessageForTest("session-1", "2")).toBe(true);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。