Skip to content

Commit febeaf7

Browse files
test(server): hold Codex final-answer gates in the notification handler
The streamed final-answer test held each item/completed before the replay emitted it, then advanced the clock one step, assuming the preceding delta had already reached the adapter. With stdout now routed through a queue, that delta can still be in flight, so the flush timer is not yet scheduled and the test waits forever. Holding item/completed in its handler instead guarantees the delta handler already ran. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent fa00d2a commit febeaf7

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4764,15 +4764,20 @@ describe("CodexAdapterV2 post-settle continuation", () => {
47644764
};
47654765
}),
47664766
);
4767+
// Holding item/completed in its handler means the earlier delta was already handled
4768+
// and its flush timer started, so one clock step shows the streaming update.
4769+
let completedCount = 0;
47674770
const harness = yield* makeCodexReplayHarness(
47684771
transcript,
47694772
undefined,
47704773
undefined,
47714774
undefined,
4772-
(entry) => {
4773-
const gate = streamed
4774-
? gates.find((gate) => entry.label === `item/completed/${gate.id}`)
4775-
: undefined;
4775+
undefined,
4776+
undefined,
4777+
undefined,
4778+
(method) => {
4779+
const gate =
4780+
streamed && method === "item/completed" ? gates[completedCount++] : undefined;
47764781
return gate === undefined
47774782
? Effect.void
47784783
: Deferred.succeed(gate.ready, undefined).pipe(

0 commit comments

Comments
 (0)