Repository navigation
fix(codex): name the dynamic-tool loading replacement operation - #137972
gaoanze888 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 4, 2026, 2:44 AM ET / 06:44 UTC. ClawSweeper reviewWhat this changesThe PR replaces generic supervised-thread replacement messages with named configuration causes, while also changing Codex thread-resume and incognito reuse logic. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 9 items remain Keep open: the branch contains build-breaking lifecycle changes beyond the stated diagnostic fix and removes a native-runtime ownership gate from replacement paths. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin maps an OpenClaw turn to a persisted app-server thread binding, then resumes or rotates that binding when configuration changes. The lifecycle guard prevents a native-owned thread from being replaced with a host-selected thread. flowchart LR
A[OpenClaw turn] --> B[Codex thread lifecycle]
B --> C[Persisted thread binding]
C --> D{Configuration compatible?}
D -->|No| E[Refuse or rotate binding]
D -->|Yes| F[Resume app-server thread]
E --> G[Operator diagnostic]
F --> G
Before merge
Findings
Agent review detailsSecurityNeeds attention: The branch removes a fail-closed native-runtime ownership check from thread replacement paths. PR surfaceSource +14, Tests +18. Total +32 across 2 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. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Restore the current lifecycle resume contract and retain only the cause-specific diagnostic strings needed by the linked issue, preserving every expected native-ownership refusal path. Do we have a high-confidence way to reproduce the issue? Yes, from source: the imported lifecycle names are absent and the resume call no longer satisfies its required context contract, so production type checking can reproduce the failure without running untrusted contributor code. Is this the best way to solve the issue? No: restoring the existing lifecycle contract and applying the diagnostic wording as a narrow patch is safer than combining it with unrequested resume behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fcdd8533696b. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Rebase of #135413 onto current main (
59bfe7734). The original branch base was 1300+ commits behind main, causing stalecheck-lintfailures. Cherry-picked onto current main with no conflicts — main did not touch the 2 changed files during that window. Original description below.Closes #135310
What Problem This Solves
Supervised Codex threads were correctly refused whenever a persisted lifecycle fingerprint drifted from the prepared config, but every refusal reported the same generic
Refusing to replace supervised Codex thread <id> while rotating a stale thread binding, hiding which setting actually changed. This PR gives each of the nine lifecycle checks its own cause-specific operation so the refusal names the real mismatch.Why This Change Was Made
startOrResumeThreadreuses one generic"rotating a stale thread binding"operation string at several distinct lifecycle checks. This PR replaces that generic string with a cause-specific operation at each site:changing the app-server runtime identitychanging MCP configurationchanging web-search configurationchanging the context-engine bindingchanging the user MCP serverschanging the network proxy configurationchanging the plugin app configurationchanging the dynamic tool loading modechanging the dynamic tool catalogThe fail-closed ownership guard (
assertCodexBindingMayBeReplaced) and the binding mutation order are unchanged; only the operator-visible operation text is narrowed. Checks that already passed a specific operation (configured MCP ownership, native-tool/delegation-restricted turns, ring-zero, GPT-5.6 multi-agent, ephemeral/plugin-app warm-rotate) are left as-is.User Impact
Operators and maintainers can now see exactly which configuration drifted (e.g. web search vs. dynamic tools) instead of a generic stale-binding message, without any change to the supervised-binding safety guarantee.
Evidence
Exact head:
3d34631288a61bbcbaefc86e5d5581a8167a46ed.extensions/codex/src/app-server/session-binding.test.ts— new focused regression proving the specific operation is interpolated into the supervised refusal (while changing the dynamic tool loading mode) and that a non-supervised binding is not refused. 55 passed.extensions/codex/src/app-server/thread-lifecycle.binding.test.ts— 136 passed (fail-closed supervised-binding behavior preserved).check:changedpass for the changed files.AI Assistance
AI-assisted implementation. I manually verified each lifecycle-check site, the cause-specific operation strings, the unchanged fail-closed guard, the new focused regression, and the changed-file gates.