Repository navigation
Keep the Terminal's shell when the agent starts a new turn - #406
Merged
abhishekgahlot2 merged 1 commit intoNov 2, 2026
Merged
abhishekgahlot2 merged 1 commit into
abhishekgahlot2 merged 1 commit into
Conversation
Contributor
|
Merged, thanks @coolestnick. Keeping the shell across turns is a big one. |
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.
Closes #405
The Shell tab started over every time the agent started a new turn: the folder, scrollback and any running command were lost.
InteractiveTerminalreconnected wheneverrunIdchanged, and the backend kills a PTY when its WebSocket closes. Every run in a thread resolves to the same sandbox, so switching runs gained nothing.What changed
InteractiveTerminalkeeps one connection for as long as it is mounted. The latestrunIdis read only when it connects or reconnects.TerminalPanetakesthreadIdand keys the terminal by it, so another thread still gets its own fresh shell.Tests
frontend/components/chat/interactive-terminal.test.tsxmounts the realTerminalPanewith a stand-in terminal and WebSocket:Checks: root
bun run typecheckpasses; infrontend/,bun run test(1774 pass, 0 fail),bun run lint(nothing in the changed files) andbun run buildpass;bun test scripts/agent-docs.test.tspasses.Not yet checked in the running app with a live sandbox; I can add a recording once I have one.
Out of scope: switching Shell to Log and back still starts a new shell, because the terminal unmounts with the tab.
Need help on this PR? Tag
@codesmith-botwith what you need.