Skip to content

Subagent progress events leak into unrelated conversation UI when switching sessions #160

@xinyi-gong

Description

@xinyi-gong

Problem

When a subagent is executing and the user switches to a different conversation (via history), the subagent's progress events continue to be rendered in the newly opened conversation's UI, corrupting the display.

Root Cause

ChatView.onChatProgress() is a global listener that does not filter progress events by conversationId. When the user switches conversations:

  1. The subagent continues executing in the background (tied to the old conversation)
  2. Progress events arrive with the old conversation's conversationId
  3. onChatProgress blindly forwards them to the current chatContentViewer, which now displays a different conversation

Expected Behavior

Progress events should be ignored (or buffered) if they don't belong to the currently displayed conversation. The check should account for both the main conversation ID and any active subagent conversation ID.

Reproduction Steps

  1. Start a conversation in Agent mode
  2. Trigger a subagent execution
  3. While the subagent is running, open chat history and switch to a different conversation
  4. Observe: the subagent's output appears in the newly opened conversation's UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions