Skip to content

fix(vscode): preserve background agent dismissals across navigation - #13560

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-dismissed-background-subagents
Aug 28, 2026
Merged

fix(vscode): preserve background agent dismissals across navigation#13560
marius-kilocode merged 1 commit into
mainfrom
fix-dismissed-background-subagents

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Dismissed background agents reappear after switching sessions or returning from History or an empty chat. Both Dismiss and Clear finished lose their state when the header changes session or remounts.

Fixes #13507.

Why This Change Was Made

The persistence work proposed in #13526 was not merged, and #13542 explicitly left it unfinished. A component-local map would still lose dismissals on remount. Store dismissed job IDs in the stable session provider, scoped to each parent session, and remove them when that session is deleted.

User Impact

  • Dismiss and Clear finished stay effective across session switches and chat remounts.
  • Running jobs remain visible, and dismissing one parent's jobs does not hide another parent's jobs.
  • This is UI-only state for the current webview lifetime. It does not delete backend jobs or persist through a full webview reload.

Evidence

Reproduced the old failure in the baseline build. Verified the fixed build in isolated VS Code with deterministic session/job responses: tab switching, History remounts, empty chats, parent isolation, restarted jobs, and new finished jobs. No live model prompts were needed.

The full extension unit suite passed. Temporary lifecycle regression coverage also passed and was removed to keep the patch small. The final existing background-agent/session-provider tests passed (23 tests), along with typecheck, lint, compile, Knip, and the Kilo change-marker guard.

After dismissing the completed job and returning through History, the untouched cancelled and failed jobs remain visible:

Only the undismissed cancelled and failed background jobs remain after History navigation

After Clear finished, returning from an empty chat does not restore the background-agent strip:

Session header without a background-agent strip after Clear finished and empty-chat navigation

@marius-kilocode
marius-kilocode enabled auto-merge (squash) August 28, 2026 16:02
@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • .changeset/preserve-background-agent-dismissals.md
  • packages/kilo-vscode/webview-ui/src/components/chat/BackgroundAgents.tsx
  • packages/kilo-vscode/webview-ui/src/context/session-types.ts
  • packages/kilo-vscode/webview-ui/src/context/session.tsx
  • packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx

Reviewed by grok-4.6 · Input: 185.3K · Output: 11.4K · Cached: 284.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit e491ff5 into main Aug 28, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the fix-dismissed-background-subagents branch August 28, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Background Agent Running State Persistence

2 participants