Skip to content

fix: auto-review write-capable task escalations#494

Open
Yogitmeister wants to merge 1 commit into
openai:mainfrom
Yogitmeister:fix/windows-write-policy
Open

fix: auto-review write-capable task escalations#494
Yogitmeister wants to merge 1 commit into
openai:mainfrom
Yogitmeister:fix/windows-write-policy

Conversation

@Yogitmeister

Copy link
Copy Markdown

Summary

  • send approvalPolicy: "on-request", approvalsReviewer: "auto_review", and sandbox: "workspace-write" for write-capable task runs
  • forward the same policy through both new and resumed app-server threads
  • keep read-only tasks fail-closed with approvalPolicy: "never", no automatic reviewer, and sandbox: "read-only"
  • record the actual thread start/resume payloads in the fake app server and cover all three paths

Relationship to #426 and #445

This deliberately builds on @mvanhorn's approved #426. It includes that PR's approvalPolicy plumbing and regression coverage, then extends the same path with the approvalsReviewer field requested in #445. Credit for the underlying write-policy fix belongs to @mvanhorn.

If maintainers prefer to keep #426 as the landing PR, this delta can be folded into it; this PR is intended as a cooperative extension or replacement, not a competing implementation.

Security boundary

auto_review is an escalation approval gate. It does not select danger-full-access, bypass app-server approval handling, or prove that approved writes remain inside the workspace. Read-only delegation remains unchanged.

Verification

  • node --test --test-name-pattern "write task output focuses|read-only task keeps never|resume-last --write forwards" tests/runtime.test.mjs — 3/3 passed
  • codex app-server generate-ts --out plugins/codex/.generated/app-server-types — passed with Codex CLI 0.144.0; generated start/resume types include approvalsReviewer
  • npx --no-install tsc -p tsconfig.app-server.json — passed
  • npm ci --ignore-scripts — 0 vulnerabilities
  • git diff --check — passed
  • full tests/runtime.test.mjs — 58/63 passed; the five failures are unrelated Windows/environment constraints: symlink privilege (1), temp transcripts outside the configured Claude projects root (3), and taskkill process termination (1). All changed policy-path tests passed.

Fixes #412
Closes #445

Keep read-only delegation fail-closed while allowing write-capable tasks
to request Guardian-reviewed escalation on new and resumed threads.

Builds on openai#426.
Refs openai#445.
@Yogitmeister Yogitmeister requested a review from a team July 13, 2026 23:00

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 026d6c45a0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +491 to +492
approvalPolicy: request.write ? "on-request" : "never",
approvalsReviewer: request.write ? "auto_review" : undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify auto-review support before enabling approvals

When --write is used with a Codex app-server version that does not honor approvalsReviewer (or rejects the new field), this still switches the run to approvalPolicy: "on-request". This client has no fallback approval UI—plugins/codex/scripts/lib/app-server.mjs responds to every server-initiated request with -32601—so any escalation such as blocked network or an out-of-workspace write will fail instead of being auto-reviewed. Please gate this on a supported start/resume response or fail early with an upgrade message before selecting on-request.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Codex auto-review for rescue task escalations /codex:rescue fails to write files — always returns a read-only sandbox error

1 participant