Repository navigation
Conversation
Dead serve-* sessions leave tab.ptyId set, so orphan cleanup treated them as still reconnectable. Closing them could also fail to stick when a later createTab rebuilt from that stale wake hint. Mark sessions retired on TerminalKilledError and on user/cleanup closeTab, and treat retired ids as non-reconnectable so the next createTab sweeps phantom tabs permanently. Closes stablyai#10342
📝 WalkthroughWalkthroughAdds an in-memory registry for retired terminal session IDs. Explicitly killed PTY sessions and session IDs associated with closed tabs are recorded as retired. Reconnectable PTY detection now excludes retired IDs, and tests cover single, bulk, empty, retired, and non-retired session cases. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 14fefdb7-5c8c-405a-9042-1927ce9549ca
📒 Files selected for processing (6)
src/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/store/slices/terminal-orphan-helpers.test.tssrc/renderer/src/store/slices/terminal-orphan-helpers.tssrc/renderer/src/store/slices/terminal-retired-session-ids.test.tssrc/renderer/src/store/slices/terminal-retired-session-ids.tssrc/renderer/src/store/slices/terminals.ts
CodeRabbit: cold reattach can leave retired serve-* ids in ptyIdsByTabId.
|
Closing this stale PR because issue #10342 is now completed by the merged upstream fixes #16752 and #16969, which cover the SSH close-tombstone and reconnect persistence paths more completely than this earlier prune-on-create approach. Thank you to the maintainers and contributors for landing the fixes. |
Summary
TerminalKilledErroror when the user closes a tab (cleanup/user).createTabpermanently sweeps deadserve-*tabs that still have a staleptyId.Fixes #10342.
Why
Phantom SSH tabs showed
Session "serve-…" was explicitly killedand reappeared after close when a new terminal was opened. Orphan cleanup treated any non-nulltab.ptyIdas reconnectable, so killed sessions never got swept.Test plan
terminal-orphan-helpers+terminal-retired-session-ids+pty-transport(91 tests)Screenshots
No visual chrome change.
ELI5
Closed or killed SSH terminal tabs sometimes came back as phantoms when you opened a new terminal. Explicitly killed sessions are marked retired so create permanently cleans them up.