Repository navigation
fix(codex): preserve persistent restricted continuation - #173383
vincentkoc merged 4 commits into
Conversation
Adapt compatible restricted resume and creation-policy fingerprints from openclaw#156651 (7e56f0b). Keep host policy lifetime independent of severity, preserve transient ownership, and reuse the prepared history during guarded replacement. Co-authored-by: mywondvision <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR preserves compatible restricted Codex conversations and isolates temporary restrictions and grants. Example: A Codex conversation with tools.deny set to ["browser"] receives another message after a Gateway restart.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: restricted continuation remains missing on main, and the implementation has sufficient behavior and upgrade evidence; automatic successor creation still needs a maintainer product decision. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherCore prepares tool-policy lifetime for the Codex plugin, whose lifecycle selects a native thread, verifies its creation policy, and records the resulting binding in plugin state. flowchart LR
A[Admitted request] --> B[Host tool policy]
B --> C[Codex lifecycle]
D[Saved binding] --> C
C --> E[Compatible native thread]
C --> F[Isolated or successor thread]
E --> G[Authorized tool execution]
F --> G
Technical reviewBest possible solution: Approve guarded successors for replaceable managed bindings while retaining compatible native owners, temporary isolation, and protected-owner refusals. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the persistent-restriction-to-transient-thread path; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? The implementation uses existing policy, binding, and projection owners and has convincing supplied boundary evidence, subject to approval of automatic recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 424ed6ae4984. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +250, Tests +892, Docs +13, Other +2. Total +1157 across 31 files. Added test files: 2. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 15, 2026, 6:18 PM ET / 22:18 UTC (Revision 3). |
Carry grant lifetime through private-state projection and retain the MCP predecessor until replacement commits. Align ordinary-session CI fixtures and remove the restricted-helper type import cycle.
|
Follow-up to the evidence request, now at The attached restricted-continuation-second-packet.zip contains the source/runtime binding, selected evidence, regression outputs, reproduction helpers, scoped reviews, and an offline integrity/consistency verifier.
All proofs bind the thirteen-file follow-up and 22,247 canonical built files to the published commit. The new provider is scripted to force permission checks; this is not real-model recall evidence. The original ContextPilot proof remains historical evidence for the previous head. The upgrade uses a preserved stable snapshot rather than freshly executing stable. Failed setup attempts and review limitations are documented; no production deployment occurred. CI passed: current-head run 38802766048, including all three previously failing jobs. The receipt distinguishes source head27e2843f, tested merge1383e0296a and its basecfbbe0c2; runtime evidence separately binds the published source tree. Related to #148329, not a fix for it: authority/client-dependent descriptions, schemas, and catalog membership can still change the dynamic-tools fingerprint. This contribution does not claim catalog stabilization or close that issue. The product decision about automatic guarded successor creation remains with maintainers. The evidence addresses behavior and preservation, not that policy decision. @clawsweeper re-review Second packet archive SHA-256: |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
Maintainer decision: proceed with automatic guarded successors for replaceable managed owners when a persistent creation policy changes or a legacy restricted binding lacks attestation. This is within the current explicit repair-and-land authorization. Source review at I am taking the remaining conflict repair and focused validation through the native maintainer workflow, preserving contributor ancestry and credit. |
|
Merged via squash.
|
) * fix: preserve restricted Codex session continuation Adapt compatible restricted resume and creation-policy fingerprints from openclaw#156651 (7e56f0b). Keep host policy lifetime independent of severity, preserve transient ownership, and reuse the prepared history during guarded replacement. Co-authored-by: mywondvision <[email protected]> * fix(codex): preserve transient grants and MCP replacement ownership Carry grant lifetime through private-state projection and retain the MCP predecessor until replacement commits. Align ordinary-session CI fixtures and remove the restricted-helper type import cycle. * test(codex): bind retired-owner startup fixture --------- Co-authored-by: mywondvision <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Related: #144917. Builds on #156651 (mywondvision).
Related to #148329, but does not resolve it: authority/client-dependent tool descriptions, schemas, and catalog membership can still change the durable fingerprint. This PR addresses compatible restricted continuation and temporary-grant isolation.
What Problem This Solves
A persistent tool restriction can make an ordinary Codex follow-up start a new native thread and resend assembled history. The host must distinguish a conversation-owned restriction from a temporary run-owned restriction or additive grant.
User Impact
Compatible persistent restrictions retain the native conversation across warm turns and Gateway restarts. Temporary restrictions and additive grants use isolated owners and return to the durable conversation afterward. No-op wildcard and scheduled policies retain ordinary continuation.
When a persistent creation policy changes, the existing guarded replacement operation prepares a successor using already-assembled history. Failed startup preserves the previous binding and protected owners retain their refusal behavior. In the covered configured-MCP ownership transition, predecessor cleanup follows replacement commit; independent rotation reasons retain their existing behavior. Automatic guarded recovery is approved under the current maintainer repair-and-land authority: see the recorded decision. Temporary grants remain isolated and protected-owner refusals remain in force.
Why This Change Was Made
The restricted-resume and creation-policy fingerprint foundation adapts mywondvision's #156651 at
7e56f0b802b8fe9deb3d5ed95b469fb50aa69278, with attribution retained. This contribution adds host-produced policy lifetime, guarded recovery, prepared-history replay, and regression coverage. If merged, maintainers or the original author can close #156651 as superseded; no prior agreement is claimed.The optional persisted fingerprint needs no schema migration. Legacy unattested owners transition once through existing guards. No compaction implementation, retry subsystem, replacement database, or separate bootstrap-acceptance PR #172450 is included.
The follow-up commit
27e2843f8901d45174b19bf0cd90503e86d107b2fixes a static import cycle, aligns ordinary-run test fixtures without weakening assertions or shared defaults, preserves temporary grant lifetime across the private-state boundary, and orders restricted replacement checks after configured-MCP ownership classification. The follow-up is 13 files, +59/-21; the full PR is 31 files, +1252/-95, including its adapted foundation and tests.Evidence
The latest prepared head is
9fbda548dcc9e3dbb77859eeca8ba4a8ef4102a3. It adds one test-fixture correction to the production candidate below: the retired-owner fixture now explicitly enables tools and verifies that its session binding exists before testing handoff. The default disabled-tools policy correctly selects transient ownership and must stay isolated.436af482425d1845f4d6aab18ab84e02c7bcd39f: 2 timed-out retired-owner tests, 15 passed; 287.23s Vitest / 296.29s wrapper.pnpm test -- extensions/codex/src/app-server/attempt-startup.test.ts --maxWorkers=1). No tests added; both lifecycle assertions remain intact. On exact-head CI38870439836, all 17 startup cases passed; reported test time totals 3.973s, with the two repaired cases taking 209ms and 190ms. The containing shards passed 243 tests across 17 files.consistent-returnfailure already fixed in PR173976 (8425c9a0cf88a08614785703753dea3c92811feb), and one self-hosted runner lost communication without reporting a test failure. No jobs were rerun to obtain green; the real fixture correction receives normal new-head CI.The production candidate
436af482425d1845f4d6aab18ab84e02c7bcd39fintegrates frozen maind4babe8e8ba448bd21bdc4c89de0d223a4353faa, preserving its context-engine assembly boundary. Review also found that a trusted scheduled wildcard incorrectly inherited turn scope from an unchanged conversation denylist/profile. The correction preserves conversation lifetime for that case while retaining account-scoped scheduled policy isolation, finite caps, and temporary grants.The same review also caught a raw wildcard fingerprint mismatch. Host-attested no-op wildcard changes now preserve the native thread in both warm and cold transitions; unscoped, finite, empty and symbol-restricted policies remain isolated. The existing system-agent allowlist predicate is shared by selection and policy preparation.
Validation on the integrated candidate:
No current live-model, ShellBench token, latency or resident-memory improvement is claimed.
Prior contributor evidence
Current source:
27e2843f8901d45174b19bf0cd90503e86d107b2; tree1480084c7962f6afa41959a9f37da43e9d03a46f. Follow-up patch from reviewed head604bc2738a19ec85085801a72451bf41b681d536: SHA-256b8ecd1aac3d0cb68904fa85018484be58da59e57daf597a29e424ecea5899c32.qaRuntimebuild passed on Node 24.19.0 / pnpm 12.10.1. Linux smoke and all 22,247 built-file hashes match the admitted manifest before and after the effect proof. Generated build metadata embeds the pre-commit base; the full source/patch/runtime manifest establishes exact equivalence to the published commit.1383e0296ac2b8dac9543796d7a3e1ab4c17cade(source head27e2843f into basecfbbe0c2); runtime proofs above bind the published source tree separately.The new provider intentionally forces tool calls; this is final-effect and ownership evidence, not real-model recall or reasoning evidence. The first packet's four actual ContextPilot requests remain historical evidence for
604bc2738a19ec85085801a72451bf41b681d536, not a new-head model run. No production deployment or live baseline performance claim is made.First packet: published archive. Second packet:
restricted-continuation-second-packet.zip, attached with the follow-up response. It includes the completed hosted CI receipt and an offline integrity/selected-evidence consistency verifier.Second packet archive SHA-256:
e623ac588250c8e710c4e413d545caf1fcdd1d5130ce65c2967239c5b1e8ac98.restricted-continuation-second-packet.zip