Skip to content

fix(clients): running subagent cards stay visible after their parent turn settles - #16878

Merged
juliusmarminge merged 1 commit into
mainfrom
fix/live-subagent-cards-fold
Oct 7, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
fix/live-subagent-cards-fold

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Closes #16621.

Problem

A subagent can keep working after the turn that launched it settles. The "Waiting on N subagents" footer counts it, but its card folded away under "Worked for", so the thread showed nothing for the work the footer said it was waiting on. This happened for app-owned children (delegate_task) and provider-native ones alike.

This is a regression. #11474 kept subagent rows out of turn folds. The V2 orchestrator merge (#2829) rewrote the fold logic and that exception didn't come over. The only remaining test covered a finished child, so nothing failed.

Fix

A subagent card stays outside its turn's fold while its own status is active. The check is isOrchestrationV2WorkActive, the same one the footer uses, so the card and the footer always agree. Finished children still fold as before.

  • Shared check: isLiveSubagentTurnItem in packages/client-runtime/src/state/subagentRuntime.ts, used by both clients.
  • Web (MessagesTimeline.logic.ts): live cards stay out of the "Worked for" fold and the "Superseded attempt" fold. A steer supersedes the attempt but doesn't stop its children, so that fold hid live children too. Adjacent cards from the same run and provider turn render as one grouped row, so that group stays visible while any member is live and is never shown half folded.
  • Mobile (threadActivity.ts): an activity group with a live subagent stays visible.

The footer and the server are unchanged.

Before and after

The same live thread on one dev server: a Claude parent launched a background subagent that is still working after the turn settled.

Before (main): the footer says it is waiting on the subagent, but there is no card.

Before: on main, the settled turn shows "Worked for 7.6s" and "LAUNCHED" with no subagent card, while the footer reads "Waiting on subagent Slow research worker"

After (this PR): the running card stays visible next to the footer that counts it.

After: the same thread shows the running "Slow research worker" card below "Worked for 7.6s", matching the footer

Verification

  • New fold tests in MessagesTimeline.logic.test.ts: a running app-owned child, a running provider-native child, a mixed group (one done, one running), and a running child of a superseded attempt all stay visible while the turn's other settled work still folds. Completed and failed children still fold. Mobile has the equivalent case in threadActivity.test.ts. All five new live-child tests fail on main.
  • vp test run on both files: 230 passed. tsc --noEmit for web, mobile and client-runtime, plus vp lint and vp fmt --check on the changed files, are clean.
  • Reviewed by GPT 6.1 Sol and Fable 5.1. Both traced every provider's subagent status path against the footer's and found no case where the card and the footer disagree.
  • Not checked: the mobile client in a simulator.

Model and harness: Claude Opus 5.5, Claude Code in T3 Code.

🤖 Generated with Claude Code


Devin Review

…turn settles

Once a turn settled, its fold hid every subagent card before the final
answer without checking the child's status, while the waiting footer kept
counting the same children. Subagent cards whose turn item is still active
now stay out of turn folds on web and mobile, and out of superseded-attempt
folds on web. A grouped launch batch stays visible while any member is live.
Finished children still fold as before.

Fixes #16621

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 7, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 7dd76809-2e1a-4b58-99a7-2f49079032ae
📥 Commits

Reviewing files that changed from the base of the PR and between 611132c and a6ec641.

📒 Files selected for processing (5)
  • apps/mobile/src/lib/threadActivity.test.ts
  • apps/mobile/src/lib/threadActivity.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.test.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.ts
  • packages/client-runtime/src/state/subagentRuntime.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

Walkthrough

The change adds a runtime predicate for active subagent turn items and uses it to keep live subagent activity visible when parent-turn activity is folded in the web and mobile timelines.

Changes

Subagent visibility

Layer / File(s) Summary
Identify live subagent items
packages/client-runtime/src/state/subagentRuntime.ts
Adds isLiveSubagentTurnItem, which returns true for active subagent turn items.
Preserve live subagent batches in the web timeline
apps/web/src/components/chat/MessagesTimeline.logic.ts, apps/web/src/components/chat/MessagesTimeline.logic.test.ts
The timeline groups adjacent subagent events with matching run and provider-turn IDs. If any item in a batch is active, the batch stays visible during turn and superseded-attempt folding. Tests cover active, completed, and failed children.
Preserve live subagent activity in the mobile timeline
apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts
Run folding retains activity groups containing a live subagent item. Tests cover active batches and completed-only subagents.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to a6ec6

Running subagent cards now stay visible after their parent turn settles, while finished children still fold as before. No merge-blocking risk was identified. The mobile client was not checked in a simulator, which is a normal validation gap.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, uses the conventional commit format, and clearly identifies the primary fix: keeping running subagent cards visible after the parent turn settles.
Description check ✅ Passed The description covers the problem, expected behavior, implementation across web and mobile, linked issue, screenshots, focused tests, type checks, linting, formatting, and the simulator limitation. I…
Linked Issues check ✅ Passed Issue #16621 requires live app-owned child cards to remain visible after the parent run settles, while settled parent work remains foldable and each child retains its status. The shared `isLiveSubagen…
Out of Scope Changes check ✅ Passed The changes are limited to shared subagent lifecycle detection, web and mobile fold behavior, and focused automated tests. Provider-native coverage, grouping behavior, and the shared helper directly s…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a6ec641

Macroscope's review found this PR approvable — This is a narrowly scoped client-side bug fix that keeps active subagent cards visible while their parent turn folds, with completed and failed children retaining existing behavior. The shared status check and targeted web/mobile regression tests keep the runtime impact contained and verifiable.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 611132c · PR result: a6ec641 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge merged commit 6ecb82d into main Oct 7, 2026
33 of 34 checks passed
@juliusmarminge
juliusmarminge deleted the fix/live-subagent-cards-fold branch October 7, 2026 16:43
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 7, 2026
## What's Changed
* fix(web): replace Lineage timers with Stop on hover by @Bil0000 in pingdotgg/t3code#16791
* fix(clients): running subagent cards stay visible after their parent turn settles by @juliusmarminge in pingdotgg/t3code#16878
* feat: MCP apps render and run inline in threads by @juliusmarminge in pingdotgg/t3code#16236
* fix(server): a background Claude subagent's work shows while its parent is idle by @Vantrongs in pingdotgg/t3code#16486
* fix(mobile): hide threads from switched-off environments by @entity in pingdotgg/t3code#16886
* fix(server): a refused Claude turn no longer throws away its session by @SunkenInTime in pingdotgg/t3code#16287
* fix(web): onboarding Continue no longer locks on computers that won't connect by @juliusmarminge in pingdotgg/t3code#16887
* fix(server): worktree cleanup no longer deletes files hidden by showUntrackedFiles=no by @SunkenInTime in pingdotgg/t3code#15834
* fix(server): merged-worktree cleanup removes worktrees after squash merges by @tris203 in pingdotgg/t3code#14847
* fix(server): free worktrees for terminal thread statuses by @ANSHSINGH050404 in pingdotgg/t3code#15150
* fix(server): Windows worktrees with long paths no longer fail or strand by @That1Drifter in pingdotgg/t3code#14917
* fix(server): main typechecks again after a test used renamed helpers by @juliusmarminge in pingdotgg/t3code#16895
* fix(server): Claude prompts no longer hang on a uuid the session already holds by @juliusmarminge in pingdotgg/t3code#16897

## New Contributors
* @Vantrongs made their first contribution in pingdotgg/t3code#16486
* @entity made their first contribution in pingdotgg/t3code#16886
* @ANSHSINGH050404 made their first contribution in pingdotgg/t3code#15150
* @That1Drifter made their first contribution in pingdotgg/t3code#14917

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261007.2774...v0.0.46-nightly.20261007.2787

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261007.2787
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 7, 2026
## What's Changed
* fix(web): replace Lineage timers with Stop on hover by @Bil0000 in pingdotgg/t3code#16791
* fix(clients): running subagent cards stay visible after their parent turn settles by @juliusmarminge in pingdotgg/t3code#16878
* feat: MCP apps render and run inline in threads by @juliusmarminge in pingdotgg/t3code#16236
* fix(server): a background Claude subagent's work shows while its parent is idle by @Vantrongs in pingdotgg/t3code#16486
* fix(mobile): hide threads from switched-off environments by @entity in pingdotgg/t3code#16886
* fix(server): a refused Claude turn no longer throws away its session by @SunkenInTime in pingdotgg/t3code#16287
* fix(web): onboarding Continue no longer locks on computers that won't connect by @juliusmarminge in pingdotgg/t3code#16887
* fix(server): worktree cleanup no longer deletes files hidden by showUntrackedFiles=no by @SunkenInTime in pingdotgg/t3code#15834
* fix(server): merged-worktree cleanup removes worktrees after squash merges by @tris203 in pingdotgg/t3code#14847
* fix(server): free worktrees for terminal thread statuses by @ANSHSINGH050404 in pingdotgg/t3code#15150
* fix(server): Windows worktrees with long paths no longer fail or strand by @That1Drifter in pingdotgg/t3code#14917
* fix(server): main typechecks again after a test used renamed helpers by @juliusmarminge in pingdotgg/t3code#16895
* fix(server): Claude prompts no longer hang on a uuid the session already holds by @juliusmarminge in pingdotgg/t3code#16897

## New Contributors
* @Vantrongs made their first contribution in pingdotgg/t3code#16486
* @entity made their first contribution in pingdotgg/t3code#16886
* @ANSHSINGH050404 made their first contribution in pingdotgg/t3code#15150
* @That1Drifter made their first contribution in pingdotgg/t3code#14917

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261007.2774...v0.0.46-nightly.20261007.2787

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261007.2787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Live Codex subagent cards disappear after the parent turn finishes

1 participant