Repository navigation
fix(codex): prepare web search policy before harness dispatch - #174774
Conversation
|
🦞👀 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. |
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb0922e550
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR prepares web-search policy in core and binds its use to current native-model and requester authority. Example: Requester ID native-search-requester-late-requester-id-created is created after asynchronous admission.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review The session-ID P1 and prior security hold are cleared at the reviewed head; no remaining introduced defect was found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCore prepares policy from session metadata and model identity, then Codex validates those facts through its existing lifecycle and native JSON-RPC write admission. flowchart LR
A[Agent attempt] --> B[Core policy preparation]
C[Session worker and publications] --> B
B --> D[Prepared model and requester facts]
D --> E[Codex native policy owner]
C --> E
E --> F[Synchronous write assertion]
F --> G[Native JSON RPC transport]
Technical reviewBest possible solution: Keep prepared policy as attempt data and enforce its model, requester, and ID-selection bindings through the existing native-write owner. Do we have a high-confidence way to reproduce the issue? Current-main source lacks the prepared model/requester binding, while the supplied native-boundary controls demonstrate the stale-authority failure on earlier heads; this read-only review did not rerun them. Is this the best way to solve the issue? The repair uses existing policy, publication, and native-admission owners, removes the asynchronous-only ID path, and preserves the accepted fallback scope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c51d21c0d73e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +434, Tests +750, Docs +18. Total +1202 across 31 files. Added test files: 2. View PR surface stats
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 HistoryReview history (13 earlier review cycles; latest 8 shown)
Reviewed October 19, 2026, 1:56 AM ET / 05:56 UTC (Revision 14). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
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.
|
Addressed the findings in this review on the new head
All 12 individually invoked Node-runtime suites pass: selection (91), execution environment (22), base dynamic-tool-build (74), web-search dynamic-tool-build (18), sandbox dynamic-tool-build (6), native authority (13), provider review (14), capability store (10), prefix stability (5), host model execution (18), original deletion regression (2), and native boundary proof (6): 279 tests passed. Core and Codex source types, SDK surface/exports, Madge (zero cycles), touched lint/format, docs, and diff/line-cap checks pass. Independent committed-branch autoreview is clean through P2: “patch is correct.” |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10efe93144
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Preserve native source assertions and requester admission checks while adapting the prepared-policy regressions to current test fixtures. Keep the pre-existing unbound side-run fallback scoped to the separate F78 follow-up.
|
@clawsweeper re-review Merged current main into The pre-existing |
|
🦞👀 Re-review progress:
|
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.
|
@clawsweeper re-review Current head: The native PR worktree’s frozen install passed. All 20 boundary tests, all six recording-JSON-RPC native cases under Node, the exact failed root test-type config, targeted lint, and formatting pass. Independent Codex review is scoped-clean through P2. The native proof still completes allowed cached search with two writes and rejects all five stale model/requester cases with zero writes. The unchanged |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b833540890
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
|
@clawsweeper re-review Please review exact head The existing session-currentness owner now retains ID selection, including absence and reassignment, through the synchronous assertion at the physical native write. It also covers ID-affecting commits pending host publication. The separate asynchronous-only ID path is removed. Validation at this head: all 9 native-boundary cases pass, including late absent-to-present and reassignment controls; 19 session-owner tests and 103 Codex app-server tests pass. Core/source/test types, SDK surface/export synchronization and scoped source compatibility, lint/format, docs links, and zero-cycle checks pass. Independent committed-branch Codex review reports no findings through P2 and “patch is correct.” The existing helper's optional ID selector is additive; existing key-only and prepared-policy callers retain their source contract. F78 ( |
|
🦞👀 Re-review progress:
|
Preserve the prepared model and requester binding, including retained session-ID write admission, while keeping the asynchronous recovery lookup from main.
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.
|
@clawsweeper re-review Please review exact head The follow-up correction preserves memory-backed native classification while allowing durable ID-selected worker compaction. Cold storage passes 36/36 on both Node and Bun, session owners 29/29, and Codex app-server 103/103; types, SDK surface/exports, import cycles, touched checks, and independent full-branch review pass. The PR description contains the regression and exact-head proof. Please explicitly assess whether the repaired P1 and prior security hold are cleared. The already-dispositioned |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Deleting another agent can make a healthy agent's Codex turn fail with
Session capability metadata requires worker preparation. Preparing search policy in core fixes that lookup, but the resulting allowance must remain bound to the native model and requester facts it was computed from.A model switch or requester revocation between preparation and native capture could previously enable hosted search with stale policy. Compaction also performed an unused search lookup with different execution and sandbox-policy owners.
User Impact
Healthy Codex turns use core's worker-prepared search policy. A changed native model or requester now rejects the stale operation before native thread/turn writes with an actionable retry message. Compaction keeps its existing execution owner and skips unused search preparation.
Why This Change Was Made
This preserves the maintainer's prepared-data decision: optional
preparedWebSearchPolicydata on existing attempt parameters, with no new SDK export, callable policy capability, or capability version. Existing no-field and two-boolean SDK callers remain source-compatible. Codex still applies per-turn tool caps and memory-flush restrictions.Core records the exact model tuple and requester policy/lineage reads used during preparation. The existing native-policy owner compares them with captured/current facts, retains keyed and ID-selector source checks, and synchronously asserts them at the physical native write, including absent or reassigned IDs and pending worker publications. A mismatch never consumes the old allowance or falls back to synchronous policy resolution. The native requester-admission prerequisite from #176352 is included.
Evidence
Current candidate:
2d00df6de14265b781d878ee14e37451e6e0b845, including the session-ID native-admission repair and the follow-up cold-storage correction. The earlier CI run 39198024879 exposed four cold-storage lifecycle failures: durable ID-selection authority was incorrectly classified as native-only, so manual compaction rejected it. The same file passed 35/35 on both Node and Bun at main parent6e4883fca44e. The current fix preserves native classification for memory-backed sources while allowing durable ID-selected authority through worker compaction. The restoration-race fixture now injects its mutation at the actual prepared assertion; its refusal and archive-preservation checks are retained.Current-candidate proof: 213 test passes: cold storage 36/36 on Node and 36/36 on Bun, native transport 9/9, session owners 29/29, and Codex app-server 103/103. All eight stale-authority native cases make zero native writes; the allowed case makes two writes with cached search. The new direct ID-selected cold-compaction test failed before the production correction and passes afterward. Core, Codex and scoped test types, shipped SDK v2026.10.5 surface/export checks, zero-cycle check, and touched lint/format/whitespace checks pass. Independent full-branch Codex autoreview is scoped-clean through P2, with no findings and the verdict “patch is correct” (0.86). Production correction: +3/-3; no new SDK signature, export, protocol, config, storage format, or F78 change. ClawSweeper Revision 14 explicitly clears the session-ID P1 and prior security hold on this exact head, with no remaining findings; its review accepts the supplied native and cold-compaction proof. Broad CI remains a separate gate.
Current CI attribution: 39206346345 tests head
2d00df6de142through merged124b88ea9d7af9348a8571d046da643ec131e37into mainfbc4e3a20f52. Job 117910334772 fails onlysrc/gateway/talk/client-authority.test.ts>steers a GA chat-owned Talk run captured before backend publication=true, expectingtool_authority_mismatchbut receivingno_active_run. Scheduled main 39205204421 ate3cc361b27cbhas the identical case and failure signature, and the test blob is unchanged between that main, the CI base, and the tested merge. This is an inherited CI failure, not passing CI; the native inherited-failure exception may be used only after every remaining job finishes and its gates are satisfied. No CI rerun or synthetic push was used.Latest reviewed candidate:
7c788f06256ced8fb3292159d4092b8c3b63bf4e, merging main6e4883fca44ed3e8174b4dfef16ee17e03ba1621into97b231c1bed1ee13046e1645b41955a73674ebb8to resolve the GitHub conflict. The one manual resolution preserves the prepared model guard and requester binding alongside main's asynchronous recovery lookup from #176707. No rebase.Post-merge proof: 69 focused tests passed across the real native transport (9), deletion/policy preparation (2), execution policy (22), native-model lifecycle (18), and web-search tool construction (18). All eight stale-authority native cases reject with zero thread/turn writes; the unchanged case completes with two writes and cached search. Core and Codex types, targeted lint/format, and whitespace checks pass. Independent full-candidate Codex review is scoped-clean through P2, “patch is correct.” The test wrapper completed all four shards and verified its compiler outputs (868.32 seconds total).
Session-ID repair head:
97b231c1bed1ee13046e1645b41955a73674ebb8. It fixes the session-ID admission finding by retaining ID selection (including absence) in the existing session-currentness owner through the synchronous physical-write assertion. ID-affecting worker commits pending host publication also invalidate admission. The former asynchronous-only ID path is removed. See the finding reply.At this head, all 9 recording-JSON-RPC native-boundary tests pass, including late absent-to-present and reassignment controls; all 19 session-owner tests and 103 Codex app-server tests pass. Core, Codex-source and scoped test types; SDK surface/export synchronization and scoped source compatibility; lint/format; docs links; and zero-cycle checks pass. Independent committed-branch Codex review is scoped-clean through P2, with no findings and the verdict “patch is correct.” The optional ID selector extends the existing helper additively; previous key-only helper and no-field/two-boolean prepared-policy callers compile unchanged.
The native late-ID controls fail on the preceding
b833540890echead because a stale allowance reaches the native write. The pending-publication control also fails before the publication guard is added. Final native proof requires zero writes for changed authority. No live provider or operator Gateway was used. Broad CI and ClawSweeper security re-review for the merged head remain required before landing.Historical CI: 39186087240 passed at
b833540890ecbaa06071a166ffa30b3d0c6b3518, after repairing the direct test-API import and widened binding literal reported by 39184092677. This is prior-head evidence only.Prior-head proof at
10efe93144a47fbe52da0338557454791509ffef: local recording-JSON-RPC proof uses real core preparation, persisted requester updates, the real Codex harness and binding lifecycle, and real native write admission. No live model provider or operator Gateway was used.cachedA supplemental sixth case captures a real missing-ID read, inserts a restrictive row under another key at native admission, and requires zero native writes. It isolates the ID-selector/transport contract.
On the preserved WIP before requester binding, the fifth case fails with two native writes, search
cached, and a completed turn (325.25s command wall time). The earlier published-head controls also fail for the native-model switch and the compaction owner mismatch.All 12 individually invoked Node-runtime suites pass: selection (91), execution environment (22), base dynamic-tool-build (74), web-search dynamic-tool-build (18), sandbox dynamic-tool-build (6), native authority (13), provider review (14), capability store (10), prefix stability (5), host model execution (18), original deletion regression (2), and native boundary proof (6): 279 tests passed. Core and Codex source types, SDK surface/exports, Madge (zero cycles), touched lint/format, docs, and diff/line-cap checks pass.
Independent committed-branch Codex autoreview is scoped-clean through P2, with no findings and the explicit verdict “patch is correct.” Production delta over the previously published head is +273/−72 (net +201); the whole PR is +322/−80 (net +242). The additional code records the original requester facts and carries their currentness check through existing native admission; it adds no state owner or storage format.
Direct source types and SDK surface/exports are checked locally; packaged SDK declarations remain CI-owned. No new storage, config, protocol, SDK export, or model-facing prompt text is introduced. Pending native supervision without a selected model retains its documented existing policy-resolution path and deletion-time limitation.
Known limitation:
/btwside-runs and native-auth supervision without amodelRefretain the pre-existing unbound policy fallback; binding these paths to prepared data is tracked separately as F78 after this PR lands, consistent with #176352’s exclusion of re-resolving every ancestor policy edit.