codex-plugin-cc icon indicating copy to clipboard operation
codex-plugin-cc copied to clipboard

fix: auto-review write-capable task escalations

Open Yogitmeister opened this issue 4 months ago • 1 comments

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

Yogitmeister avatar Jul 13 '26 23:07 Yogitmeister