Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

fix(vscode): display sub-agent task tool list in webview#427

Merged
catrielmuller merged 1 commit into
devfrom
catrielmuller/351-sub-agent-progress
Feb 18, 2026
Merged

fix(vscode): display sub-agent task tool list in webview#427
catrielmuller merged 1 commit into
devfrom
catrielmuller/351-sub-agent-progress

Conversation

@catrielmuller
Copy link
Copy Markdown
Collaborator

@catrielmuller catrielmuller commented Feb 18, 2026

Context

Resolve: #351

The sub-agent task tool list was not displaying in the VSCode webview. When a task tool spawns a child session, the tool output panel showed an empty data-component="task-tools" container instead of the list of tool calls the sub-agent executed.

The app (packages/app) worked correctly because it has a full sync system that fetches child session data on demand.

Implementation

Two root causes were identified and fixed:

Root cause 1 — DataBridge only mapped the current session's data

App.tsx's DataBridge built the DataProvider store with only the current session's messages and parts ({ [id]: session.messages() }). The shared message-part.tsx renderer calls getSessionToolParts(store, childSessionId) which looks up store.message[childSessionId] — always empty because only the parent session ID was keyed.

Fix: DataBridge now uses session.allMessages() and session.allParts() which expose the full store (all sessions), so child session data is visible once loaded.

Root cause 2 — No syncSession callback

The task tool renderer in message-part.tsx has a createEffect that calls data.syncSession(childSessionId) to trigger loading child session data. DataProvider was instantiated without onSyncSession, so the effect was a no-op.

Fix: A new syncSession message round-trip was added:

  1. DataBridge provides onSyncSession → calls session.syncSession(sessionID)
  2. Session context posts { type: "syncSession", sessionID } to the extension
  3. KiloProvider.handleSyncSession() adds the child session ID to trackedSessionIds (so future SSE message.part.updated events are forwarded) and fetches messages via HTTP, sending them back as messagesLoaded
  4. The session context's existing handleMessagesLoaded stores them under the child session ID, which the DataBridge now includes in the store

Files changed

  • packages/kilo-vscode/webview-ui/src/types/messages.ts — new SyncSessionRequest type
  • packages/kilo-vscode/src/KiloProvider.ts — new handleSyncSession method
  • packages/kilo-vscode/webview-ui/src/context/session.tsxallMessages, allParts, syncSession additions
  • packages/kilo-vscode/webview-ui/src/App.tsx — updated DataBridge to use full store + wire onSyncSession

Screenshots

image

How to Test

  1. Open the Kilo VSCode extension sidebar
  2. Send a message that triggers a sub-agent via the task tool (e.g. "Use the explore agent to search for X")
  3. Expand the task tool output panel in the chat
  4. Before: the panel is empty
  5. After: the panel shows the list of tools the sub-agent called (matching what the web app shows)

The task tool's child session data was never populated in the VSCode
webview's DataProvider store, causing the task-tools list to render
empty. Two root causes:

1. DataBridge only mapped the current session's messages/parts, so
   getSessionToolParts() always returned [] for child session IDs.
2. No syncSession callback was provided to DataProvider, so the task
   tool renderer's createEffect that triggers child session loading
   was a no-op.

Add a syncSession message round-trip: the webview sends syncSession to
the extension, which tracks the child session ID for SSE events and
fetches its messages via HTTP, sending them back as messagesLoaded.
The DataBridge now exposes the full allMessages/allParts store so all
sessions (including child sessions) are visible to the shared
message-part renderer.
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Feb 18, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • packages/kilo-vscode/src/KiloProvider.ts - New handleSyncSession method for child session syncing
  • packages/kilo-vscode/webview-ui/src/App.tsx - Refactored DataBridge to pass all sessions' messages/parts and wire up onSyncSession
  • packages/kilo-vscode/webview-ui/src/context/session.tsx - Exposed allMessages, allParts, and syncSession from session context
  • packages/kilo-vscode/webview-ui/src/types/messages.ts - Added SyncSessionRequest type to webview message union
Notes
  • handleSyncSession correctly guards against duplicate syncs via trackedSessionIds.has() check
  • Error handling in handleSyncSession silently logs rather than posting to webview — this is appropriate for a background sync operation that shouldn't interrupt the user
  • The refactor from per-session message/part filtering to passing allMessages()/allParts() is clean and enables child session data to flow through the DataProvider
  • Type definitions are properly added to both the interface and the union type

@catrielmuller catrielmuller merged commit c720f50 into dev Feb 18, 2026
12 checks passed
@catrielmuller catrielmuller deleted the catrielmuller/351-sub-agent-progress branch February 18, 2026 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Show progress of a sub-agent task

2 participants