opencode
opencode copied to clipboard
fix(acp): persist session state to disk and add isReplay metadata
Note: This was vibe-coded (using sst/opencode tho), sorry! I know that this is a lot but I'd appreciate if you would consider this, it is a per-requisite for https://github.com/BloopAI/vibe-kanban/pull/1717
Fixes session resumption when the ACP process restarts:
- Persist ACP session state to ~/.local/share/opencode/storage/acp_state/
- Restore session from disk when not found in memory
- Make session manager methods async to support disk I/O
Add isReplay metadata to session updates during history replay:
- Mark all sessionUpdate notifications with _meta.isReplay: true when replaying session history via loadSession
- Allows ACP clients to filter/handle replay events differently
Happy and prosperous 2026!