Repository navigation
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: needs maintainer review before merge. Reviewed September 16, 2026, 1:42 PM ET / 17:42 UTC (Revision 10). ClawSweeper reviewWhat this changesThe Codex plugin resumes eligible failed conversations on a fresh native process while preserving history, protecting sibling conversations, and testing recovery through Gateway chat requests. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still has the reported recovery failure. The earlier client-bound and Incognito-sibling findings are addressed, and no remaining blocking defect was found. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin translates Gateway chat requests into native Codex conversations. Its startup and resume owners manage shared processes, conversation bindings, and configuration confirmation before a turn reaches the provider. flowchart TD
A[Chat request and current instructions] --> B[Conversation resume owner]
B --> C{Settled failure and safe to replace?}
C -->|No| D[Existing guarded resume]
C -->|Yes| E[Retire client and release lease]
E --> F{Physical exit confirmed?}
F -->|Yes| G[Fresh client resumes saved conversation]
F -->|No| H[Preserve binding and report failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +113, Tests +646, Other +3. Total +762 across 11 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 recovery within the existing resume and shared-client owners, preserving the saved conversation and configuration fence while leaving ineligible shared clients undisturbed. Do we have a high-confidence way to reproduce the issue? Yes. A settled HTTP 400 followed by changed instructions reaches the incompatible native reload condition; current source supports the mechanism and the report supplies a real-runtime reproduction, although this review did not execute it. Is this the best way to solve the issue? Yes. Bounded client replacement preserves the native configuration check and conversation identity, while explicit sibling and process-lifetime guards address the earlier unsafe retirement cases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3343ccd2a3f9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
…es handoff Native thread/resume reloads configuration only for an idle thread. A thread left in systemError by a settled provider failure is loaded but not idle, so it silently ignores the overrides and never emits the notLoaded status change the configuration fence waits for. The fence correctly refuses the unconfirmed configuration, but resume cleanup only retires the client when the unsubscribe fails or the handoff outcome is unknown. Here the unsubscribe succeeds and the outcome is definite, so the same loaded client is preserved and every retry repeats the identical refusal. Carry the observed settled-systemError status to the cleanup site and retire the client in that case, and cover it with a regression that fails when the production change is reverted. Co-Authored-By: Claude Opus 5 <[email protected]>
The explicit String() around an already-string message tripped no-unnecessary-type-conversion in the core lint stripe. Use the rejects.toThrow form the neighbouring cases already use. Co-Authored-By: Claude Opus 5 <[email protected]>
6211888 to
b943ed9
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
landpr-approve-admin-merge |
|
landpr-approve-admin-merge |
|
Thanks @MertBasar0 and @compoodment! Proof: After a controlled HTTP 400, the next send with changed instructions resumes the same conversation on a fresh client, keeps its history, and applies the new instructions. All eight recovery and sibling controls pass on Linux.
|
## What Problem This Solves Fixes openclaw#148837. After a settled native failure, changing instructions could make every later send refuse configuration reload without another provider request. ## Why This Change Was Made The resume owner retires the exact eligible client. Startup releases its lease, waits for confirmed physical shutdown, then resumes the same thread within that send. Unconfirmed shutdown stops with the binding preserved. Client retirement still has one writer: the existing shared-client lifecycle owner. ## User Impact Recovery preserves history and applies the new instructions. Active siblings and idle Incognito siblings veto replacement, preserving the target's existing refusal and their original client/thread. Original-policy Incognito continuation keeps its context. Saved idle siblings can cold-resume after replacement. Client-bound and supervised conversations remain excluded. ## Evidence A real native runtime behind registered Gateway `chat.send`, using a controlled HTTP 400, reproduces the original refusal. Candidate recovery completes with exactly one further request carrying the old marker and new instructions. The pre-correction source also fails the idle Incognito and delayed-exit controls. ```sh node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-server-isolated.config.ts src/gateway/server.codex-failure-recovery.test.ts ``` ## Compatibility No schema, configuration, protocol or SDK change. Overlapping leases conservatively prevent recovery. Follow-up: active-sibling recovery needs a writer-release contract in shared-client-lifecycle.ts. ## Consumers All ordinary native sends use this resume path. Existing retained, claimed, routed and leased state supplies eligibility. ## Invalidation Only the exact failed client is retired. The binding and configuration fence survive replacement. Cancellation is checked before another acquisition. ## Tests Locally, all eight registered scenarios and 685 owner/startup tests pass on a fresh merge with main. The cancellation control checks that the old process is still alive after accepted `chat.abort`, then releases and joins its actual exit. Removing the physical-exit wait still fails the registered test. Both Gateway tests from this change and openclaw#149842 are selected exactly once, with runtime preparation retained. The prior hosted run failed the cancellation control and startup's line cap. The fixture now holds the launcher's final resume until release, and the unchanged cleanup predicate lives with the existing cleanup operations. Local type-aware preflight and both line checks pass; hosted results for this revision are pending. Production growth is 113 lines: cleanup +36, startup −9, runtime facts +26, routing facts +22, resume eligibility +25, status +4 and the internal replacement error +9. These compose existing owners without a second lifecycle or store. Growth accepted under the owner's standing acceptance (2026-09-15). Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes #148837. After a settled native failure, changing instructions could make every later send refuse configuration reload without another provider request.
Why This Change Was Made
The resume owner retires the exact eligible client. Startup releases its lease, waits for confirmed physical shutdown, then resumes the same thread within that send. Unconfirmed shutdown stops with the binding preserved. Client retirement still has one writer: the existing shared-client lifecycle owner.
User Impact
Recovery preserves history and applies the new instructions. Active siblings and idle Incognito siblings veto replacement, preserving the target's existing refusal and their original client/thread. Original-policy Incognito continuation keeps its context. Saved idle siblings can cold-resume after replacement. Client-bound and supervised conversations remain excluded.
Evidence
A real native runtime behind registered Gateway
chat.send, using a controlled HTTP 400, reproduces the original refusal. Candidate recovery completes with exactly one further request carrying the old marker and new instructions. The pre-correction source also fails the idle Incognito and delayed-exit controls.Compatibility
No schema, configuration, protocol or SDK change. Overlapping leases conservatively prevent recovery. Follow-up: active-sibling recovery needs a writer-release contract in shared-client-lifecycle.ts.
Consumers
All ordinary native sends use this resume path. Existing retained, claimed, routed and leased state supplies eligibility.
Invalidation
Only the exact failed client is retired. The binding and configuration fence survive replacement. Cancellation is checked before another acquisition.
Tests
Locally, all eight registered scenarios and 685 owner/startup tests pass on a fresh merge with main. The cancellation control checks that the old process is still alive after accepted
chat.abort, then releases and joins its actual exit. Removing the physical-exit wait still fails the registered test. Both Gateway tests from this change and #149842 are selected exactly once, with runtime preparation retained.The prior hosted run failed the cancellation control and startup's line cap. The fixture now holds the launcher's final resume until release, and the unchanged cleanup predicate lives with the existing cleanup operations. Local type-aware preflight and both line checks pass; hosted results for this revision are pending.
Production growth is 113 lines: cleanup +36, startup −9, runtime facts +26, routing facts +22, resume eligibility +25, status +4 and the internal replacement error +9. These compose existing owners without a second lifecycle or store. Growth accepted under the owner's standing acceptance (2026-09-15).