Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): finished remote subagents move into Previous agents #26576

ClosedReneFr81(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/26576/headopened View on GitHub

Problem

In a thread's Lineage panel, subagents that ran in a linked environment never leave the list. Local subagents move into the collapsed "Previous agents" group once they finish. Remote ones are drawn in a separate list after the groups with no status filter, so every finished remote child stays in view for good. A parent that has delegated a few tasks to another machine ends up with a growing stack of "on box · Done" rows next to the collapsed group.

To reproduce: delegate a task to a linked environment and let it finish. The parent's Lineage panel shows its "Done" row next to "Previous agents" indefinitely.

Change

The grouping rule now lives in groupWebThreadLineageRows in packages/client-runtime/src/state/threadRelationships.ts, next to orderWebThreadLineageRows. It puts local rows and remote subagents into the same related / active / previous buckets and uses one terminal-status set for both. In ThreadRelationshipsControl.tsx, ThreadLineageGroup takes either kind of row. It renders RemoteSubagentRow for remote ones, and its collapsed count and "N failed" badge include them. The separate remote list is removed.

Running, pending and waiting remote subagents still appear, now in the active group with local ones. The "N running" heading count is unchanged: remote tasks were already counted through childThreadId === null, and the count of active thread rows skips remote rows, so nothing is counted twice. Mobile has no "Previous agents" grouping and already lists remote and local subagents the same way, so it needs no change.

Scope and approval

This is a small fix for an obvious bug: finished remote subagents stay visible even though finished local ones are collapsed. It applies the existing local grouping rule to remote subagents and adds no workflow, setting or contract.

Verification

  • vp test run packages/client-runtime/src/state/threadRelationships.test.ts passes 12 tests. The new case, "moves finished subagents into previous, including ones in a linked environment", fails when the helper only groups thread rows (main's behavior): the remote running and remote done subagents are missing from active and previous.
  • vp run check:changed passes format, lint, knip, typecheck (7 packages) and the test beside the change.
  • Screenshots: a temporary, uncommitted browser test rendered ThreadRelationshipsPanel with the app stylesheet and mocked state hooks. The fixture has one finished local subagent ("Review the diff") and one finished subagent in a linked environment named "box" ("Run the migration check"). Main's code and this branch were rendered with the same fixture, width and theme.

Before, with "Previous agents" collapsed: the finished remote child stays visible, and the group counts only the local one.

Before: Previous agents (1) collapsed, finished remote row still shown

After, with "Previous agents" collapsed: both finished children are in the group.

After: Previous agents (2) collapsed, no stray remote row

After, with "Previous agents" expanded: the remote child is listed with its environment and status.

After: Previous agents expanded, listing the local and the remote child

Not checked: a live linked environment end to end, and the desktop shell. Web and desktop share this rendering logic; mobile is unchanged.

Claude Opus 5.5 via Claude Code in T3 Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Needs Human Approval

      Macroscope's review found this PR requires human approval — Finished remote agents now appear in the initially collapsed Previous agents section instead of remaining directly visible. Human confirmation is required for this default visibility change, including how failed remote agents are surfaced.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between d07c0a7c7b91b0b40146546cbc7ab2bb91ff228d and c0bebd2696d8f82ae74c7ecbbf45e281c288d1fb.

      Files selected for processing: 3
      • apps/web/src/components/chat/ThreadRelationshipsControl.tsx
      • packages/client-runtime/src/state/threadRelationships.test.ts
      • packages/client-runtime/src/state/threadRelationships.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      Walkthrough

      The client runtime now groups remote subagents with thread-lineage rows. The chat panel uses the shared groups for row counts and rendering, instead of displaying remote subagents in a separate list.

      Changes: Thread-lineage grouping

      Layer / File(s)Summary
      Define and test lineage grouping
      packages/client-runtime/src/state/threadRelationships.ts, packages/client-runtime/src/state/threadRelationships.test.ts
      Adds row types and a status accessor for local and remote rows. The grouping function puts qualifying relationships in related, non-settled subagents in active, and rows with listed settled statuses in previous. The test covers fork rows and running and completed local and remote subagents.
      Render grouped rows in the chat panel
      apps/web/src/components/chat/ThreadRelationshipsControl.tsx
      Passes remote subagents into the grouping function. Uses the resulting groups for row counts and rendering, and removes the separate remote-subagent list.
      Priority: Low

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix

      Sequence Diagram(s)

      sequenceDiagram
        participant ThreadRelationshipsControl
        participant groupWebThreadLineageRows
        participant ThreadLineageGroup
        participant RemoteSubagentRow
        ThreadRelationshipsControl->>groupWebThreadLineageRows: Provide relationship rows and remote subagents
        groupWebThreadLineageRows-->>ThreadRelationshipsControl: Return related, active, and previous groups
        ThreadRelationshipsControl->>ThreadLineageGroup: Render grouped lineage rows
        ThreadRelationshipsControl->>RemoteSubagentRow: Render remote-subagent rows

      Possibly related issues

      Suggested reviewers: juliusmarminge, t3dotgg

      Merge Risk: Minimal · up to c0beb

      No merge-blocking issue was established in the remote-agent grouping change.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: moving finished remote subagents into the existing Previous agents group.
      Description checkPassedThe description includes all required sections. It explains the problem and reproduction steps, the implementation, scope justification, focused verification results, screenshots, limitations, and age…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description includes all required sections. It explains the problem and reproduction steps, the implementation, scope justification, focused verification results, screenshots, limitations, and agent attribution.

      Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsbugfix

    5. juliusmarminge added labelspr:gate-failed

    6. Thanks @ReneFr81 for the fix and regression coverage! #29285, merged as 6dcaf6c, now groups active and finished remote agents with local agents, including failed counts. Closing this as covered.

    7. juliusmarminge removed labelspr:gate-failed

    8. juliusmarminge closed this

Sign in to join this conversation.