Skip to content

Commit 8baa1a4

Browse files
committed
fix(codex): preserve source reply mode for active runs
1 parent f37fbc9 commit 8baa1a4

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

extensions/codex/src/app-server/run-attempt.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7816,6 +7816,44 @@ describe("runCodexAppServerAttempt", () => {
78167816
expect(interrupt?.params).toEqual({ threadId: "thread-1", turnId: "turn-1" });
78177817
});
78187818

7819+
it("accepts message-tool-only steering for active Codex app-server source replies", async () => {
7820+
const { requests, waitForMethod, completeTurn } = createStartedThreadHarness();
7821+
const params = createParams(
7822+
path.join(tempDir, "session.jsonl"),
7823+
path.join(tempDir, "workspace"),
7824+
);
7825+
params.sourceReplyDeliveryMode = "message_tool_only";
7826+
7827+
const run = runCodexAppServerAttempt(params);
7828+
await waitForMethod("turn/start");
7829+
7830+
expect(
7831+
queueActiveRunMessageForTest("session-1", "subagent complete", {
7832+
debounceMs: 1,
7833+
steeringMode: "all",
7834+
sourceReplyDeliveryMode: "message_tool_only",
7835+
}),
7836+
).toBe(true);
7837+
7838+
await vi.waitFor(
7839+
() =>
7840+
expect(requests.filter((entry) => entry.method === "turn/steer")).toEqual([
7841+
{
7842+
method: "turn/steer",
7843+
params: {
7844+
threadId: "thread-1",
7845+
expectedTurnId: "turn-1",
7846+
input: [{ type: "text", text: "subagent complete", text_elements: [] }],
7847+
},
7848+
},
7849+
]),
7850+
{ interval: 1 },
7851+
);
7852+
7853+
await completeTurn({ threadId: "thread-1", turnId: "turn-1" });
7854+
await run;
7855+
});
7856+
78197857
it("batches default queued steering before sending turn/steer", async () => {
78207858
const { requests, waitForMethod, completeTurn } = createStartedThreadHarness();
78217859

extensions/codex/src/app-server/run-attempt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,6 +3143,7 @@ export async function runCodexAppServerAttempt(
31433143
activeSteeringQueue.queue(text, options),
31443144
isStreaming: () => !completed,
31453145
isCompacting: () => projector?.isCompacting() ?? false,
3146+
sourceReplyDeliveryMode: params.sourceReplyDeliveryMode,
31463147
cancel: () => runAbortController.abort("cancelled"),
31473148
abort: () => runAbortController.abort("aborted"),
31483149
};

0 commit comments

Comments
 (0)