Repository navigation
fix(agent-manager): preserve terminal-only tabs when switching contexts - #13715
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Reviewed by grok-4.6 · Input: 166.4K · Output: 13.7K · Cached: 607.9K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 2, 2026 20:03
intentionally-left-nil
approved these changes
Sep 3, 2026
This was referenced Sep 6, 2026
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.
What Problem This Solves
Returning to a project with only a Local terminal tab added an unwanted New Session tab. Local and worktree contexts could also show a blank chat instead of their existing terminal when remembered tab state was missing or stale.
Why This Change Was Made
Terminal-only contexts already have usable content. Project restoration now checks the project-scoped central terminal tabs before creating a Local draft. Context selection restores a live terminal when no session or draft is available, while preserving remembered terminal, session, and review selection behavior. Side terminals and terminals from other projects are excluded from the fallback.
User Impact
Switching between Local, worktrees, and projects keeps terminal-only contexts usable without extra session tabs. Terminal focus and typed input are retained. Empty Local contexts still receive their initial draft.
Evidence
Reproduced the extra Local draft in an isolated VS Code self-test before the fix. After rebuilding and reloading, verified Local and worktree terminal-only restoration, missing-memory fallback, cross-project return, and keyboard navigation. Each return retained one terminal tab, input focus, and unsubmitted marker text.
Before, returning from another project adds a New Session tab beside the terminal:
After, the same return keeps only the terminal with its input intact:
The GitHub authentication notification is from the disposable test workspace and does not affect the terminal flow. No prompts were submitted to a model.
Validation:
bun run compile, including extension/webview typechecks and lint.bun run test:unit: 4,661 passed, 1 skipped, 0 failed.bun run typecheck,bun run lint,bun run knip, andbun run check-kilocode-change.