fix(vscode): clear completion indicators when opening results - #13731
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit 05ae514)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 05ae514)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (20 files)
Reviewed by grok-4.6 · Input: 45.3K · Output: 6.1K · Cached: 326K Review guidance: REVIEW.md from base branch |
WebReflection
approved these changes
Sep 3, 2026
1 task
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.
Fixes #13702.
Supersedes #13703.
What Problem This Solves
Completed-session checks remain visible after the result is opened, making it hard to distinguish unread results from sessions that have already been reviewed. Clearing on a session-ID change alone also misses returning from Review, reopening a retained sidebar/editor, and subagent inspector tabs.
Why This Change Was Made
Acknowledge completion when the session's chat becomes visible in the active view. Use the same path for sidebar, native editor, Agent Manager, and subagent views, and share the acknowledgement through the existing connection service.
Keep acknowledgement separate from the turn outcome so opening a result does not discard completion diagnostics. Match it to the closing event ID so a delayed acknowledgement cannot clear a later completion. Replay pending completion events before activating a new view, allowing a newly opened editor to acknowledge results already held by another view. This state is in memory only; no backend API or persistent storage changes are needed.
User Impact
Evidence
Validation on the branch rebased onto
main:bun run compile: host/webview typechecks, lint, bundles, and CLI smoke tests passed.bun run test:unit: 4,688 passed, 1 skipped, 0 failed.bun run knipandbun run check-kilocode-change: passed.bun run format: no changes.Isolated VS Code self-tests used a real CLI backend with a local deterministic test provider. Covered worktree switching with two completed sessions, same-session Review returns, sibling subagent tabs and inspector reopening, sidebar/editor reactivation, acknowledgement across views, and a new editor opened after completion. Waiting/error states remained visible, and completion in an already focused chat retained its check. The screenshots below were captured from that tested follow-up before rebasing onto current
main.Manual check: finish session A while viewing B, then open A and confirm only its notification clears. Repeat with a worktree session and a subagent tab. Pending input requests and errors must remain visible after focus changes.
Worktree: the last unread session controls the aggregate badge
Checks has been opened, but Implementation remains unread:
After opening Implementation, its notification and the worktree badge clear while the result remains:
Subagents: opening the completed child leaves its running sibling unchanged
Before and after opening Analysis. Review remains busy:
Focus regression follow-up: command palette versus panel activation
Commit c1da52a makes host activation the sole activity source. DOM focus still reports keyboard context, but cannot acknowledge completion. The separate readiness flag is no longer needed because activity starts false until the host activates the view.
The new active and inactive focus/blur regressions failed before the fix and pass afterward. All 49 targeted tests, typechecks, lint, build, unused-export checks, and change-marker checks pass.
In isolated VS Code, opening the command palette made document focus false; Escape restored it to true without clearing the completed tab:
Switching to another editor and then reactivating the Kilo tab still clears the completion check: