fix(codex): gate CLI session resume behind plugin approval#82906
fix(codex): gate CLI session resume behind plugin approval#82906LaPhilosophie wants to merge 6 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 11:50 PM ET / 03:50 UTC. Summary PR surface: Source +66, Tests +243. Total +309 across 10 files. Reproducibility: yes. from source inspection rather than a local live run. Current main and Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh against current main, keep the gateway-side resume approval gate, and land only after maintainers accept approval-required fail-closed resume behavior or define a trusted unattended route. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection rather than a local live run. Current main and Is this the best way to solve the issue? Yes for the code boundary: the gateway-side node-invoke policy is the narrow guard before raw node dispatch. The unresolved part is maintainer acceptance of the fail-closed compatibility tradeoff and a conflict refresh against current main. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 21d1e1f0fc9d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +66, Tests +243. Total +309 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
Pull request overview
Adds a plugin-approval gate to the Codex CLI session resume node-invoke policy so that resuming a local Codex CLI session requires explicit operator approval before ctx.invokeNode() is dispatched. The session listing policy is unchanged, and the resume node handler itself is unchanged; only the gateway-side invoke policy now interposes an approval request and fails closed when approval is denied or unavailable.
Changes:
- Replace pass-through resume policy with an async handler that requests a critical-severity plugin approval before dispatching to the node and returns
PLUGIN_APPROVAL_REQUIREDon deny or when no approval runtime is reachable. - Forward
sessionId,agentId,sessionKey, andtimeoutMsfrom the policy context into the approval request payload. - Add Vitest regression coverage for deny, unavailable-approval, and allow-once paths of the resume policy.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extensions/codex/src/node-cli-sessions.ts | Adds approval gating in the resume node-invoke policy and fail-closed result when approval is denied/unavailable. |
| extensions/codex/src/node-cli-sessions.test.ts | Adds three policy-level tests covering deny, missing approval runtime, and allow-once dispatch. |
|
The |
ec8a59c to
0f6a59e
Compare
|
I rebased this branch onto current The remaining failures point to files outside this PR’s diff ( |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The
This PR only touches TypeScript files in the Codex extension, gateway plugin approval policy, and Control UI approval handling. No Android, Gradle, Java, or CI cache configuration files are changed. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
codex.cli.session.resumedid not consistently pass through plugin approval before node dispatch.allow-onceanddeny.ctx.invokeNode(), uses the standard plugin approval timeout instead of the longer node resume timeout, fails closed when approval delivery is unavailable or denied, and the Control UI renders only the decisions allowed by the approval request.Change Type
Scope
Linked Issue/PR
Motivation
codex.cli.session.resumecan resume an existing local Codex CLI session with a caller-supplied prompt. Since this is a dangerous node-host command, the Gateway policy should require an explicit operator decision before forwarding the request to the node.Real behavior proof (required for external PRs)
codex-resume-approval, head713c83eba2ce.node --import tsx .artifacts/codex-resume-real-behavior-proof.ts;node .artifacts/codex-resume-control-ui-proof.mjs; targeted Vitest andoxfmt --checkon touched files.codex.cli.sessions.liststill dispatches without plugin approval;codex.cli.session.resumecreates a plugin approval request before node dispatch; denied approval returnsPLUGIN_APPROVAL_REQUIREDwithout dispatch;allow-onceproceeds to the node handler; the resume approval uses the normal plugin approval timeout rather than the long node resume timeout; the Control UI renders onlyAllow onceandDeny, with noAlways allowbutton.Root Cause
allowedDecisions.Regression Test Plan
extensions/codex/src/node-cli-sessions.test.ts,src/gateway/node-invoke-plugin-policy.test.ts,ui/src/ui/controllers/exec-approval.test.ts,ui/src/ui/views/exec-approval.test.ts,ui/src/ui/app-gateway.node.test.tsallow-once, and the Control UI renders only the decisions allowed by the plugin approval request.User-visible / Behavior Changes
Codex CLI session resume through this node command now requires plugin approval before dispatch. The approval prompt offers
Allow onceorDeny; it does not offerAlways allowfor this resume path.Diagram
Security Impact
Yes, explain risk + mitigation: command dispatch is narrowed by a fail-closed approval gate.Repro + Verification
Environment
Steps
Expected
allow-onceplugin approval decision.Allow onceandDenyfor the Codex resume approval.Actual
Evidence
Human Verification
allow-onceforwards to the node handler; Control UI renders onlyAllow onceandDeny; Control UI click routing producesdenyandallow-once.allow-alwaysis not rendered by the Control UI.Review Conversations
Compatibility / Migration
codex.cli.session.resumemay now need an approval-capable runtime or an explicit approval decision.Risks and Mitigations