Skip to content

Commit 9beff6e

Browse files
authored
fix(agent): pin codex approvals_reviewer to host (#3435)
1 parent 1082a7c commit 9beff6e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/agent/src/adapters/codex-app-server/spawn.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ describe("buildAppServerArgs", () => {
2929
});
3030

3131
expect(args[0]).toBe("app-server");
32+
// Pin codex's guardian reviewer to the host default so it never calls the
33+
// gateway-blocked `codex-auto-review` model.
34+
expect(args).toContain('approvals_reviewer="user"');
3235
expect(args).toContain('model_provider="posthog"');
3336
expect(args).toContain(
3437
'model_providers.posthog.base_url="https://gateway.example/v1"',

packages/agent/src/adapters/codex-app-server/spawn.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ export function buildAppServerArgs(
123123
: `sandbox_mode="danger-full-access"`,
124124
);
125125

126+
// The host owns approvals (surfaced via approvals.ts → requestPermission). Codex's
127+
// guardian reviewer is on by default and routes approvals to its dedicated
128+
// `codex-auto-review` model, which our gateway's posthog_code allowlist doesn't
129+
// serve — so every review 403s. Default codex's own `user` reviewer; a caller can
130+
// still override it via configOverrides, which the trailing loop appends last.
131+
args.push("-c", `approvals_reviewer="user"`);
132+
126133
// Disable the user's ambient ~/.codex MCP servers so the adapter only exposes
127134
// MCP servers PostHog injects per-thread; otherwise codex fails connecting to them.
128135
for (const name of new CodexSettingsManager(

0 commit comments

Comments
 (0)