This repository was archived by the owner on Sep 2, 2026. It is now read-only.
feat(tabs): add Reload command to tab context menus - #167
Merged
Conversation
…xt menus Right-clicking a TUI conversation tab (e.g. an opencode agent) or a plain terminal tab now offers Reload: it kills the session's PTY and starts a fresh one, as a recovery hatch for glitched display state (broken scroll regions, garbled redraws) that scrolling cannot fix. - conversations: dehydrate (kills the process without respawn tracking) then hydrate (respawns with resume flags), replacing the renderer-side PtySession so the new process replays into a clean xterm - terminals: pty.stopSession (keeps the terminal record) then re-hydrate, same fresh-session swap - failures surface a destructive toast; the session is still replaced so the tab recovers instead of staying dead
…state - destroy whatever session re-populated the slot while the restart round-trips were in flight (list-data reaction / conversation-created event) instead of overwriting it and leaking its ptyStartedChannel subscription - do not create the replacement session when the store was disposed mid-restart (task view unmounted during the reload) - clear working/awaiting-input status when the conversation process is killed: deliberate kills are classified as "stopped" by the supervisor, so agentSessionExited never fires and the resumed TUI starts idle
A teardown requested while a restart round-trip was in flight (the tab reconciler dehydrating after the last tab closed) could land between the reload's kill and respawn: it killed nothing and orphaned the freshly spawned agent with no tab attached. The store's hydrate/dehydrate — the same methods the reconciler drives — now queue behind a per-conversation gate held for the duration of restartConversation, so ordering is always kill -> respawn -> queued changes. The reconciler's own intent-flip handling then converges (teardown kills the respawn, or rehydrates if the tab reopened).
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Right-clicking a TUI conversation tab (e.g. an opencode agent) or a terminal tab now offers a Reload command. It kills the session's PTY and starts a fresh one — a recovery hatch for glitched display state (broken scroll regions, garbled redraws, broken scrollback) that scrolling or redrawing cannot fix.
Implementation, renderer-only (reuses existing RPC surface):
ConversationManagerStore.restartConversation):dehydratekills the backend process without respawn tracking, thenhydraterespawns it with resume flags so the agent session continues where it left off. The renderer-sidePtySessionis replaced with a fresh instance so the new process replays into a clean xterm (the PTY registry resets its ring buffer per incarnation).TerminalManagerStore.restartTerminal):pty.stopSessiontears the shell down without deleting the terminal record, then the terminal is re-hydrated; same fresh-session swap.Out of scope: ACP chat tabs — those sessions are not PTYs and would need their own restart mechanism.
Related issues
None filed yet.
Testing
pnpm run formatpnpm exec oxlint .(app)pnpm typecheck(tsgo)pnpm exec vitest run --project node --project main-db --project migrations --project scripts— all green locally, including PTY integration testsChecklist
messages and, when possible, the PR title