feat(session): resume agent sessions across relaunch#333
Open
roba-adnew wants to merge 1 commit into
Open
Conversation
On quit, capture each pane's agent (Claude Code/Codex/Gemini) session id; on relaunch, reopen each session in place. Two parts make it reliable: - Live capture: a SessionStart hook reports the agent's session id over the notify socket (new agent_session notification + runtime dispatch), so ids are recorded as soon as a session starts instead of only scraped at quit. - Robust resume: the resume command is injected as ARCHITECT_RESUME_CMD and run once by the wrapper rc after the user's shell rc loads -- never typed into the PTY, so it cannot race startup or be eaten by a shell prompt. Also: a normal quit no longer wipes a captured id (teardown only overwrites on a successful scrape), and the focused/zoomed pane is persisted and restored.
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.
Makes "reopen my workspace" actually reopen the conversations, not just bare shells.
Two parts make it reliable:
SessionStarthook reports the agent's session id over the existing notify socket (newagent_sessionnotification + dispatch), so ids are recorded as soon as a session starts, instead of only scraped during quit teardown (which frequently missed).ARCHITECT_RESUME_CMDand run once by the wrapper rc after the user's shell rc loads, rather than typed into the PTY. This removes the startup race where a shell prompt (e.g. an oh-my-zsh update[Y/n]) could swallow/corrupt the typed command.Also: quit teardown no longer wipes an already-captured id (only overwrites on a successful scrape), and the focused/zoomed pane is persisted and restored.
Note for review: the
architect hook claudeinstaller gains aSessionStarthook entry.Scope: 6 files, +227/−41 · all checks green · validated end-to-end (4-pane workspace resumes across quit/relaunch).