Skip to content

Conversation

@Tarquinen
Copy link
Collaborator

Summary

  • Persist pruned tool IDs across OpenCode restarts - State is now saved per-session to ~/.local/share/opencode/storage/plugin/dcp/{sessionId}.json, ensuring pruned tools remain pruned when OpenCode restarts mid-session (closes Bug: Pruned tool IDs are lost when navigating to old sessions (state not persisted) #16)
  • Include session name in persisted state files - Improves debuggability by including the session name alongside the ID
  • Fix state restoration timing - Ensures persisted state is restored before the janitor runs, preventing race conditions

Changes

  • New lib/state-persistence.ts module for saving/loading state
  • State module extended with persistence callbacks
  • Janitor updated to integrate with persistence layer
  • Cleanup of unused exports

Adds state persistence so pruned tool IDs survive OpenCode restarts.
State is saved per-session to ~/.local/share/opencode/storage/plugin/dcp/{sessionId}.json

Closes #16
@Tarquinen Tarquinen merged commit 5227432 into master Nov 30, 2025
1 check passed
@Tarquinen Tarquinen deleted the feat/persist-state-across-restarts branch November 30, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Pruned tool IDs are lost when navigating to old sessions (state not persisted)

2 participants