Skip to content

Commit 1bb20fb

Browse files
committed
fix(codex): bind steering to tool authority
1 parent 0fa3548 commit 1bb20fb

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎extensions/codex/src/app-server/run-attempt-active-turn.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ export async function activateCodexAttemptTurn(
212212
const handle = {
213213
kind: "embedded" as const,
214214
runId: params.runId,
215+
toolAuthorityFingerprint: params.toolAuthorityFingerprint,
215216
queueMessage,
216217
messageInjection: {
217218
isAvailable: () =>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function createSteeringParams() {
9090
params.sessionId = sessionId;
9191
params.sessionKey = `agent:main:${sessionId}`;
9292
params.runId = `run-${sessionId}`;
93+
params.toolAuthorityFingerprint = `authority-${sessionId}`;
9394
return params;
9495
}
9596

@@ -166,6 +167,7 @@ describe("runCodexAppServerAttempt steering", () => {
166167
await waitAndQueueActiveRunMessage(params.sessionId, "steer this active turn", {
167168
debounceMs: 0,
168169
isInboundUserMessage: true,
170+
toolAuthorityFingerprint: params.toolAuthorityFingerprint,
169171
taskSuggestionDeliveryMode: "gateway",
170172
waitForTranscriptCommit: true,
171173
onQueueAccepted,
@@ -599,6 +601,7 @@ describe("runCodexAppServerAttempt steering", () => {
599601
await waitAndQueueActiveRunMessage(params.sessionId, "2", {
600602
isInboundUserMessage: true,
601603
onQueueAccepted: onQuestionAccepted,
604+
toolAuthorityFingerprint: params.toolAuthorityFingerprint,
602605
});
603606
await expect(response).resolves.toEqual({
604607
answers: { mode: { answers: ["Deep"] } },

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,11 @@ describe("runCodexAppServerAttempt turn watches", () => {
13751375
const preRequestIdleMs = 500;
13761376
const pendingHoldMs = 700;
13771377
const harness = createStartedThreadHarness();
1378-
const params = makeTestParams({ timeoutMs: attemptIdleTimeoutMs });
1378+
const toolAuthorityFingerprint = "turn-watch-secret-input-authority";
1379+
const params = makeTestParams({
1380+
timeoutMs: attemptIdleTimeoutMs,
1381+
toolAuthorityFingerprint,
1382+
});
13791383
params.onBlockReply = vi.fn();
13801384
const onRunProgress = vi.fn();
13811385
params.onRunProgress = onRunProgress;
@@ -1443,9 +1447,12 @@ describe("runCodexAppServerAttempt turn watches", () => {
14431447
(event as { reason?: string }).reason === "request:item/tool/requestUserInput:response",
14441448
),
14451449
).toBe(false);
1446-
expect(queueActiveRunMessageForTest("session-1", "2", { isInboundUserMessage: true })).toBe(
1447-
true,
1448-
);
1450+
expect(
1451+
queueActiveRunMessageForTest("session-1", "2", {
1452+
isInboundUserMessage: true,
1453+
toolAuthorityFingerprint,
1454+
}),
1455+
).toBe(true);
14491456
await expect(response).resolves.toEqual({
14501457
answers: { mode: { answers: ["Deep"] } },
14511458
});

0 commit comments

Comments
 (0)