Repository navigation
feat(native-chat): the background-tasks strip says what is running - #19311
Conversation
The strip above the composer described five different kinds of background work as "Monitoring background tasks", with identical flat-dot rows. Now: - Wire: additive optional `name`, `state`, `startedAt` on AgentSessionBackgroundTask, plus `settledTasks` on the state object so terminal siblings of a live fan-out stay visible without changing what old clients render (they keep exactly the live `tasks` list). - Reducer equality learns the new fields, so a publish whose only change is a task's state is no longer judged equal and dropped. - Header counts by kind and lists states within a kind; past three kind segments (or on a narrow strip, measured by its own border-box against the live root font size) it falls back to an honest total, never a partial enumeration, and the strip stays expandable whenever the header is lossy. - Rows group by kind (Agents / Shell / Monitors / Workflows / Tasks), stable-sorted first-seen-then-id, each with a kind icon, its own state dot, a resolved name (description -> name -> kind label), and elapsed. - Claude producer: task frames now carry name (agent_type/subagent_type), a run state mapped from patch status, and first-seen startedAt. Terminal statuses settle a task (completed->done, failed->blocked, killed/stopped->idle) instead of deleting it; settled tasks render only beside still-live work and flush when the last live task ends, so the strip exits exactly when it does today. An unreadable patch leaves a task open, never settled. - Turn gating moves off the strip: the tracker no longer zeroes its roster during a foreground turn, and the client renders the strip whenever it has contents while the idle-only flag now gates just the animated monitoring indicator and conversation commands.
buildSubagentChildRows() has always rendered indented children from parentEntry.subagents, and the structured-session status bridge has always published an AgentStatusEntry for native chat — it just never populated subagents. Connect them: - Wire: additive optional `backgroundTasks` on AgentSessionStatusSummary (live tasks only), projected by the host status feed from the provider's backgroundTaskState hook and republished on task edges via the background-task channel, with the shared task equality suppressing no-op re-projections. - Bridge: maps agent-kind tasks onto the sidebar's own AgentSubagentState (working/waiting/blocked, terminal -> idle) — kinds stay distinct, so a backgrounded shell never lands in a subagent count — and extends its pre-write equality with the existing agentSubagentsEqual. - parentIsFresh for a bridge entry means "the host feed reported a change inside the sidebar's ordinary evidence window": every publish restamps evidenceObservedAt, and a dead feed stops restamping, so children decay to idle on lost contact instead of pinning 'working'.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds bounded Claude background-task frame readers and extends task wire data with names, states, timestamps, settled tasks, and token usage. The tracker publishes live and terminal task state without foreground-turn gating. Status feeds include provider task changes and republish task-only updates. Renderer state projects agent tasks into sidebar subagents and displays grouped, localized task rosters with elapsed time and stop controls. Priority: ➖ Normal Merge Risk: 🔵 Low · up to Background-task usage near one million tokens is displayed inconsistently as 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 34.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 29 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline, plus a nitpick.
Reviewed changes
Reviewed the full 21-file diff. This is a careful change: additive-optional wire fields (name, state, startedAt, settledTasks), a turn-gate split that keeps admission semantics intact, and a sidebar bridge that reuses the existing AgentSubagentState vocabulary rather than widening it.
claude-background-task-frames.ts(new) — bounded field readers plus thekind/stateclassification split out of the tracker.claude-background-task-tracker.ts— carries name/state/startedAt, retains terminal siblings on a separatesettledmap, and drops the foreground-turn roster gate.background-task-roster.ts(new) — grouping (stable first-seen sort), name resolution, and header derivation, each variant pinned by unit tests against the signed-off mock.NativeChatBackgroundTasksStatus.tsx— kind-grouped rows with per-row state dots, visibility-gated elapsed ticking, and a ResizeObserver-driven narrow fallback.- Status feed +
StructuredAgentSessionStatusBridge.tsx— projects livebackgroundTasksonto the sidebar'ssubagents, deduplicated byagentSessionBackgroundTasksEqual/agentSubagentsEqual. - Shared wire/reducer — optional fields plus
agentSessionBackgroundTasksEqualso a state-only publish is applied instead of dropped.
The turn-gate removal is correct on the admission path: conversationCommandBlocked checks activeStructuredAgentSessionTurnId before the monitoring refusal (structured-conversation-command-admission.ts:26 precedes :38), so mid-turn admission outcome is unchanged. New tests assert exact header/state values (toEqual) rather than loose truthiness, so they do pin the behavior they claim.
ℹ️ Nitpicks
subagentStateFromTask'swaiting/blocked/done/idle/unverifiablebranches are unreachable for the current provider:summaryForprojects only.tasks(live), the Claude tracker routes every terminal state intosettledTasks, and live states are onlyworking/monitoring. So sidebar subagents renderworkingfor the whole fan-out and vanish on completion — a failed (blocked) or waiting child never surfaces. If showing those attention states is intended,settledTasksneeds projecting too; if not, the extra branches are forward-only and could carry a note.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…rry usage Real-agent QA showed settledTasks never rendered. A frame capture from the SDK (probe against claude 2.1.261) explains it: when a backgrounded child finishes, the producer emits `background_tasks_changed` FIRST — with the task already absent — and only then `task_updated`/`task_notification` with the outcome, in the same tick. The tracker's settle path looked the task up in the live roster the aggregate had just evicted, so retention lost the race 100% of the time. Fix: aggregate eviction of a live backgrounded task now parks its details in a bounded recently-removed map (new claude-settled-background-tasks.ts, which also owns the settled roster), and the trailing terminal edge consumes it. A removal whose outcome frame never arrives still vanishes — nothing is guessed into a finished state. A second terminal edge for the same task re-derives the settled state and can add final usage. The captured sequence is replayed verbatim as a tracker test, including the kill-at-exit tail proving the strip still exits with the last live task. The same capture disproved the PR's earlier claim that Claude task frames carry no usage: task_progress and task_notification both carry usage.total_tokens. Additive optional `totalTokens` on the wire task, covered by the shared equality; the tracker takes usage (never the transient "Running <tool>" description) from task_progress, and rows render the mock's "18.1k · 2m" meta — settled rows keep final usage with no still-growing clock.
|
QA finding resolved: it was (1) — retention was genuinely broken for this producer — now fixed in adef3a9, with a bonus correction. A direct frame capture from the SDK (probe script driving The tracker settled by looking the task up in the live roster — which the aggregate had evicted one frame earlier — so Fix: aggregate eviction of a live backgrounded task parks its details in a bounded recently-removed map ( Correction to this PR's earlier claim: the same capture disproved "Claude task frames carry no usage" — Gates after the fix: tracker 22/22 (incl. the replay), main/claude + agent-session-wire + reducer suites 79 files / 725 passed, |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 941638aa-4d48-460d-a505-dbd41832f795
📒 Files selected for processing (9)
src/main/claude/claude-background-task-frames.tssrc/main/claude/claude-background-task-tracker.test.tssrc/main/claude/claude-background-task-tracker.tssrc/main/claude/claude-settled-background-tasks.tssrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsxsrc/renderer/src/components/native-chat/background-task-roster.test.tssrc/renderer/src/components/native-chat/background-task-roster.tssrc/shared/agent-session-wire.tssrc/shared/structured-agent-session-reducer.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Re-capture at
|
There was a problem hiding this comment.
ℹ️ No critical issues — the evict-then-settle fix and token-usage carry are correct; one minor suggestion inline.
Reviewed changes
Reviewed the third commit (adef3a9) since the prior pullfrog review of fd7f1fa.
- Extracted settled-task retention into a dedicated
ClaudeSettledBackgroundTasksclass with arecentlyRemovedbuffer, so a terminal edge can settle a task the aggregate roster evicted before the outcome frame arrived (the real producer order, captured 2026-09-07). - Carried token usage onto the optional
AgentSessionBackgroundTask.totalTokensfromtask_progress/task_notificationframes, rendered as compact counts (18.1k) beside live rows and final usage on settled rows. - Extended task equality (
agentSessionBackgroundTasksEqual) to comparetotalTokens, so a usage-only publish is applied instead of dropped.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — one minor cleanup suggestion inline.
Reviewed changes
Reviewed the fourth commit (f980891) since the prior pullfrog review of adef3a9.
- Synced the runtime-required catalog to re-ship
backgroundTasks.runningList, which the strip rewrite's removal of its only call site left orphaned inen.json.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Review completed at ae16d67. Two fix rounds were followed by a clean re-review and an independent ending readiness pass with no proven remaining findings.
Limits: requested Grok QA could not run because its weekly quota was exhausted; the same-model reviewer performed the Electron fallback. Historical severity counsel had three available seats and partial blind ratings due orchestration errors. Real transport-loss/31-minute behavior was unit-tested, not live-soaked; Windows/Linux/WSL/SSH, mobile/paired-web, old-version peers, approval states, light theme and narrow splits were not manually exercised. The child’s requested TaskOutput wait was unavailable in its provider context, so the capture proves lifecycle display/stop rather than successful completion of that wait workflow. The reported GitHub check was still in progress; this is not an unconditional all-platform merge approval. Live tasks: After Stop: |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 46595f02-d033-48d0-ba50-9b889ac41d6a
📒 Files selected for processing (16)
src/main/claude/claude-background-task-tracker.test.tssrc/main/claude/claude-background-task-tracker.tssrc/main/claude/claude-settled-background-tasks.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-feed.tssrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsxsrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsxsrc/renderer/src/components/sidebar/worktree-subagent-child-rows.tssrc/renderer/src/runtime/structured-agent-session-status-feed.test.tssrc/renderer/src/runtime/structured-agent-session-status-feed.tssrc/renderer/src/store/slices/agent-status-contract.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/shared/agent-status-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| ...(summary.toolName ? { toolName: summary.toolName } : {}), | ||
| ...(summary.toolInput ? { toolInput: summary.toolInput } : {}), | ||
| ...(summary.lastAssistantMessage ? { lastAssistantMessage: summary.lastAssistantMessage } : {}), | ||
| ...(subagents ? { subagents, subagentObservation: observation } : {}), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Exclude settled agent tasks from sidebar subagents.
A retained task with state: 'done' reaches this spread. subagentStateFromTask converts it to idle, so the sidebar keeps an idle child after the task settles. Filter terminal tasks before deriving subagents, and add a regression test for task removal on done.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the lifecycle reconciliation, journal-projection caching, and live/unverifiable subagent observation are all sound and well covered.
Reviewed changes
Reviewed the fifth commit (ae16d67) since the prior pullfrog review of f980891.
- Reconciled the settle↔aggregate ordering —
replaceAggregateRosternowforgets a re-listed id out of both retention maps, so a task an authoritative roster reports live can no longer also appear undersettledTasks; pinned by a retract test. - Bounded host projection work — the status feed caches the journal projection by
(epoch, sequence, readOnly), so task-progress publishes no longer re-sort/scan an unchanged conversation, with tests covering single-projection reuse and invalidation on journal changes and unreadability. - Gated the elapsed clock — the strip's
useNowticking is disabled while the pane is hidden (threadingisVisiblethroughNativeChatBackgroundTasksStatus) and catches up on reveal. - Made subagent freshness honest — the renderer feed tracks per-connection confirmation and the bridge writes
subagentObservation, so a structured session's children decay tounverifiable(neverworking) on lost contact and reconfirm per connection.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Electron QA at f980891 found a reproducible resumed-task defect; this is not a clean QA result. Ran a fresh hidden Electron dev build from the QA worktree with A real Claude structured session launched two Observed:
Defect: same resumed task rendered twice. Long proof writer ( Terminal-edge caveat: Long proof writer disappeared from the sidebar around 23:49:30 and reappeared around 23:51:51, with the same task ID, while its own background sleep bridged those turns. Therefore this run does not establish continuous sidebar visibility until the task's ultimate completion across this pause/resume case. This is separate from the passing parent-Done retention check. The provider emitted an intermediate completion notification; its final completion was at 23:53:17. The assistant's prose inside the screenshots initially misdiagnoses this as termination and later corrects itself; those prose claims are not QA evidence. No code changes, push, or merge. Local source and timing evidence is preserved in Settled agent beside live agent and shells; parent Done with live indented child. Head f980891. Live token/clock progression: Short proof writer now 20.2k / 1m 8s. Head f980891.
Same resumed Long proof writer duplicated, header incorrectly 3 agents. Head f980891. Resumed sidebar child shows 1m age, while duplicate strip rows remain. Head f980891. After final real task completion: no background strip or sidebar child rows. Head f980891. Cleanup completed: isolated dev runner stopped, CDP 9444 and renderer 5444 freed, scratch profile removed. Evidence remains outside the profile. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7c84fd37-04d5-40c8-83e6-ffda5dc52872
📒 Files selected for processing (31)
src/main/claude/claude-background-task-frames.tssrc/main/claude/claude-background-task-resume.test.tssrc/main/claude/claude-background-task-tracker.test.tssrc/main/claude/claude-background-task-tracker.tssrc/main/claude/claude-settled-background-tasks.tssrc/main/claude/claude-structured-session-close.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-background-task-channel.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-feed.tssrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsxsrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsxsrc/renderer/src/components/native-chat/background-task-roster.test.tssrc/renderer/src/components/native-chat/background-task-roster.tssrc/renderer/src/components/native-chat/structured-session-background-tasks-view.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/components/sidebar/worktree-subagent-child-rows.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/structured-agent-session-status-feed.test.tssrc/renderer/src/runtime/structured-agent-session-status-feed.tssrc/renderer/src/store/slices/agent-status-contract.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/shared/agent-session-wire.tssrc/shared/agent-status-types.tssrc/shared/structured-agent-session-reducer.test.tssrc/shared/structured-agent-session-reducer.ts
🚧 Files skipped from review as they are similar to previous changes (26)
- src/shared/structured-agent-session-reducer.ts
- src/renderer/src/components/native-chat/structured-session-background-tasks-view.ts
- src/renderer/src/runtime/structured-agent-session-status-feed.test.ts
- src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx
- src/renderer/src/store/slices/agent-status-contract.ts
- src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx
- src/renderer/src/components/sidebar/worktree-subagent-child-rows.ts
- src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
- src/renderer/src/i18n/en-runtime-required.json
- src/shared/agent-status-types.ts
- src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsx
- src/renderer/src/i18n/locales/en.json
- src/main/native-chat/agent-session-wire/structured-agent-session-background-task-channel.ts
- src/renderer/src/runtime/structured-agent-session-status-feed.ts
- src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
- src/main/claude/claude-structured-session-close.test.ts
- src/renderer/src/store/slices/agent-status-live-entry-builder.ts
- src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx
- src/shared/structured-agent-session-reducer.test.ts
- src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts
- src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx
- src/main/claude/claude-background-task-tracker.ts
- src/renderer/src/components/native-chat/use-structured-agent-session.ts
- src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts
- src/main/claude/claude-background-task-tracker.test.ts
- src/main/claude/claude-background-task-frames.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
ℹ️ No new issues in this delta.
Reviewed changes
Reviewed the commits since the prior pullfrog review of ae16d67, plus the origin/main merge that landed alongside them.
- Added
ClaudeSettledBackgroundTasks.resume(id)— transfers a settled or recently-removed task's identity (startedAt,totalTokens) back to the tracker asbackgrounded: truewithstate: undefined, so an authoritative roster that re-lists a settled id restores the live owner instead of leaving the stale settled copy beside it. - Routed roster re-listing through
resume—replaceAggregateRosternow callsretention.resume(id)per re-listed id (rather thanforget), andupsertuses it as a fallback source, so a current-version host never publishes an id in bothtasksandsettledTasks. - Deduplicated the renderer roster by id —
buildBackgroundTaskGroupsfolds live and settled lists through aMap(settled inserted first, live wins), so a mixed-version host that retains a previous turn beside its resumed live task renders exactly one live owner. - Pinned the resume path with tests — new
claude-background-task-resume.test.tscovers the evict → settle → auto-resume cycle and the edge-onlyupsertresume, and a mixed-version roster test asserts one live owner plus kind-accurate header counts with exactstartedAt/totalTokensvalues. - Reconciled the
origin/mainmerge inuse-structured-agent-session.ts, adapting the background-task view to main's message-hook extraction.
The resume semantics are sound: resume keeps the original startedAt (elapsed time survives a resume) and totalTokens (final usage isn't lost), while exposing a fresh live state so a re-listed task never renders its stale done. The tests are exact (toEqual with concrete startedAt/totalTokens), so they genuinely fail on regression rather than absorbing whatever they're handed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…d restore subscribe fixture
…hat-subagent-hud # Conflicts: # src/main/claude/claude-background-task-tracker.ts # src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts # src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx # src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx # src/renderer/src/runtime/structured-agent-session-status-feed.ts
…eardown The status feed's projection cache calls journal.cursor(); the rename test's stubs are cast through unknown, so the missing method only surfaced at runtime. Teardown runs only once nothing is activated, so there is no mounted reader to notify - clearing confirmed sessions is what prevents a stale live on reactivation.
…hat-subagent-hud # Conflicts: # src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx # src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx # src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx # src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx # src/renderer/src/components/native-chat/structured-session-background-tasks-view.ts # src/renderer/src/components/native-chat/use-structured-agent-session.ts
The header carried one aggregate state dot, so a fan-out of agents and a monitor looked alike. Each count segment now leads with its own kind glyph; a collapsed total spans kinds and takes none. Monitor is the heartbeat AgentStateDot already draws for monitoring, so the strip and the agent sidebar speak one vocabulary.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the two
origin/mainmerges reconcile cleanly against main's Codex-background-tasks and worktree-pswork, and the teardown fix is correct.
Reviewed changes
Reviewed the three commits since the prior pullfrog review of 8a3d9e1.
- Merged
origin/maintwice — reconciled conflicts in the tracker, both status feeds, the strip, and the sidebar bridge against main'sclaude-subagent-*readers,structuredAgentSessionStatusState, andsupportsStopAllwork. The net state is consistent: the tracker re-exportsclaudeTaskId/claudeTaskDescriptionfor the shared readers while keeping its owntaskId/taskDescriptionnames, and the bridge adopts the shared state mapping so the sidebar row can no longer disagree withworktree ps. - Removed the redundant
emit()from the renderer feed'sstop()— teardown only runs once nothing is activated, so there is no mounted reader to notify;confirmedSessions.clear()still runs, which is what prevents a staleliveon reactivation. - Completed the journal stubs — the rename test's fixtures now provide
cursor(), which the status feed's projection cache calls unconditionally.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues — the kind-icon header is a clean visual iteration, with one minor cleanup suggestion.
Reviewed changes
Reviewed the single commit since the prior pullfrog review of d50c851.
- Extracted the header into
background-task-header-content.ts— moved the counting/phrasing (kindCountLabel, the segment cap, the state order) out ofbackground-task-roster.ts, leaving grouping and row state behind; no import cycle. - Led each header segment with its kind icon —
BackgroundTasksHeaderSegmentis now{ text, kind }so the renderer can prepend theBot/Activity/SquareTerminal/Workflowglyph; the monitor glyph changed fromEyetoActivityto match the sidebar's monitoring heartbeat. The collapsed total (spanning kinds) carries no icon, and the aggregate state dot was removed in favor of the icons plus the existing state text. - Updated the roster/status tests to the new segment shape, plus a new strip-header test asserting exact
aria-labeland icon presence.
ℹ️ Nitpicks
backgroundTasksDotStateinbackground-task-roster.ts:165lost its only production call site when the header switched to kind icons — it and itsdescribeblock inbackground-task-roster.test.tsare now dead. Consider deleting them, or note they are intentionally kept for a follow-up.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the header separator now renders in
text-muted-foregroundinstead of the near-invisible--borderdivider token, and a test pins the tone plus the exact rendered text.
Reviewed changes
Reviewed the single commit since the prior pullfrog review of a970393.
- Reseparated the collapsed header counts in a visible tone — the
·between kind segments switched fromtext-border(the 7%-white divider color, effectively invisible attext-xs) totext-muted-foreground, with an inline comment recording why the divider token was wrong for inline text. - Pinned the tone with a test — a new strip-header test renders two segments (
1 agent · 1 shell), finds the single separator, and assertstext-muted-foregroundis present /text-borderabsent plus the exactheader.textContent, so the fix can't silently regress.
The one open runningList thread (from f980891) predates this delta and is untouched by it, so it stays open and this remains a non-approving review.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The status feed's projection cache calls journal.cursor(); this stub is cast through unknown, so the missing method only surfaced at runtime. Its journal never changes, so a real one would hold the cursor steady.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the journal-stub fix is correct and the open
runningListthread predates it.
Reviewed changes
Reviewed the single commit since the prior pullfrog review of 22077a5.
- Gave the
worktree-psjournal stub a cursor —journalWithnow returns a steadycursor()({ epoch: 1, sequence: 1 }), matching the status feed's projection cache, which callsjournal.cursor()unconditionally. The stub is cast throughunknown, so the missing method only surfaced at runtime in this spec; the fixed cursor is value-stable, so the(epoch, sequence, readOnly)projection-cache key compares equal on every call and the cache behaves as the commit message describes.
The one open runningList thread (from f980891) predates this delta and is untouched by it, so it stays open and this remains a non-approving review.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Electron QA — fresh captures at
|
| class | computed colour | contrast vs strip bg | |
|---|---|---|---|
a9703936c9 |
text-border |
rgba(255, 255, 255, 0.07) |
~1.2:1 |
22077a5b93 |
text-muted-foreground |
rgb(161, 161, 161) |
legible |
Same live session, same roster, renderer file swapped through Vite HMR so only that one token changed:
a9703936c9 — 2 agents 2 shells, no dot between them.
22077a5b93 — 2 agents · 2 shells, dot clearly present.
So the answer is: invisible at the SHA I captured, fixed by 22077a5b93, which is now on the PR head. Per-kind header icons (bot, terminal) render at both SHAs and are deliberately dimmed while the turn is running.
Not reproduced
- Amber monitor heartbeat as a task row. A
monitorrow needs the provider to sendtask_type: 'monitor'; a Claude session driven from the composer only produceslocal_agentandlocal_bash, so I could not make one. I did not fake it. (The amber heartbeat visible on feat(native-chat): show live background work and name each row by kind #19705's header is that PR's monitoring indicator, a different element.) - Packaged build, Windows/WSL/Linux/SSH, mobile, mixed-version client — all untested.
- Codex lane — this branch does not touch the Codex producer, so its strip is still blanked during the primary turn; mid-turn population here is the Claude lane only.
The strip stands alone: the sidebar mapping, its observation plumbing and the AgentStatusEntry.subagents wiring move to a stacked follow-up. No wire field here is sidebar-only - the strip's rows read name, state, elapsed and tokens.
|
Split per Brennan: this PR is now strip-only. The sidebar subagent rows moved to #19807, which is stacked on this branch and should merge after it. Removed from here (reverted to No wire field here is sidebar-only — the strip's own rows read Affected surface on the reduced PR: 2663 files passed / 2674, 26263 tests passed / 152 skipped. |
There was a problem hiding this comment.
ℹ️ No critical issues — one scope observation about a wire field the split left behind.
Reviewed changes
Reviewed the single commit (df0413e) since the prior pullfrog review of 1e5a2af.
- Split the sidebar subagent rows out of the PR — removed
subagentSnapshotsFromTasks/subagentStateFromTaskfrom the bridge,subagentObservationfromAgentStatusEntry/AgentStatusPayload/buildAgentStatusLiveEntry,getSessionObservation/confirmedSessionsfrom the renderer status feed, and revertedbuildSubagentChildRowsto its pre-observation form. The five renderer-side files are now byte-identical tomain, and nosubagentObservation/getSessionObservation/confirmedSessionsreference remains anywhere. - Simplified the renderer feed's reconnect path —
loseConnectioncollapsed back intofenceCandidateAndReconnect(no moreconfirmedSessions.clear()/unconditionalemit()), and the.catcharms now distinguish active-reconnect from schedule-only, matching the pre-split owner.
ℹ️ Host still projects AgentSessionStatusSummary.backgroundTasks with no reader
The commit message asserts "No wire field here is sidebar-only", but AgentSessionStatusSummary.backgroundTasks is exactly that: the split removed its only consumer (subagentSnapshotsFromTasks(summary.backgroundTasks) in the bridge) while leaving its host-side producer intact. The status feed still declares the readBackgroundTasks dep, projects .tasks into every summary, and compares backgroundTasks in summariesEqual — so a task-state-only change now triggers a full re-broadcast and onStatusChanged for a field no client in this PR reads. (The strip reads the separate AgentSessionBackgroundTaskState from the subscribe channel, not this summary field; the task-level name/state/startedAt/totalTokens are shared and still live.)
This is not a correctness bug — it is dead wire plus wasted republish work, and it contradicts the commit's stated rationale. Either the producer (readBackgroundTasks dep, the summary projection, and the summariesEqual comparison) should have been split out too, or it is intentionally retained for the stacked follow-up to re-consume, in which case the message is misleading.
Technical details
# Dead `AgentSessionStatusSummary.backgroundTasks` producer
## Affected sites
- src/shared/agent-session-wire.ts:271 — `backgroundTasks?: AgentSessionBackgroundTask[]` on the status summary; now producer-only.
- src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts:47 — `readBackgroundTasks` dep.
- src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts:220,231 — projects `.tasks` onto the summary.
- src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts:64 — `agentSessionBackgroundTasksEqual(a.backgroundTasks, b.backgroundTasks)` in `summariesEqual`.
## Required outcome
- Confirm intent: either remove the summary `backgroundTasks` field + `readBackgroundTasks` dep + the `summariesEqual` comparison now, or document that they are retained for the stacked follow-up PR.
## Open questions for the human (optional)
- Will the stacked follow-up consume `AgentSessionStatusSummary.backgroundTasks`, or read the same subscribe-channel state the strip already reads?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
A `task_progress` frame ticks a background task's `totalTokens`, which failed the status feed's equality check and re-broadcast a full summary to every `agentSession.subscribeStatus` subscriber — paired-web and SSH/relay clients included — for a number no session list renders. The projection now drops usage; tokens keep flowing on the background-task channel the strip reads.
… state `formatBackgroundTaskTokens` rounded before choosing the unit, so 999_950 rendered as "1000k" instead of "1m"; pick the unit from the rounded value. `backgroundTasksDotState` has no caller on this branch or the stacked sidebar PR, and its multi-kind branch would report 'monitoring' over an attention state. Delete it rather than leave it to be wired up.
The strip rewrite removed its only call site, and an unreferenced key gets promoted into the eagerly parsed boot catalog. Delete it from en.json and regenerate en-runtime-required.json.
The row guarded the reason line on 'waiting', so an 'unverifiable' child
("no contact") and a 'blocked' one ("failed") rendered bare while the
collapsed header named exactly those reasons. `backgroundTaskStateReason`
already returns null for the non-attention states, so the guard was only
lossy — the SSH boundary requires the unverifiable verdict stay legible.
Also keys the header segments off their kind discriminant instead of the
translated display text.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the four commits since the prior pullfrog review of df0413e.
- Stripped task usage from the summary projection —
summaryFornow maps outtotalTokensbefore projectingAgentSessionStatusSummary.backgroundTasks, so atask_progresstick no longer fails the summary equality check and re-broadcasts a full status to every remote subscriber for a number no session list renders; state changes still propagate, pinned by a test that asserts suppression on token-only change and re-broadcast on a state change. - Corrected token rounding —
formatBackgroundTaskTokensnow picks the unit before rounding (999_950 → "1m"rather than"1000k"), with boundary tests. - Deleted the dead dot-state helper —
backgroundTasksDotStateand its tests are gone, closing the prior nitpick. - Dropped the orphaned
runningListkey — removed from bothen.jsonanden-runtime-required.json, resolving the one open thread. - Named the reason on every attention row —
BackgroundTaskRownow rendersbackgroundTaskStateReason(entry.state)forwaiting/unverifiable/blocked, so an SSH child that lost contact reads "no contact" instead of a silent working dot.
The unverifiable/blocked reason strings are the same ones the collapsed header already used, so the row and header now agree. The new tests use exact toEqual/toContain assertions, so they genuinely pin the behavior rather than absorbing whatever they're handed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The headline counts live AND settled rows, but the state breakdown omitted 'done', so one working agent beside four settled ones read "5 agents — 1 working": the count said five, the breakdown accounted for one. Done now appears in the muted detail (never as an emphasised segment) so the two agree. The single-command header also drew an elapsed clock on a settled task, which the row already refuses as a lie about finished work.
The 1 Hz elapsed tick re-rendered the strip, and the render body regrouped, re-sorted and re-translated every task each time only `now` had changed. The header still derives from `now` on purpose.
Neither headline behaviour had component coverage: every strip render passed
`settledTasks={[]}`, and the `showBackgroundTasks` seam was never set true,
so the strip staying mounted through a running turn was exercised nowhere.
Adds a settled-beside-live row test (final usage kept, no clock, no stop) and
a mid-turn mount test (strip present, turn owns the voice). The background-task
tests share one session-element helper so the file stays under its line cap.
Nothing outside claude-background-task-frames.ts references it; the export was residue from this PR's split.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the four commits since the prior pullfrog review of 817593c.
- Fixed the header count/breakdown mismatch —
HEADER_STATE_ORDERnow ends indone, so a single-kind fan-out's detail (1 working, 4 done) sums to its headline (5 agents), and a settled shell command drops its still-growing elapsed clock in favor ofdone. - Memoized roster grouping —
buildBackgroundTaskGroupsis now wrapped inuseMemokeyed on[tasks, settledTasks], so the 1 Hz elapsed tick re-renders without re-grouping, re-sorting, or re-translating the roster. - Covered the settled-row and mid-turn cases — new tests pin a settled sibling's final usage with no clock and no stop control, the strip staying mounted through a running turn (dimmed amber, turn owns the voice), and the header breakdown summing exactly to the count.
- Made
MAX_TASK_ID_LENGTHmodule-private — a no-op export tightening; the symbol has no external importers.
The header fix is the substantive piece and it is correct: settled ids are deduplicated through the owners map in buildBackgroundTaskGroups before counting, and the new test's self-consistency assertion (headline equals the summed breakdown) catches exactly the class of bug it claims to. The useMemo dependency arrays are sound because the reducer publishes stable task-array references across elapsed ticks, so the memo is effective rather than cosmetic. The new tests use exact toEqual/toContain assertions rather than loose truthiness.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Review status: ready to mergeReviewed at What was wrong, and is now fixedA token tick was re-broadcasting a full session summary to every remote client. The header contradicted itself once settled rows existed. Rows hid the loss-of-contact verdict. The reason line was gated on Both headline behaviours were untested at the component level. All five strip renders passed Also fixed: deleted the exported Verified rather than assumed
Gates on the final tree: Two calls for you, neither a defect
Separately, |
…hat-subagent-hud # Conflicts: # src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts
main now gates the composer's stop button on a provider-minted turnId rather than the send-time working signal, so a test claiming a running turn has to supply one. The controller mock hardcoded turnId null.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the two commits since the prior pullfrog review of 3ced921.
- Merged
origin/mainand reconciled the status feed's projection cache —summaryFornow threadssubmissionsandsession.fenceintoprojectStructuredAgentSessionStatusSummary, and the journal-projection cache keys onfencealongside(epoch, sequence, readOnly). This matches main's#19822"working from the send" semantics, where a lease-fence advance can flip anunknowndispatch to answered without any journal sequence bump. The fence-driven invalidation is exercised by the merged teststops projecting an old-host unknown submission after the owner fence advances, which advancessession.fenceand asserts the status re-projects fromworkingtoidle. - Gave the mid-turn strip test a real turn —
NativeChatStructuredSession.test.tsxnow sourcesturnId/isWorkingfrommocks(reset tonull/falseinbeforeEach) and the "keeps the strip mounted through a running turn" case sets them explicitly, so it genuinely exercises the turn-owns-the-voice path (dimmed monitor amber) rather than a hardcoded idle state.
The fence reconciliation is the substantive piece and it is correct: the projection result depends on the fence via hasUnansweredStructuredAgentSessionDispatch, so it must participate in the cache key, and the inline comment documents exactly why a journal lastSequence bump is not sufficient. The readBackgroundTasks projection, totalTokens stripping, and agentSessionBackgroundTasksEqual equality check all survive the merge intact.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Stacked on #19311, which adds the background-task channel this reads. The bridge maps agent-kind background tasks into AgentStatusEntry.subagents, and the renderer status feed confirms per connection so a reconnect cannot leave a child asserting live from a stream that ended.
#19311 landed the background-tasks strip rewrite this branch overlapped with. Both sides had independently removed the mid-turn suppression, so the shared view file conflicted loudly rather than auto-merging wrong. Resolved toward main wherever main was richer, keeping only what this branch adds that main does not have: - structured-session-background-tasks-view.ts takes main's shape whole (`show` mounts mid-turn, `isMonitoring` stays idle-only for the animated indicator and conversation commands). This branch's mid-turn contribution lives in the producers, not here. - claude-background-task-tracker.ts rebuilt from main's version — main moved its frame helpers out — with this branch's semantics re-applied: `liveInTurn` and its settle on `result`/turn start, aggregate-roster authority scoped to the backgrounded class it enumerates, terminal evidence kept for ids a roster never lists, and retained rows merged in place with the stalest evicted. - `stoppable` folded into main's shared backgroundTaskFieldsEqual. Taking main's reducer helper without that would have dropped the comparison silently, and a row losing its stop would be judged equal and never republished. - The strip component takes main's rewrite; only the per-row stop gate is re-applied, as an extra condition on main's settled check. - native-chat-background-task-kinds.tsx is deleted: main's roster module already owns kind labels and glyphs, and keeping both would leave a dead second vocabulary. NativeChatToolIcon's slot export is reverted with it. agent-session-wire.ts reached 301 of its 300-line budget, so the background-task wire block moved VERBATIM into agent-session-background-task-wire.ts, re-exported so every existing import path still resolves. No max-lines disable, no ratchet bump.
Stacked on #19311, which adds the background-task channel this reads. The bridge maps agent-kind background tasks into AgentStatusEntry.subagents, and the renderer status feed confirms per connection so a reconnect cannot leave a child asserting live from a stream that ended.
… CLI agents already do (#19807) * feat(sidebar): indent native-chat subagents under their session row Stacked on #19311, which adds the background-task channel this reads. The bridge maps agent-kind background tasks into AgentStatusEntry.subagents, and the renderer status feed confirms per connection so a reconnect cannot leave a child asserting live from a stream that ended. * fix(sidebar): avoid completed age for unverifiable subagents * fix(sidebar): preserve unverifiable child verdicts --------- Co-authored-by: Merge Sim <sim@local>


























ELI5
The little strip above the native-chat composer used to say "Monitoring background tasks" no matter what was running, and every row looked identical. Now it says what is actually running ("2 agents · 1 shell · 1 monitor"), each row has a real name, its own state dot, and elapsed time — and the left sidebar shows a session's subagents as indented children, the same way it already does for terminal agents.
What Changed
Strip (commit 1)
AgentSessionBackgroundTask:name,state,startedAt, plussettledTasksonAgentSessionBackgroundTaskState. All optional; an old client renders exactly today's output (settled tasks deliberately live in a separate field so the livetaskslist old clients render is byte-identical).backgroundTaskStatesEqualin the shared reducer now compares the new fields (via a sharedagentSessionBackgroundTasksEqual), so a publish whose only change is a task's state is applied instead of dropped.7 background tasks), never a partial enumeration, and any lossy header leaves the strip expandable.AgentStateDot, resolved name (description→name→ kind label, rejecting empty/placeholder), elapsed meta (ticking only while visible, via the shared visibility-gateduseNowclock), and the existing Stop / stop-all behavior.unknownkeeps a row and counts toward the total.claude-background-task-tracker.ts): carries name (agent_type/subagent_type), mapspatch.statusto a run state (pending|running|paused→working,completed→done,failed→blocked,killed|stopped→idle), stamps first-seenstartedAt(preserved across updates and aggregate roster replacement), and re-derives classification per transition. An unreadable patch leaves the task open — never settled as finished.Sidebar (commit 2)
backgroundTasksonAgentSessionStatusSummary, projected by the host status feed from the provider'sbackgroundTaskStatehook and republished on task edges (channelonPublished→ feed; feed equality suppresses no-ops).StructuredAgentSessionStatusBridgemaps agent-kind tasks onto the sidebar's ownAgentSubagentState(never widened; a backgrounded shell never lands in a subagent count) and extends its pre-write equality with the existingagentSubagentsEqual.buildSubagentChildRows()picks them up with no sidebar change.parentIsFreshfor a bridge entry: every feed publish restampsevidenceObservedAt, so freshness means "the host feed reported a change within the sidebar's ordinary 30-minute evidence window"; a dead feed stops restamping and children decay to idle rather than pinningworkingon lost contact.Why
The strip carried five genuinely different things in one bucket, so a subagent and a backgrounded
sleep 20rendered identically, and two gates hid the strip during a turn — making a fan-out invisible exactly when it is most active. The sidebar already knew how to render subagent children; native chat just never fed it.Linked Issue
Fixes #
Visual Proof
Follows in a comment (real-agent capture per the plan's verification section; unit tests pin every header variant from the signed-off mock in the meantime).
Testing
pnpm test src/main/claude src/main/native-chat/agent-session-wire src/shared/structured-agent-session-reducer.test.ts src/shared/structured-agent-session-coalescer.test.ts src/shared/agent-status-types.test.ts src/renderer/src/components/native-chat src/renderer/src/components/sidebar src/renderer/src/i18n— 562 files passed, 4925 tests passed / 5 skipped (one unrelated load-induced timeout flake inWorktreeCard.compact-hover.test.tsx, untouched by this PR and green in isolation, 27/27).pnpm tc:nodeandpnpm tc:web— clean.pnpm run check:code-quality:changed— 0 findings across 20 changed files (lint, type-aware, React Doctor).AI Disclosure
Review
Wire-compatibility notes for reviewers: both new surfaces are additive-optional per
docs/reference/remote-wire-compatibility.md; settled-task retention was deliberately kept out of thetasksarray so an old client's render is unchanged; host-side conversation-command admission is order-protected (the active-turn refusal precedes the monitoring refusal, so removing the tracker's turn gate changes no admission outcome mid-turn).Agent skill upstream boundary
N/A