Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 29, 2026, 1:51 AM ET / 05:51 UTC. ClawSweeper reviewWhat this changesThe PR applies session permission changes to active runs by interrupting and restarting the exact turn under the selected permission mode, with pending state in Control UI. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the new shared abort path removes current-main’s explicit-cancellation teardown, so cancelling a Codex turn can leave its native background terminals running. Priority: P1 Review scores
Verification
How this fits togetherControl UI patches session permissions through the Gateway, which coordinates an active embedded run and refreshes its visible state. The Codex app-server runtime owns the native thread and its background-terminal lifecycle. flowchart LR
UI[Control UI permission picker] --> Gateway[Gateway session patch]
Gateway --> Coordinator[Active-run permission coordinator]
Coordinator --> Run[Embedded active run]
Run --> Codex[Codex app-server turn]
Codex --> Terminals[Native background terminals]
Run --> State[Updated session state]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The changed cancellation path can leave native terminal processes alive after the turn’s authority is explicitly revoked. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain current-main’s terminal teardown for explicit cancellation and scope retained-thread behavior only to permission-change restarts. Do we have a high-confidence way to reproduce the issue? Yes—on this branch, start a Codex native background terminal and explicitly cancel the turn; source shows that the current-main terminal-cleanup call is no longer reached. Is this the best way to solve the issue? No—the shared non-timeout abort branch is too broad; explicit cancellation must retain terminal teardown while permission changes retain the thread. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 09be104e941c. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
c3e1217 to
118b6c2
Compare
118b6c2 to
2697bd3
Compare
2697bd3 to
dbfc0ec
Compare
dbfc0ec to
b48b3d0
Compare
Landing verification — a8685cc618df61a356f6726319c85967dcd183b1Exact-head CI run33342374536 is green. Fresh Autoreview, final types/lint and140 focused authority/fixture tests pass. Final runtime/UI builds: Live isolated Gateway, real providers, actual Control UI:
Codex's existing read-only/on-request mapping remains unchanged: a new file-write approval appears and expires/rejects in the tightening recording. This is not stale Full-access authority; approval-policy/label parity is a separate product follow-up. ClawSweeper finding and both rank-up moves addressed: restored the canonical All videos below were authentication-trimmed and personally inspected. No operator Gateway/config was changed. Separate follow-ups: direct Native elevation Native tightening Codex elevation Codex tightening (recorded/manual proof, phrase-check failure disclosed above) @clawsweeper re-review Final landing head — f8070edExact-head CI run 33346610211 completed successfully, including Node shards and iOS build/screenshots; no pending or failed checks remain. The latest main archive-lifecycle integration passed 104 focused permission/lifecycle/harness/UI tests, targeted type-aware lint, and fresh full-PR Autoreview. It preserves main's worker cleanup outside mutation locks while keeping permission application serialized and finishing each permission change once. The four inspected videos and the disclosed Codex tightening recorder limitation above remain applicable. Current GitHub rules require the passing CI gate and no independent approval. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a8685cc to
bb8ea93
Compare
37de9f5 to
f8070ed
Compare
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix: apply workspace permission changes to active runs * fix: preserve permission lifecycle invariants and hermetic tests * test: remove obsolete updater fixture argument * fix: repair permission-change CI and scanner reporting * refactor: trim run-loop aliases and validate scanner fixture paths * fix: prepare permission-bound prompt sections before model continuation * fix: fence permission prompt preparation across startup and replacement * fix: align permission fixtures and deduplicate run authority checks * test: keep permission checks aligned with shared labels and revocation cases
What Problem This Solves
Changing workspace security during an active task changed the badge immediately while tools and approval prompts retained the old policy. Users had to manually Stop/Continue.
Closes #131947. Related: #131978 (a parallel whole-run restart proposal with distinct pre-backend setup behavior).
Why This Change Was Made
The operator's policy transition now belongs to the serialized session mutation and exact active-run owner:
This implements the maintainer-requested automatic transition. It does not fabricate user-authored messages, replay the original request, or undo completed effects. Continuation tells the model to inspect interrupted actions before deciding what remains.
User Impact
Changing the workspace picker (or the same Gateway session-patch path) no longer requires a manual restart: native tasks refresh in place; Codex resumes automatically in the same conversation. Old approvals close without being granted; subsequent actions use the selected policy. Active CLI/whole-agent worker runs reject before saving and retain Stop/change/Continue guidance. Pre-backend setup may temporarily require retrying the change rather than restarting automatically.
No new config option, environment variable, database schema, dependency change, or protocol-version bump. The session row's pending-policy field is transient display state, not persisted authorization.
Evidence
AI-assisted implementation; maintainer-directed behavior.
Current landing status
Published rebased candidate
f8070ed74d16ceb27361af3e8bf952e5ed821da9. Exact-head CI run 33346610211 is running. The prior live-tested heada8685cc618dfpassed CI run 33342374536. The earlier mechanical rebase changed onlysrc/cli/update-cli.test.tsacross patch payloads. The subsequent archive-lifecycle integration preserves the new main cleanup contract as detailed below; active permission-runtime code remains unchanged. Four updater flag-restoration/output-order tests, config/CLI test types, targeted lint, diff-check and fresh review pass. Native elevation/tightening and Codex elevation passed automated real browser scenarios on that production-identical head. Codex tightening was manually verified against the actual terminal acknowledgment, rollout, filesystem, tool rejection, and visible final answer; its recorder failed only the omitted closing-phrase check. Four inspected live videos and detailed verification. The operator Gateway is untouched.pnpm build:ci-artifactspassed ondcaa2e6, including runtime packaging, SDK declarations/export validation, and Control UI. After the final behavior-neutral registry deduplication/test-fixture correction,pnpm build sourcePerformanceandpnpm ui:buildpassed on exact heada8685cc. Served UI bytes and native Codex0.151.0 were verified by the recorder. No ineffective dynamic-import warning.dee70ae.Live permission-flow proof is complete; exact-head CI after archive-lifecycle integration is pending. The latest main conflict preserved worker reclaim outside mutation locks, drain handoff/finalization, and exactly-once permission cleanup. All104 focused lifecycle/permission/harness/UI tests, targeted lint, and fresh full-PR review pass. The first lint prerequisite failed its topology-stability guard; an isolated unchanged-source retry passed. The CI-reported label assertions now use canonical translated mode labels, and the host-capability tests share revocation cases without dropping coverage. All 67 focused cases (43 harness, 23 UI, one real-browser E2E), targeted type-aware lint, and fresh review pass. This correction changes no production files. The explicit Codex recorder limitation above remains recorded, not recast as a passing test.
Recovered implementation proof
The original candidate had a successful full build, 1,242 broad permission tests, 263 final owner-split tests, 114 Code Mode cancellation/reconciliation tests, type/lint/SDK/protocol checks, and real isolated native/Codex browser flows. Those historical results do not stand in for the rebased head below.
Rebase and review repairs
state.abortCleanupowner for both explicit stop and permission replacement. Restart confirmation occurs only after terminal teardown. Removed the parallel permission-stop waiter.118b6c223b314c4bc5d70dabff78ad48a91f0679: 225 supervisor/test-environment/launchd/file-write tests and all 401 Codex cancellation, terminal-cleanup, steering, approval, elicitation, and lifecycle tests passed. Core production types passed. Fresh full-diff Autoreview is clean at the repository's default P0 threshold.Dependency contract and solution quality
Lead personally inspected sibling Codex source, including current pinned
rust-v0.151.0exact-turn interrupt acknowledgment (codex-rs/app-server/src/request_processors/turn_processor.rs:1590), application-context developer mapping (codex-rs/core/src/state/additional_context.rs:16), and separate thread-terminal lifetime. Currentcodex-rs/app-server-protocol/src/protocol/v2/turn.rs:47excludes sandbox/approval from live settings; turn/start carries both. No Codex dependency modification.Architectural owners: serialized session mutation, admitted-run permission coordinator, generation-bound tool/approval lifecycle, and Codex native-turn cleanup. Reuses canonical constructors and authority boundaries. Keeping next-run-only behavior misses the requested outcome; restarting every harness interrupts native work unnecessarily.
Production/tooling LOC: +2,365/−967 (net +1,398); tests/support: +2,644/−444; docs/generated: +15/−0. Growth implements the explicitly requested live-transition capability, generation revocation/acknowledgment, and prepared-context startup boundary. Canonical constructors preserve policy/metadata ownership; a downstream flag or whole-run restart does not provide the requested native behavior. Test-support moves are not production growth.
Separate follow-ups
Codex retains its existing read-only/on-request tuple: new native file-write approvals may still be requested; in the recorded tightening flow the request expired/rejected and no file was written. Approval-policy/label parity needs a separate product decision; this PR changes policy application timing, not the selected tuple.
The direct
/codex permissionscommand remains persistence-only. Routing it into live mutation needs an invocation-bound plugin SDK capability preserving the exact caller/lifecycle authority; this PR does not synthesize a privileged Gateway caller. The requested Control UI/session-patch flow is covered here.Live/durable commentary reconciliation can display duplicate progress text; earlier transcript and side-effect counters prove this is not command replay. Preserve exact item identity in a separate repair.
Bind optional diagnostic before-tool audit receipts to permission-generation lifetime. Action/grant enforcement is fenced; a cancellation-ignoring hook may still emit an obsolete diagnostic receipt.
The related whole-run proposal has a distinct setup-time restart UX; it is not being closed as fully equivalent.
All live proof uses an isolated development Gateway. The operator's running Gateway is untouched.
Final landing head — f8070ed
Exact-head CI run 33346610211 completed successfully, including Node shards and iOS build/screenshots; no pending or failed checks remain. The latest main archive-lifecycle integration passed 104 focused permission/lifecycle/harness/UI tests, targeted type-aware lint, and fresh full-PR Autoreview. It preserves main's worker cleanup outside mutation locks while keeping permission application serialized and finishing each permission change once. The four inspected videos and the disclosed Codex tightening recorder limitation above remain applicable. Current GitHub rules require the passing CI gate and no independent approval.