fix: drain codex terminal after quiet notifications (#235)
This commit is contained in:
@@ -119,7 +119,7 @@ const selfTest: SelfTestCase = async (context) => {
|
||||
assert.equal(finalMessageItems.some((event) => event.type === "backend_status" && String(eventPayload(event).phase ?? "").startsWith("item/agentMessage:")), false, "agentMessage lifecycle must not be persisted as backend_status noise");
|
||||
|
||||
const terminalBeforeFinal = await createRunWithCommand(client, context, "hello terminal before final", "selftest-terminal-before-final-agent-message", 15_000);
|
||||
const terminalBeforeFinalResult = await runOnce({ managerUrl: server.baseUrl, runId: terminalBeforeFinal.runId, codexCommand: context.fakeCodexCommand, codexArgs: context.fakeCodexArgs, codexHome: context.codexHome, env: { CODEX_HOME: context.codexHome, AGENTRUN_FAKE_CODEX_MODE: "multi-agent-message-terminal-before-final" }, oneShot: true });
|
||||
const terminalBeforeFinalResult = await runOnce({ managerUrl: server.baseUrl, runId: terminalBeforeFinal.runId, codexCommand: context.fakeCodexCommand, codexArgs: context.fakeCodexArgs, codexHome: context.codexHome, env: { CODEX_HOME: context.codexHome, AGENTRUN_FAKE_CODEX_MODE: "multi-agent-message-terminal-before-final", AGENTRUN_CODEX_TERMINAL_NOTIFICATION_DRAIN_MS: "300" }, oneShot: true });
|
||||
assert.equal(terminalBeforeFinalResult.terminalStatus, "completed", "terminal-before-final agentMessage run should complete");
|
||||
const terminalBeforeFinalEvents = await client.get(`/api/v1/runs/${terminalBeforeFinal.runId}/events?afterSeq=0&limit=100`) as { items?: Array<{ type: string; payload: unknown }> };
|
||||
const terminalBeforeFinalItems = terminalBeforeFinalEvents.items ?? [];
|
||||
|
||||
@@ -232,8 +232,10 @@ for await (const line of rl) {
|
||||
notify("turn/completed", { turn });
|
||||
setTimeout(() => {
|
||||
notify("item/completed", { item: { id: "msg_late_progress", type: "agentMessage", text: "Progress before delayed final." } });
|
||||
}, 200).unref?.();
|
||||
setTimeout(() => {
|
||||
notify("item/completed", { item: { id: "msg_late_final", type: "agentMessage", text: "Delayed final answer." } });
|
||||
}, 20).unref?.();
|
||||
}, 450).unref?.();
|
||||
continue;
|
||||
}
|
||||
if (mode === "web-search-progress") {
|
||||
|
||||
Reference in New Issue
Block a user