Skip to content

fix(agent): pin codex approvals_reviewer to host#3435

Open
rnegron wants to merge 3 commits into
mainfrom
fix/codex-guardian-reviewer-403
Open

fix(agent): pin codex approvals_reviewer to host#3435
rnegron wants to merge 3 commits into
mainfrom
fix/codex-guardian-reviewer-403

Conversation

@rnegron

@rnegron rnegron commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

Codex runs on posthog_code fail every command with:

403 Forbidden — Model 'codex-auto-review' not allowed for product 'posthog_code'

Codex 0.140.0 — the native openai/codex app-server harness PostHog Code switched to (replacing the old codex-acp adapter) — ships its guardian approval reviewer as a stable, default-on feature. The reviewer calls a dedicated codex-auto-review model, which our gateway's posthog_code allowlist does not serve, so it is rejected 403 at the access check. The host already owns approvals (approvals.tsrequestPermission), so the guardian is a redundant second authority.

Changes

  • Pin codex's approvals_reviewer to its own default "user" in buildAppServerArgs, keeping approval decisions on the host instead of the gateway-blocked codex-auto-review model.
  • "auto_review" and the legacy "guardian_subagent" are the same variant — both hit codex-auto-review, so "user" is the only value that keeps traffic on allowlisted models.

How did you test this?

  • vitest run src/adapters/codex-app-server — 160 pass (2 unrelated failures: unbuilt @posthog/git workspace dep). New assertion in spawn.test.ts locks the flag.
  • Real codex 0.140.0 binary: -c approvals_reviewer="user" → exit 0; -c approvals_reviewer="bogus"unknown variant 'bogus', expected one of 'user', 'auto_review', 'guardian_subagent' — confirms it is a first-class, validated config value.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 6411648.

@rnegron rnegron marked this pull request as ready for review July 14, 2026 17:57
@rnegron rnegron requested a review from a team July 14, 2026 17:57
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(agent): pin codex approvals_reviewer..." | Re-trigger Greptile

Comment thread packages/agent/src/adapters/codex-app-server/spawn.ts
@rnegron rnegron added the Stamphog This will request an autostamp by stamphog on small changes label Jul 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No showstoppers. The fix correctly pins the Codex approvals reviewer to prevent gateway 403s, with a test verifying the new arg. The bot comment about configOverrides shadowing is resolved and the code explicitly documents the intentional override escape hatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant