Uh oh!
There was an error while loading. Please reload this page.
feat(session): crash recovery — auto-resume sessions after crash - #43489
feat(session): crash recovery — auto-resume sessions after crash#43489AndyS77 wants to merge 8 commits into
Conversation
…rites, session validation, config error handling
…on, process.on(exit) cleanup, additional tests
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found one highly related PR: PR #39684: feat(core): recover interrupted sessions on startup This PR appears to address a similar concern about recovering sessions on startup, which overlaps with the crash recovery auto-resume functionality in PR #43489. You may want to review that PR to ensure there's no duplication of effort and to understand any prior approaches to session recovery. |
AndyS77
commented
Aug 19, 2026
Thanks for the heads up. I reviewed PR #39684 — it's complementary, not a duplicate:
They solve different layers of the same problem: #39684 ensures session data survives the crash, this PR ensures the user gets back into their session automatically. |
Issue for this PR
Closes#43488
Type of change
What does this PR do?
Adds an opt-in config option (
session.auto_resume) that persists active session IDs to a manifest file on disk. On next startup, if the manifest exists (previous process didn't shut down cleanly), opencode automatically resumes the most recently active session. The manifest is cleared on clean shutdown viaprocess.on("exit"). Manifest writes are atomic and shape-validated; corrupt JSON degrades gracefully.How did you verify your code works?
17 tests pass (13 unit + 4 e2e). Live-tested crash, partial-idle, clean-shutdown, corrupt-JSON, multi-session, and write-update scenarios against the real data directory.
Screenshots / recordings
N/A — no UI changes.
Checklist