Repository navigation
fix(codex): let saved conversations recover after a remote failure - #201621
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: passed. What this changesThis PR unloads failed remote Codex runtimes before asking users to retry their saved conversation. Example: A saved WebSocket conversation reaches systemError, then its developer instructions change.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current saved-conversation recovery failure through the existing lifecycle owner, and no definite introduced correctness defect was found. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex plugin translates Gateway conversation requests into native app-server operations while preserving thread bindings, history, configuration checks, and sibling work. flowchart TD
A[Gateway conversation request] --> B[Codex lifecycle owner]
B --> C[Saved thread binding]
B --> D[Remote app-server]
D --> E[Unload confirmation]
E --> F[Retry notice]
F --> B
Technical reviewBest possible solution: Keep recovery in the existing lifecycle owner, preserve the saved binding, and admit the explicit retry through current configuration and policy checks. Do we have a high-confidence way to reproduce the issue? Current-main configuration fencing and the inspected Codex Idle-only reload condition establish the failure path; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch uses the existing subscription and resume owners, avoids replaying a potentially effectful message, and preserves unrelated work without adding configuration or persistent state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0bea7ecb3029. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +114, Tests +149, Docs +10. Total +273 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (1 earlier review cycle)
Reviewed November 26, 2026, 6:14 AM ET / 11:14 UTC (Revision 2). |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
After a failed turn on a remote Codex app-server, a saved conversation can become stuck when OpenClaw needs to apply a different configuration. The server can retain the failed runtime across WebSocket reconnects, preventing the conversation from resuming with the intended settings.
User Impact
When Codex confirms that the failed runtime has unloaded, OpenClaw asks the user to retry in the same saved conversation. Check the previous turn’s effects before retrying. Recovery does not automatically send another message.
If another subscriber keeps that thread loaded, OpenClaw explains that the competing subscription must end before recovery can proceed. Other conversations sharing the connection can continue.
Why This Change Was Made
OpenClaw unsubscribes from the affected thread and waits for Codex to unload it. After the last subscriber leaves, the idle delay defaults to 60 seconds in Codex 0.172.0 and 30 minutes in 0.164.0. A retained thread alone does not prove another subscriber is present.
The change keeps a bounded 70-second notification wait for remote connections, uses separate status reads to confirm unloading, and imports the shared 10-second teardown timeout.
The next message follows the existing cold-resume path and current policy checks. The protocol still separates reading thread status from resuming, so another subscriber can reload the thread between those operations.
Evidence
d2eda9c8againstb6a0808don Node 24.22.1 with one worker. Other installed dependencies predate the lockfile, including fs-safe 0.27.1. Full validation on the current dependencies remains for CI.49ffed78included scoped typecheck, lint, format, and failure-renderer validation.git diff --checkpassed.