Skip to content

Keep empty child agent pills visible after exiting agent view#10206

Merged
advait-m merged 1 commit intomasterfrom
advait/fix-empty-child-pill-disappearing
May 6, 2026
Merged

Keep empty child agent pills visible after exiting agent view#10206
advait-m merged 1 commit intomasterfrom
advait/fix-empty-child-pill-disappearing

Conversation

@advait-m
Copy link
Copy Markdown
Member

@advait-m advait-m commented May 6, 2026

Loom: https://www.loom.com/share/1e0d5494fe99423eb7a3cd042d0eaf14
Fixes https://linear.app/warpdotdev/issue/QUALITY-602/fix-child-agents-disappearing-when-opening-via-pill

Description

When a child agent failed to start (or simply hadn't received its first event yet), clicking its pill in the orchestration pill bar correctly opened an empty conversation — but navigating back to the parent or switching to another child caused the failed pill to disappear from the bar.

Cause: the ExitedAgentView handler in TerminalView auto-removes any conversation that was "new" (zero original exchanges) and "unmodified" (zero added exchanges) on exit. That cleanup is meant to prune accidentally-opened empty root conversations, but it was also firing for child agents that legitimately had zero exchanges and that the orchestrator's pill bar still needs to render.

Fix: skip the auto-remove when the conversation is part of an orchestration tree, detected via AIConversation::is_child_agent_conversation() (true when parent_conversation_id or parent_agent_id is set). Empty root conversations still get pruned as before.

Screenshots / Videos

N/A — pill bar repro is identical before/after click; the behavioral fix is "the pill no longer vanishes".

Testing

Manual repro:

  1. Start an orchestrator that spawns a child agent that fails to start (or just spawn a child and don't let it receive its first event).
  2. Click the failed child's pill in the orchestration pill bar → empty conversation opens (unchanged).
  3. Click the parent pill (or another child) → before this fix, the failed pill disappears from the bar; after this fix, it stays.

The check reuses an existing AIConversation::is_child_agent_conversation() accessor; no new state introduced.

When a child agent failed to start (or simply hadn't received its
first event yet), clicking its pill in the orchestration pill bar
correctly opened an empty conversation — but navigating back to
the parent or to another child caused the failed pill to disappear
from the bar.

Cause: the ExitedAgentView handler in TerminalView auto-removes
any conversation that was 'new' (zero original exchanges) and
'unmodified' (zero added exchanges) on exit. That cleanup is meant
to prune accidentally-opened empty *root* conversations, but it
was also firing for child agents that legitimately had zero
exchanges and that the orchestrator's pill bar still needs to
render.

Fix: skip the auto-remove when the conversation is part of an
orchestration tree, detected via AIConversation::
is_child_agent_conversation() (true when parent_conversation_id
or parent_agent_id is set). Empty *root* conversations still get
pruned as before.

Co-Authored-By: Oz <[email protected]>
@cla-bot cla-bot Bot added the cla-signed label May 6, 2026
@advait-m advait-m marked this pull request as ready for review May 6, 2026 00:48
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@advait-m

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@advait-m advait-m requested a review from cephalonaut May 6, 2026 00:48
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates the agent-view exit cleanup path so empty child-agent conversations remain in the orchestration tree instead of being removed by the empty-root-conversation cleanup.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@advait-m advait-m enabled auto-merge (squash) May 6, 2026 01:01
@advait-m advait-m merged commit fc1fb22 into master May 6, 2026
46 checks passed
@advait-m advait-m deleted the advait/fix-empty-child-pill-disappearing branch May 6, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants