Repository navigation
feat(clients): background work says what it is and which subagent finished - #13949
juliusmarminge merged 2 commits into
Conversation
| function itemIcon(item: OrchestrationV2TurnItem): ThreadFeedActivity["icon"] { | ||
| if (item.type === "notification") return "zap"; | ||
| if (item.type === "notification") { | ||
| switch (item.workKind) { |
There was a problem hiding this comment.
🟡 Medium lib/threadActivity.ts:447
Failed notification items render the work-kind icon instead of alert, so failed subagent, command, and monitor notifications lose their failure indicator. itemIcon switches on workKind without checking item.outcome; return alert before that switch when the outcome is failed.
| switch (item.workKind) { | |
| if (item.outcome === "failed") { | |
| return "alert"; | |
| } | |
| switch (item.workKind) { |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/src/lib/threadActivity.ts around line 447:
Failed notification items render the work-kind icon instead of `alert`, so failed subagent, command, and monitor notifications lose their failure indicator. `itemIcon` switches on `workKind` without checking `item.outcome`; return `alert` before that switch when the outcome is `failed`.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces cross-platform user-facing behavior for categorizing background work and navigating to subagent threads, rather than making a purely mechanical or isolated UI change. An unresolved medium-severity finding also indicates that failed mobile notifications can lose their failure icon. Not approved because:
No code changes detected at Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
…ished The composer strip said "Waiting on N background tasks" whether those were subagents, shell commands or monitors, and mobile showed nothing once the turn settled. - A shared builder in client-runtime names the work, grouped by kind: "Waiting on subagent Review src/math.ts", "Waiting on 2 subagents and 1 command". Rosters from servers without `kind` still classify by task type. - Web: the strip lists every item, and a subagent's name opens its thread. Stop is unchanged. - Mobile: the floating pill shows the same title after the turn settles. - Timeline notification rows use an icon per kind (subagent, command, monitor), and a subagent's row opens its thread on web and mobile. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…vider task types The composer strip, timeline icons and "Open subagent" read the kind and child thread from the union members the server now sends. Clients no longer map provider taskType strings, and a new kind fails to compile until each switch handles it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2dd3671 to
3382314
Compare
Stacked on #13948, which makes the server name background work as a discriminated union. This PR shows it.
The composer strip said "Waiting on N background tasks" whether the work was a subagent, a shell command or a monitor, and it only listed raw descriptions or task ids. Mobile showed nothing at all once the turn settled. Timeline notification rows all used the same bolt icon and could not open the subagent that finished.
What changed
Every client decision switches on the union's
kind, with asatisfies neverdefault, so a new kind fails to compile until each switch handles it. No client or shared code reads providertaskTypestrings any more.presentPendingBackgroundWorkinpackages/client-runtime/src/state/threadExecution.ts): groups pending work bykind, subagents first. A subagent member'schildThreadIdbecomes the item's link. A roster from before kinds existed arrives asbackground_task(the contracts fallback from feat(server): background wakes say which subagent, command, or monitor finished #13948), so it reads "background task".InlineButtonthat opens its child thread, using the handler the timeline already uses. The long list keeps the banner's existing truncate-and-popover behavior. Stop is unchanged.source.kindfrom the existing sets (webbot/terminal/eye, mobilehammer/command/eye, matching each surface's subagent and command rows).delegated_taskuses the subagent icon,background_taskkeeps the bolt, and a failed outcome keeps the alert icon. A notification whose source is one subagent or one delegated task opens that thread (notificationChildThreadId): an "Open subagent" link on web next to the timestamp (the same slot as "Open chat" for created threads), and the whole row on mobile (like the rows in the mobile subagent group). The summary text itself comes from feat(server): background wakes say which subagent, command, or monitor finished #13948.Before and after
I did not run a dev server, so there are no screenshots. The strings, from the shared builder and the #13948 replay fixtures:
Background subagent testReview src/math.ts, Write tests, npm testBackground sleep testbackground_task)background_commanddecodes ascommand)Verification
packages/client-runtime:vp test run src/state/threadExecution.test.ts src/state/entities.test.ts: 50 passed. The presentation tests build union members only: single, grouped (with a subagent's child thread), and genericbackground_tasktitles.apps/web:vp test run src/session-logic.test.ts src/components/chat/MessagesTimeline.logic.test.ts src/components/Sidebar.logic.test.ts: 320 passed.apps/mobile:vp test run src/lib/threadActivity.test.ts src/features/threads/floating-working-status.test.ts src/features/threads/threadListV2.test.ts: 173 passed.tsc --noEmitfor contracts, shared, server, client-runtime, web and mobile: clean.vp linton touched files: no errors (it caught atoSortedthat Hermes lacks, fixed); remaining warnings are pre-existing.vpr knip:check: clean.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code