[Agent] Restore missing windows into existing resurrect sessions - #36
Open
tarikguney wants to merge 2 commits into
Open
[Agent] Restore missing windows into existing resurrect sessions#36tarikguney wants to merge 2 commits into
tarikguney wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The current name-based reconciliation can fail to restore missing windows when saved/live sessions contain duplicate window names, and the regression test should also assert that matching windows are not duplicated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates psmux-resurrect restore behavior so that when a saved session already exists, the restore process reuses it and restores only the saved windows that are missing (instead of skipping the entire session), while keeping @resurrect-overwrite 'on' semantics intact.
Changes:
- Add “existing session reconciliation” path that enumerates live windows and restores only missing saved windows (including panes/layout/processes) into the running session.
- Update overwrite regression test to cover restoring a missing nested window into an already-running session.
- Refresh user-facing docs/comments to reflect “reuse + restore missing windows” as the default behavior.
File summaries
| File | Description |
|---|---|
| tests/test_resurrect_overwrite.ps1 | Extends the hermetic overwrite regression test to assert missing-window restoration when a session already exists. |
| psmux-resurrect/scripts/restore.ps1 | Implements reconciliation logic for existing sessions: detect live windows and restore only the missing saved ones; updates summary reporting. |
| psmux-resurrect/README.md | Updates documented default behavior and examples from “skip existing sessions” to “reuse and restore missing windows.” |
| psmux-resurrect/psmux-resurrect.ps1 | Updates inline option documentation for the new default behavior. |
| psmux-resurrect/plugin.conf | Updates inline option documentation for the new default behavior. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coauthored by GitHub Copilot
TL;DR: Reuse existing resurrect sessions while restoring saved windows that are missing, instead of skipping the whole session.
Key changes
@resurrect-overwrite onbehavior unchanged.Validation
tests\test_resurrect_overwrite.ps1: 9 passed, 0 failedtests\test_resurrect_guard.ps1: 7 passed, 0 failedgit diff --check: cleanFinal Validation Checklist
@resurrect-overwrite onstill replaces an existing session.