codex-plugin-cc
codex-plugin-cc copied to clipboard
fix: auto-review write-capable task escalations
Summary
- send
approvalPolicy: "on-request",approvalsReviewer: "auto_review", andsandbox: "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, andsandbox: "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 passedcodex app-server generate-ts --out plugins/codex/.generated/app-server-types— passed with Codex CLI 0.144.0; generated start/resume types includeapprovalsReviewernpx --no-install tsc -p tsconfig.app-server.json— passednpm ci --ignore-scripts— 0 vulnerabilitiesgit 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), andtaskkillprocess termination (1). All changed policy-path tests passed.
Fixes #412 Closes #445