Skip to content

feat(session): resume agent sessions across relaunch#333

Open
roba-adnew wants to merge 1 commit into
forketyfork:mainfrom
roba-adnew:feat/session-resume-pr
Open

feat(session): resume agent sessions across relaunch#333
roba-adnew wants to merge 1 commit into
forketyfork:mainfrom
roba-adnew:feat/session-resume-pr

Conversation

@roba-adnew

Copy link
Copy Markdown

Makes "reopen my workspace" actually reopen the conversations, not just bare shells.

Two parts make it reliable:

  • Live capture — a SessionStart hook reports the agent's session id over the existing notify socket (new agent_session notification + dispatch), so ids are recorded as soon as a session starts, instead of only scraped during quit teardown (which frequently missed).
  • 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, 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 claude installer gains a SessionStart hook entry.

Scope: 6 files, +227/−41 · all checks green · validated end-to-end (4-pane workspace resumes across quit/relaunch).

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.
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