Skip to content

Commit 129c06d

Browse files
committed
fix: bind steering authority to model route
1 parent d183d06 commit 129c06d

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
embeddedAgentLog,
77
type EmbeddedRunAttemptParamsV2 as EmbeddedRunAttemptParams,
88
} from "openclaw/plugin-sdk/agent-harness-runtime";
9+
import type { queueAgentHarnessMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
910
import {
1011
isCodexAppServerIndeterminateRequestCancellationError,
1112
isCodexAppServerIndeterminateTransportError,
@@ -14,6 +15,7 @@ import {
1415
import { buildCodexUserInput } from "./user-input.js";
1516

1617
const CODEX_STEER_ALL_DEBOUNCE_MS = 500;
18+
type AgentHarnessQueueMessageOptions = NonNullable<Parameters<typeof queueAgentHarnessMessage>[2]>;
1719

1820
export class CodexSteeringAcceptedUnconfirmedError extends Error {
1921
constructor(message: string, options?: ErrorOptions) {
@@ -28,6 +30,7 @@ export type CodexSteeringQueueOptions = {
2830
images?: EmbeddedRunAttemptParams["images"];
2931
isInboundUserMessage?: boolean;
3032
onQueueAccepted?: (accepted: boolean) => void;
33+
userTurnTranscriptRecorder?: AgentHarnessQueueMessageOptions["userTurnTranscriptRecorder"];
3134
};
3235

3336
/**

‎src/auto-reply/reply/reply-run-registry.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ describe("reply run registry", () => {
107107
);
108108
});
109109

110+
it.each([
111+
{
112+
label: "provider",
113+
first: { provider: "openai", model: "gpt-test" },
114+
second: { provider: "anthropic", model: "gpt-test" },
115+
},
116+
{
117+
label: "model",
118+
first: { provider: "openai", model: "gpt-primary" },
119+
second: { provider: "openai", model: "gpt-fallback" },
120+
},
121+
])("distinguishes the concrete $label route in steering authority", ({ first, second }) => {
122+
const run = createQueueTestRun({ prompt: "route authority" });
123+
124+
expect(resolveFollowupRunToolAuthorityFingerprint(run, first)).not.toBe(
125+
resolveFollowupRunToolAuthorityFingerprint(run, second),
126+
);
127+
});
128+
110129
afterEach(() => {
111130
testing.resetReplyRunRegistry();
112131
resetCommandQueueStateForTest();

‎src/auto-reply/reply/reply-tool-authority.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export function resolveFollowupRunToolAuthorityFingerprint(
5454
return createHash("sha256")
5555
.update(
5656
stableStringify({
57+
provider,
58+
model,
5759
policy: capabilityProfile.policy,
5860
toolsAllow: run.toolsAllow,
5961
toolsAllowIntersection: run.toolsAllow

0 commit comments

Comments
 (0)