Repository navigation
fix(codex): revoked or reassigned requesters can still start native Codex turns - #176352
Conversation
Retain requester policy and parent lineage in the existing prepared native execution policy, then consume that authority at thread, turn, and side-question native effect boundaries. Keep answer settlement and cleanup on their existing authority. Cover allowed, revoked, and reassigned requesters through real lifecycle and JSON-RPC wire admission, including thread resume and side-question dispatch.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR rechecks prepared requester policy and lineage before native Codex thread, turn, and side-question effects. Example: A prepared requester gains inheritedToolDeny: ["exec"] before turn/start.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a current native-dispatch authority bypass, and inspection found no introduced correctness defect. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Codex plugin translates OpenClaw session requests into native JSON-RPC operations; retained session authority governs whether those operations may reach Codex. flowchart LR
A[Session requester] --> B[Prepared native policy]
B --> C[Thread or side question preparation]
C --> D[Live source assertion]
D --> E[JSON RPC writer]
E --> F[Codex app server]
Technical reviewBest possible solution: Use the existing prepared-policy source to reject changed requester authority immediately before each new native effect. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the missing requester predicates and dispatch checks, and the supplied production-path regression reports matching before/after failures; this read-only review ran no target code. Is this the best way to solve the issue? The patch is a focused repair: it extends the existing authority owner, uses the physical writer's admission callback, and preserves completed-answer settlement and cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0960eff1598b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +20, Tests +275, Docs +5. Total +300 across 8 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 18, 2026, 3:36 PM ET / 19:36 UTC. |
|
Merged via squash.
|
Resolve requester web-search policy in core's existing prepared-capability scope and carry it as optional attempt data. Codex consumes the prepared value without a synchronous session-policy read and retains runtime caps. This prevents healthy turns failing during another agent's deletion. Use known native model references for supervised sessions so provider and model restrictions survive the handoff. Pending supervision without a selected model retains its existing policy-resolution path. Keep the synchronous resolver and harness registration contracts intact. Native source-authority revalidation remains separate in #176352. The real builder regression covers persisted denial with topology dirty before preparation and during tool construction; both policy values stay false. Cover native model preparation and preserve no-field runtime caps.
Carry the exact model tuple and consumed requester policy/lineage facts with core's optional prepared web-search result. Reject stale preparation through the existing native execution-policy owner before thread or turn writes, including ID lookups refreshed at physical native admission. Skip unused search preparation during compaction, preserving the separate execution and sandbox-policy owners. Keep existing SDK callers compatible. Include the native requester-admission prerequisite from #176352. Recording native-transport regressions cover unchanged policy, model changes, late revocation/reassignment, revocation before capture, and missing-ID insertion.
…enclaw#176352) Retain requester policy and parent lineage in the existing prepared native execution policy, then consume that authority at thread, turn, and side-question native effect boundaries. Keep answer settlement and cleanup on their existing authority. Cover allowed, revoked, and reassigned requesters through real lifecycle and JSON-RPC wire admission, including thread resume and side-question dispatch.
* fix(codex): prepare web search policy before harness dispatch Resolve requester web-search policy in core's existing prepared-capability scope and carry it as optional attempt data. Codex consumes the prepared value without a synchronous session-policy read and retains runtime caps. This prevents healthy turns failing during another agent's deletion. Use known native model references for supervised sessions so provider and model restrictions survive the handoff. Pending supervision without a selected model retains its existing policy-resolution path. Keep the synchronous resolver and harness registration contracts intact. Native source-authority revalidation remains separate in #176352. The real builder regression covers persisted denial with topology dirty before preparation and during tool construction; both policy values stay false. Cover native model preparation and preserve no-field runtime caps. * fix(codex): bind prepared search policy to requester facts Carry the exact model tuple and consumed requester policy/lineage facts with core's optional prepared web-search result. Reject stale preparation through the existing native execution-policy owner before thread or turn writes, including ID lookups refreshed at physical native admission. Skip unused search preparation during compaction, preserving the separate execution and sandbox-policy owners. Keep existing SDK callers compatible. Include the native requester-admission prerequisite from #176352. Recording native-transport regressions cover unchanged policy, model changes, late revocation/reassignment, revocation before capture, and missing-ID insertion. * test(codex): use the public fixture boundary for native search proof Load the native-search fixture through the existing lazy Codex test API and validate literal native binding fields against their actual contract. Fix the boundary and test-type failures from CI run 39184092677 without changing production policy behavior. * fix(codex): retain requester ID authority through native writes Reject native hosted-search writes when requester ID selection changes after policy preparation. Retain ID selection and absence in the existing session current-check owner, including pending worker publications, and remove the adapter's separate asynchronous ID path. * fix(sessions): preserve worker authority for ID-selected compaction Classify durable ID-selection publication guards as worker-compatible while keeping memory-backed selection native. Preserve the existing live ID, publication, physical-source, and requester checks at native writes. Manual cold-transcript compaction no longer requires unrelated search preparation. Cover the ID-selected path and inject conversation revocation through the prepared restoration assertion without weakening its checks.
…aw#174774) * fix(codex): prepare web search policy before harness dispatch Resolve requester web-search policy in core's existing prepared-capability scope and carry it as optional attempt data. Codex consumes the prepared value without a synchronous session-policy read and retains runtime caps. This prevents healthy turns failing during another agent's deletion. Use known native model references for supervised sessions so provider and model restrictions survive the handoff. Pending supervision without a selected model retains its existing policy-resolution path. Keep the synchronous resolver and harness registration contracts intact. Native source-authority revalidation remains separate in openclaw#176352. The real builder regression covers persisted denial with topology dirty before preparation and during tool construction; both policy values stay false. Cover native model preparation and preserve no-field runtime caps. * fix(codex): bind prepared search policy to requester facts Carry the exact model tuple and consumed requester policy/lineage facts with core's optional prepared web-search result. Reject stale preparation through the existing native execution-policy owner before thread or turn writes, including ID lookups refreshed at physical native admission. Skip unused search preparation during compaction, preserving the separate execution and sandbox-policy owners. Keep existing SDK callers compatible. Include the native requester-admission prerequisite from openclaw#176352. Recording native-transport regressions cover unchanged policy, model changes, late revocation/reassignment, revocation before capture, and missing-ID insertion. * test(codex): use the public fixture boundary for native search proof Load the native-search fixture through the existing lazy Codex test API and validate literal native binding fields against their actual contract. Fix the boundary and test-type failures from CI run 39184092677 without changing production policy behavior. * fix(codex): retain requester ID authority through native writes Reject native hosted-search writes when requester ID selection changes after policy preparation. Retain ID selection and absence in the existing session current-check owner, including pending worker publications, and remove the adapter's separate asynchronous ID path. * fix(sessions): preserve worker authority for ID-selected compaction Classify durable ID-selection publication guards as worker-compatible while keeping memory-backed selection native. Preserve the existing live ID, publication, physical-source, and requester checks at native writes. Manual cold-transcript compaction no longer requires unrelated search preparation. Cover the ID-selected path and inject conversation revocation through the prepared restoration assertion without weakening its checks.
What Problem This Solves
Fixes Codex native thread and turn dispatch proceeding after the requester's prepared policy is revoked or its parent lineage is reassigned.
User Impact
Revoked or reassigned requesters are rejected before new native effects, including
/btw; unchanged authorized requesters continue normally. No configuration change or migration is required.Why This Change Was Made
The existing native execution-policy owner captured execution-host fields but omitted the requester policy and lineage, and native write admission did not consume its retained source assertion. Retain those fields and use the same source at thread start/resume, turn dispatch, and
/btwstartup, hook, fork, and turn boundaries. Completed-answer settlement and cleanup retain their existing authority.This extracts only the native-authority fix from #174774. It keeps the existing V2 contracts and introduces no SDK, protocol, schema, cache, or web-search preparer changes. Production is +31/−11 lines (net +20) across four files; the growth is the explicit requester fields and effect checks, partly offset by removing duplicate
/btwwrappers. Tests are +274 lines: the regression is +262 and the provider-review fixture gains its required typed native policy (+12). Routing is +1 and docs +5.Evidence
The same production-path regression ran with unchanged main production code and then with only the four-file fix applied. The test uses persisted requester updates, real host/lifecycle admission, and physical JSON-RPC writes to a synthetic server. Counts below are native thread requests / native turn requests during the tested operation; resume and
/btwsetup is excluded./btw(3 cases)/btwfork (2)/btwturn (2)Before: 10 failed, 3 passed, 75.93s wall. After: 13 passed, 76.08s wall. Each run used
OPENCLAW_VITEST_RUNTIME=node pnpm test extensions/codex/src/app-server/run-attempt.native-authority.test.ts --maxWorkers=1with isolated temporary state. The after run spent 65.53s in Vitest; 40% was actual test time. The real storage/lifecycle/wire boundary is necessary to detect this bypass; a policy-only unit test cannot prove that no request was sent. CI timing is not yet available.The regression disables hosted web search and revokes native
execpolicy, isolating native admission from the separate web-search preparation defect. It does not prove hosted-search execution, re-resolve every ancestor policy edit, or cancel a turn already accepted by Codex. No live OpenClaw provider inference or Gateway was used.Sibling suites pass individually: native execution policy (8), side question (48), and provider review (14). Core types, Codex package/source types, scoped type-aware lint, core boundary lint, docs sanity, formatting, and madge pass. The final control reruns reproduce 10 failures / 3 allowed passes before the fix and all 13 passes afterward. The committed-branch security autoreview is scoped-clean at P0–P2 with zero findings; simplification and deslop are complete.