Repository navigation
fix(codex): keep native children accessible after automatic completion - #155353
stackingrockss wants to merge 2 commits into
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. |
|
@steipete Could you review or route this native Codex continuity fix to the appropriate component maintainer? You are a recent author of the affected catalog builder. The repository requires owner involvement for material behavior changes, and this contribution needs maintainer review before landing. The exact head is I cannot add a formal review request with my current repository permissions. Please route the required review and, once review and exact-head CI pass, use the repository-supported landing workflow. No approval or bypass is assumed. |
|
Codex review: needs real behavior proof before merge. What this changesThe Codex plugin stabilizes message-tool registration across completion turns, adopts matching legacy catalogs, and adds parent-child continuity regression coverage. Review scores
Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 7 items remain Keep open: the contribution addresses a distinct continuity defect, but the previously reported required-delivery blocker remains unresolved. Newer main work preserves assignment records across rotation without establishing equivalent native parent-child access. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherThe Codex plugin translates OpenClaw turn tools into native Codex thread catalogs. Catalog compatibility determines whether a parent resumes its existing task tree, while the separate execution bridge controls which tools the current turn can run. flowchart TD
A[OpenClaw turn and delivery policy] --> B[Tool registration builder]
B --> C[Catalog compatibility selector]
D[Saved parent catalog] --> C
C --> E[Resume parent or replace thread]
E --> F[Native child task tree]
A --> G[Authorized execution bridge]
E --> G
G --> H[Channel delivery]
Technical reviewBest possible solution: Keep native child access and required delivery compatible together, preserving pending results with an explicit retryable failure whenever the existing native catalog cannot support delivery. Do we have a high-confidence way to reproduce the issue? Yes: a legacy fingerprint without message, required message delivery, and an allowlist containing other tools reach the faulty adoption branch. The contributor records the matching native rejection; this review did not execute it. Is this the best way to solve the issue? No: stable registration is useful, but silently adopting a catalog that cannot perform required delivery is incomplete; merely disabling adoption would reintroduce parent replacement. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 27ba9720f2c5. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +88, Tests +234. Total +322 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (5 earlier review cycles)
Reviewed October 6, 2026, 10:52 PM ET / October 7, 2026, 02:52 UTC (Revision 6). |
Fixes #155361
Current status — not merge-ready
Current-head review found a new P1: preserving a legacy catalog without
messagecan make requiredmessage_tool_onlydelivery uncallable when the allowlist includes other tools. A production-selector + real native-resume + bridge probe now confirms this failure. No safe complete repair was established under the pinned native persisted-catalog contract; work is blocked, not merge-ready. The earlier local no-blocker review did not catch this.CI run 35682737820: 38 passed, 2 failed, 18 skipped. All four continuity cases and baseline ratchets passed. Remaining failed native output-fidelity cases now expose
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; the aggregate gate consequently fails. This establishes sandbox setup failure before intended command execution, not the exact host-policy cause. No sandbox weakening or test skipping is proposed.Four-case hosted CI timings (disableMessageTool / legacyCatalog): false/false 19.314s, true/false 11.372s, false/true 9.964s, true/true 9.782s. Required-message delivery remains unresolved; the new production/native-boundary probe below confirms its failure. Earlier direct-protocol success must not be read as covering required delivery.
Confirmed required-delivery blocker at the production/native boundary
Using isolated Codex 0.154.0, the production compatibility selector preserves the legacy catalog without
message. Direct execution of the real message tool succeeds through an isolated test channel transport, establishing that the transport itself works. Resuming the real native parent does not addmessage, even when supplied indynamicTools; a model-requested message call then returnsunsupported call: message, with zero bridge dispatches.Simply excluding all required-delivery turns from compatibility causes parent replacement instead, reintroducing the active-child orphaning this PR is intended to prevent. Neither behavior is an acceptable complete repair.
Failing-first regression: the existing four cases passed; the new required-delivery case failed as intended after successful real transport execution. Total runner time 28.18s, cases 4.212 / 3.709 / 3.678 / 3.662 / 4.570s. The intentionally failing patch is retained as evidence and was not committed to the PR. The checkout remains clean at the stated head.
This probe crosses the production selector, real native resume, and bridge boundary, but is not full Gateway E2E. It proves a blocker, not successful upgrade delivery.
Recommended design decision: preserve the parent and pending delivery with an explicit retryable failure, then implement either native additive catalog migration or a separately designed, authorized, receipt-backed Gateway delivery mechanism. No such delivery mechanism or native migration is implemented by this PR. Do not merge the current repair as complete.
What Problem This Solves
Fixes native Codex children becoming inaccessible from their existing parent when a forced-message initial turn is followed by an automatic completion turn.
User Impact
The parent retains the same native task tree across this delivery-mode transition, so it can continue interacting with its existing child instead of silently starting a different parent thread.
Upgrade behavior: existing ordinary parents whose persisted catalog lacks only
messageretain that exact inherited catalog and fingerprint. This compatibility path is accepted only when every remaining tool declaration matches; unrelated catalog changes still rotate. Report-only completion isolation is preserved. This change does not recover task trees that were already separated.Why This Change Was Made
The initial forced-message turn registered
message, but an automatic completion turn omitted its declaration. That catalog difference rotated the native parent thread, leaving the existing child outside the new parent task tree.New ordinary parents use a stable, registration-only
messagesuperset. Existing narrowed parents keep their compatible original registration. Actual execution still uses the current turn’s authorized tool set; registering a schema does not enable its execution. Restricted/subagent catalogs and runtime authorization remain unchanged.Catalog preflight and shell-tool placement were extracted into focused helpers to stay within repository line-cap ratchets; no baselines or safety checks were relaxed.
Evidence
Current repair head:
389a4c5e8de373bda30eadcf85c6230855698e6d.Regression and independent review
disableMessageToolfalse/true, child continuity across completion/resume, and rotation for unrelated catalog changes. The native app-server/task tree in this regression is a protocol fake.pnpm test -- extensions/codex/src/app-server/native-child-continuity.test.ts --maxWorkers=1— 26.50s runner wall, 25.06s Vitest duration. This is integration-level coverage, not a lightweight unit test.pnpm checksuccessfully. The reviewer’s nonblocking legacy+explicit-denial matrix suggestion was added and the final 4-case matrix rerun.pnpm check:changedandgit diff --checkpassed, including production/extension-test types, lint, line-cap/baseline guards, dead exports, boundaries, and runtime import cycles.Real native evidence — bounded claim
An isolated Codex 0.154.0 app-server process, using a fresh disposable home/workspace and a scripted loopback model, spawned a real native child, resumed the same native parent, and successfully sent input to that child for both full and inherited narrowed catalogs. No live Gateway, existing owners, credentials, or production threads were used.
Redacted native receipt summary (synthetic test IDs replaced by labels):
This is real native-process continuity evidence with direct protocol calls, not a live-model or full Gateway upgrade/completion-delivery end-to-end run. The production catalog-selection/adoption integration is covered by the explicitly mocked regression; no deployment or existing-thread recovery is claimed.
Hosted CI investigation
Original run: https://github.com/openclaw/openclaw/actions/runs/35678080498
dynamic-tool-build.tsline-cap growth (841 → 845). Repaired without changing the baseline.8047216e; its fixture, native helper, Codex 0.154.0 pin, and lockfile integrity match the investigated snapshots.bwrapnamespace denial. That does not establish CI’s exact cause or prove it unrelated.AI-assisted implementation and independent local review. Requesting component-maintainer review of adoption behavior and the explicitly bounded native proof before landing. PR remains unmerged; no Gateway update/restart is part of this change.