Repository navigation
Conversation
…es rotation Nine distinct rotation checks in startOrResumeThread passed the same operation string, "rotating a stale thread binding", to clearCurrentBinding. The refusal correctly preserved the thread but named none of the nine settings that could have drifted, and at normal logging levels there was nothing else to distinguish them. Give each check the cause its own debug line already reports. Three of the strings are the ones the assertCodexBindingMayBeReplaced call directly above that check already uses, so a refusal names one consistent cause whichever guard fires first. assertCodexBindingMayBeReplaced and every control-flow path are unchanged. The remaining generic string in thread-lifecycle-io.ts stays: it fires after a failed thread/resume, where the binding really is stale. Refs openclaw#135310
|
🦞👀 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. Reviewed October 3, 2026, 4:32 AM ET / 08:32 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Codex plugin names the incompatible setting in thread-replacement refusals and preserves that cause in later commit-conflict errors, with synthetic and real-binary regression coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. The new real-binary lifecycle evidence resolves the earlier proof blocker for this diagnostic-only change, and no blocking correctness or security finding remains. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin connects OpenClaw sessions to native Codex threads. Its lifecycle compares saved bindings with current settings and either continues the thread, safely replaces it, or reports why replacement cannot proceed. flowchart TD
A[Session and current settings] --> C[Thread lifecycle]
B[Saved thread binding] --> C
C --> D[Compatibility and ownership checks]
D --> E[Continue native thread]
D --> F[Stage permitted replacement]
D --> G[Specific refusal]
F --> H[Commit replacement or report specific conflict]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +236. Total +256 across 6 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. Technical reviewBest possible solution: Keep one lifecycle owner that reports the specific incompatibility through refusal and replacement failure while preserving native ownership and existing cleanup. Do we have a high-confidence way to reproduce the issue? Yes, from source: a deferred-tool loading mismatch reaches the generic replacement operation on current main. The contributor also records before/after real-binary conflict evidence; this review did not execute it. Is this the best way to solve the issue? Yes. Supplying specific causes at the existing checks and carrying that metadata to the existing conflict error is a narrow repair without competing policy or state ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5df82fa43619. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Status on the remaining before-merge item, so it does not sit open without an answer. The review asks for after-fix evidence from a real OpenClaw/Codex setup showing the specific refusal and the preserved binding. I tried to produce that on the host I have and could not, so this PR does not claim it. What is available here: the pinned Codex CLI ( Reaching the changed refusal needs a persisted thread binding produced by a real Codex session. That needs a login, which I am not going to perform to manufacture a proof. I am also not going to hand-write a binding into a session file and call the result a real setup, because the hand-written part would be precisely the part under review. So, plainly:
For a maintainer who does have a working Codex login, the reproduction is short: bind a thread, change one incompatible setting (the dynamic tool loading mode is the cleanest, since it is the only possible cause on that path once native model ownership is in play), start again, and read the refusal. If that evidence is required before this can land, this PR is blocked on someone else's environment, not on more work here. I would rather say that than pad the body with a substitute. |
|
On the two earlier proposals the review flags as #135413 and #137972 were closed by their own author on 2026-09-04 for a mechanical reason. @gaoanze888 says it plainly in the closing comment on #137972: #135413's base was over 1300 commits behind main, main had since refactored
This branch is that re-application, written against On the remaining before-merge item: I cannot supply it and would rather say so than pad the PR. Real-setup evidence needs a Codex App Server with a materialized supervised thread, and there is none on the machine this was developed on. The Limitations section already records that the supervised branch of If a maintainer with a live Codex setup wants to confirm it, the shortest path is the issue's own reproduction: adopt a supervised binding, change only the persisted |
…191522) Name the incompatible setting in the existing thread-rotation refusal using the label already available at the comparison owner. Rotation conditions and native binding preservation stay unchanged. The focused lifecycle regression fails on main's generic message and passes with the fix (7 cases). Validated on Crabbox with touched-file lint/format; independent autoreview found no actionable P0-P2 findings. The separate 10-line allocation covers the net regression growth in the existing ownership table. Supersedes #148530, thanks @DasX. Co-authored-by: Peik S. <[email protected]>
|
Thanks @DasX for diagnosing this and working through the refusal cases. The smaller replacement landed in #191522 (ccac42b): it uses the setting label already known by the comparison owner, with a regression that fails on main and passes after the fix. Your co-author credit is preserved. Closing this as superseded by the merged replacement. |
…penclaw#191522) Name the incompatible setting in the existing thread-rotation refusal using the label already available at the comparison owner. Rotation conditions and native binding preservation stay unchanged. The focused lifecycle regression fails on main's generic message and passes with the fix (7 cases). Validated on Crabbox with touched-file lint/format; independent autoreview found no actionable P0-P2 findings. The separate 10-line allocation covers the net regression growth in the existing ownership table. Supersedes openclaw#148530, thanks @DasX. Co-authored-by: Peik S. <[email protected]>
What Problem This Solves
Refs #135310. This revision reapplies the diagnostic fix to the current staged-replacement lifecycle after merging main at
a45979ee0f76. It does not restore the old lifecycle implementation.Nine incompatibility checks currently report only
rotating a stale thread bindingwhen native ownership refuses replacement. If replacement is permitted but its later compare-and-swap fails, the diagnostic instead loses the cause ascommitting a fresh thread.User Impact
The refusal identifies the changed setting: runtime identity, MCP configuration, web search, context-engine binding, user MCP configuration, network proxy configuration, plugin app configuration, dynamic tool loading mode, or dynamic tool catalog. The same staged cause also reaches a later replacement commit conflict.
Thread ownership and recovery behavior do not change. The existing guard, expected predecessor thread ID, mutation ordering, inventory preservation, subscription release, and rejection cleanup are unchanged. A genuinely fresh start without a staged replacement retains its existing conflict message.
Why This Change Was Made
rotateStaleBindingsupplies the specific diagnostic operation.stageBindingReplacementcaptures it with the predecessor and passes it through the existing start context tostartFreshCodexThread. The value is diagnostic metadata, not an authorization or configuration input. Other already-specific staging reasons also survive the commit boundary. The generic reason after an actually failed stale-thread resume remains generic.The previous synthetic ownership regression now lives in the assignment-rotation suite rather than growing the oversized binding test file. A separate real-binary test is registered with the existing database-worker test owner.
Evidence
All evidence below is from this revision's local run, Linux x64, Node 24.21.0. Commands run serially in memory-limited units.
Before and after
With main's production code, the ownership regression and replacement-CAS regression both fail specifically because the operation is too generic. An additional test against the pinned real Codex 0.160.0 app-server reproduces the later conflict:
The temporary thread ID is replaced above. After the fix, all 10 tests in the assignment-rotation and new native-diagnostic suites pass, including the real-binary test.
The real-binary test starts actual native threads through the production OpenClaw lifecycle and persists the original binding through its SQLite store. It injects only a failed replacement-commit result. It verifies the specific conflict, unchanged original binding, still-readable predecessor thread, expected predecessor ID in the mutation, and deletion of only the uncommitted replacement. The native check passed in 1425 ms within the final suite run.
Verification
Final local verification on
116130492c085a37108bab211d087cd61acfb113is green:287 tests in 9 files, two sequential shards, 151.788 s wall time:
pnpm test \ extensions/codex/src/app-server/thread-lifecycle.binding.test.ts \ extensions/codex/src/app-server/thread-lifecycle.test.ts \ extensions/codex/src/app-server/thread-lifecycle.configured-mcp-ownership.test.ts \ extensions/codex/src/app-server/thread-lifecycle.app-inventory.test.ts \ extensions/codex/src/app-server/thread-lifecycle.user-mcp-servers.test.ts \ extensions/codex/src/app-server/thread-lifecycle.adoption.test.ts \ extensions/codex/src/app-server/thread-lifecycle.native.test.ts \ extensions/codex/src/app-server/thread-lifecycle.assignment-rotation.test.ts \ extensions/codex/src/app-server/thread-lifecycle.rotation-cause.native.test.ts \ --maxWorkers=1npx oxlint --type-awareon all five changed TypeScript files: zero warnings and errors. The repository's SDK boundary declaration preparation was required first.pnpm tsgo:extensions: exit 0, 330.074 s. This is the full production extensions graph, not the incomplete raw package graph.pnpm check:line-cap-ratchet --base a45979ee0f7635a4bf9918a8ea648e6d0a415e51: pass.pnpm check:max-lines-ratchet --base a45979ee0f7635a4bf9918a8ea648e6d0a415e51: pass.node scripts/check-no-conflict-markers.mjs,oxfmt --checkon all six changed files, andgit diff --check: pass.The local merge commit preserves the exact tested file tree. Publication is a normal fast-forward push from the previously published PR head, not a force push.
Proof boundaries
type: function;defer_loadingis serialized asdeferLoading.Maintainer question on the outstanding proof request: does this isolated real-binary lifecycle proof, together with the ownership and preservation regressions, suffice for this diagnostic-only change, or is a fully adopted supervised-session reproduction still required before merge?