[PR #5153] feat(acp): add session persistence and history replay #11267

Closed
opened 2026-02-16 18:16:04 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5153

State: closed
Merged: No


Summary

This PR adds proper session persistence and history replay to the ACP implementation.

Changes

  • ACPSessionManager persistence: Sessions are now persisted to Storage, allowing them to survive process restarts
  • loadSession improvements: Properly loads existing sessions from disk instead of always creating new ones
  • Model restoration: When loading a session, the user's previous model choice is restored
  • History replay: When a session is loaded, the conversation history is replayed to the client via session/update notifications (as per ACP spec)

Testing

Added tests for session persistence:

  • Persisting session on create
  • Loading session from Storage
  • Returning null for non-existent sessions
  • Updating persisted session when model changes

All 258 tests pass.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5153 **State:** closed **Merged:** No --- ## Summary This PR adds proper session persistence and history replay to the ACP implementation. ### Changes - **ACPSessionManager persistence**: Sessions are now persisted to Storage, allowing them to survive process restarts - **loadSession improvements**: Properly loads existing sessions from disk instead of always creating new ones - **Model restoration**: When loading a session, the user's previous model choice is restored - **History replay**: When a session is loaded, the conversation history is replayed to the client via `session/update` notifications (as per ACP spec) ### Testing Added tests for session persistence: - Persisting session on create - Loading session from Storage - Returning null for non-existent sessions - Updating persisted session when model changes All 258 tests pass.
yindo added the pull-request label 2026-02-16 18:16:04 -05:00
yindo closed this issue 2026-02-16 18:16:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11267