feat: session detach & reconnect — tabs detach, only exit kills#84
Merged
Conversation
Co-authored-by: Isaac
…tion Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Split pane and new tab (user-initiated) always create a fresh session. Session picker only runs for the first pane on initial page load.
Three fixes:
- Reattach skips CoDA splash and duplicate resize (root cause of blank
screen after picker selection — splash was clearing the replayed buffer)
- Picker supports d{N} to kill individual sessions (e.g. d2 kills #2)
- Sessions button (☰) in toolbar opens picker in active pane anytime
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.
Summary
Sessions now survive tab closure. Closing a tab detaches the frontend — the PTY process keeps running. Only typing
exitin the shell kills a session. Users can reconnect to existing sessions on return visits via session picker.What Changed
sendBeaconkills PTY immediatelyexit)exited=True, lingers in dictterminate_session()— immediate cleanupGET /api/sessionswith process detection + labelPOST /api/session/attachwith buffer replayd{N}to kill(open), can't attach twiceSession Picker
Access via: ☰ toolbar button, Ctrl+Shift+S, or on page load with existing sessions.
Test Plan
Automated (122 tests, all passing)
Manual Testing on Databricks Apps (test-coda on 9cefok)
1. Detach — tab close no longer kills session
POST /api/session/closein logs after tab close (only WS disconnect)2. Auto-reattach (1 session)
POST /api/session/attach3. Session picker (multiple sessions)
GET /api/sessionsat 04:11:48, 04:33:21, 04:34:27)GET /api/sessions+ leave WS room)d{N}kills individual session from picker (Terminating 22ff502bat 04:33:36 +POST /api/session/closeat 04:33:39)n→ creates new sessionx→ kills all, creates fresh4. Fresh deploy — PAT flow then new session
5. Split pane / new tab — always fresh
POST /api/sessionat 04:33:04, 04:33:19, 04:34:17 (no/api/sessionscall)6. Exit — kills session immediately
exit→Session process exited→Terminating→Force killed(04:12:32)GET /api/sessionsresponse7. Process detection
GET /api/sessionsreturns process names (confirmed in all responses)claudeshows correctly in picker8. Buffer replay on reattach
9. Reattach skips CoDA splash
10. Session labels
11. Already-open guard
(open)tag in picker12. PAT rotation continues
This pull request was AI-assisted by Claude Code.