Skip to content

fix(session): scope restore state by workspace - #335

Merged
fcoury-oai merged 1 commit into
mainfrom
fcoury/session-restore-per-workspace
Aug 23, 2026
Merged

fcoury-oai merged 1 commit into
mainfrom
fcoury/session-restore-per-workspace

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Clean session restore currently keeps one global latest plugin value. Exiting Red from a different working directory replaces the previous workspace's saved buffers, so returning to the original directory no longer restores its context.

This change scopes the session-restore value by canonical working directory at the plugin-storage boundary. Existing unscoped state remains available as a migration fallback until that workspace exits cleanly and writes its scoped value. Other plugin storage behavior, including existing workspace-scoped Agent history, is preserved.

The recovery documentation now describes the per-workspace behavior, and focused tests cover independent keys and legacy fallback precedence.

How to Test

  1. From workspace A, run Red with a clean file, exit, then start Red again without file arguments. The file and editor layout should restore.
  2. Start and exit Red without files from workspace B, then start Red again from workspace A. Workspace A's file and layout should still restore, while workspace B retains its own empty state.
  3. Run cargo test --lib session_restore_ to cover workspace scoping, legacy migration, file alias repair, and core-recovery non-interference.
  4. Run cargo clippy --all-targets --all-features -- -D warnings.

The full cargo test --lib --all-features suite also passed except for one unrelated Git-context deadline on its first parallel run; that exact test passed immediately when rerun in isolation.

@fcoury-oai
fcoury-oai merged commit c821c12 into main Aug 23, 2026
10 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/session-restore-per-workspace branch August 23, 2026 22:35
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.

1 participant