Repository navigation
fix: restore the full sidebar agent row for structured native chat - #19137
Conversation
The host status feed projected only state, prompt, and agent type, so a structured Claude/Codex row fell back to the tab title and the agent-type label where a hook-reported row shows the running tool, the agent's last message, and the model. Project the tool line and the newest assistant prose from the journal, and take the model from the session record's acknowledged options. The tool scan stops at the live turn's lifecycle row and only runs while a turn is running, so an abandoned call from a crashed turn is never reported as live work. The assistant line is bounded to the shared preview cap rather than the hook field's 8 KB body: a streamed reply re-projects on every journal checkpoint, and the row renders one line of it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe structured agent session status projection now includes the active tool name, described tool input, and newest assistant prose. The host status feed adds the session model and publishes changes when these fields change. The shared status summary type exposes the new optional fields. The renderer bridge maps the fields into sidebar agent state and clears tool details when the turn settles. Tests cover projection, host feed, option settlement, and renderer updates. Merge Risk: ⚪ Minimal · up to This change adds model, active tool, and assistant-message previews to structured chat sidebar rows. Status updates preserve an already displayed model when later updates omit it, leaving no current merge-blocking risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description clearly explains the problem, implementation, verification, and out-of-scope work. However, it omits the required linked issue, visual proof or an explicit N/A explanation, and the required checklist and testing confirmations. Resolution Add the required issue reference under Linked Issue, attach before-and-after visual proof or write N/A with a reason, complete the Testing and other required checklist sections, and include the required AI Disclosure and Agent skill upstream boundary responses.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: f8651811-943f-4ccd-994f-d22858be5e99
📒 Files selected for processing (7)
src/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/StructuredAgentSessionStatusBridge.test.tsxsrc/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsxsrc/shared/agent-session-wire.tssrc/shared/structured-agent-session-projection.test.tssrc/shared/structured-agent-session-projection.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| agentType: tab.agentSessionAgent, | ||
| // The host projects these from the journal so the row reads like a hook-reported one: | ||
| // the running tool while a turn is live, the agent's last words once it settles. | ||
| ...(summary.model ? { model: summary.model } : {}), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the prior model when an update omits model.
If summary.model is absent and lastAssistantMessage changes, Line 92 does not return early. Line 80 then sends a payload without model. The status entry loses its previous model when the store replaces the payload. Derive the desired model from summary.model ?? current?.model, compare against that desired value, and add a regression case with an omitted model.
Proposed fix
+ const current = store.agentStatusByPaneKey?.[paneKey]
+ const model = summary.model ?? current?.model
const desired = {
// ...
- ...(summary.model ? { model: summary.model } : {}),
+ ...(model ? { model } : {}),
// ...
} as const
- const current = store.agentStatusByPaneKey?.[paneKey]
if (
// ...
- (summary.model === undefined || current.model === summary.model) &&
+ current.model === desired.model &&There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Shared projection enrichment —
projectStructuredAgentSessionStatusSummarynow derivestoolName/toolInput(from the live turn's running tool call, viadescribeToolInput) andlastAssistantMessage(newest assistant prose, tool-only items skipped), all bounded to the same preview caps other agent-status fields use. - Status feed model + dedup — the host reads
modelfrom the record's acknowledged options andsummariesEqualnow compares the four new fields so a tool boundary is not deduped away as an unchanged projection. - Wire contract — four additive optional fields on
AgentSessionStatusSummary, consistent with the file's remote-wire-compatibility note (every field optional to old readers). - Bridge handoff — the renderer passes the new fields into the agent-status entry, with the write guard matching the entry builder's carry-forward semantics (
modelcarried, the other three cleared when absent). - Tests — 41 tests across the touched surfaces, with exact
toEqual/toHaveLengthassertions pinning the mechanism rather than the shape.
The projection, the backward scan's lifecycle-row stop, the summariesEqual/guard comparisons, and the model carry-forward in the entry builder all line up correctly; the PR is careful about frame size and documents its out-of-scope gaps and the mid-session model-switch wart.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
setOptionnow publishes the status feed —performSetOptioncallsctx.publish()afterpersistOptions, so a mid-session model switch reaches the sidebar row without waiting for the next journal event. Persist-then-publish ordering means the feed'srecord.options.modelread sees the acknowledged value; the replay path returns a cached answer and never re-publishes.lastAssistantMessagebounded to the latest user turn —latestStructuredAgentSessionAssistantMessagenow returns''at a user-message boundary, clearing the prior turn's prose the moment the next prompt is persisted rather than leaking it into the new turn's thinking phase.
Both changes pin their mechanism with tests that would fail if reverted (publishes an acknowledged model without waiting for journal traffic, clears the previous answer as soon as the next prompt is persisted); the touched test files (projection, status-feed, option-settlement, bridge) pass locally.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Visual evidence for the structured native Claude sidebar row on Working turn — real composer send ( Settled turn — first composer send ( Idle model switch (Haiku → Sonnet) updated the sidebar badge immediately ( |
|
Final review status: ✅ land
No remaining merge blocker. |
…tablyai#19137) * fix: restore the full sidebar agent row for structured native chat The host status feed projected only state, prompt, and agent type, so a structured Claude/Codex row fell back to the tab title and the agent-type label where a hook-reported row shows the running tool, the agent's last message, and the model. Project the tool line and the newest assistant prose from the journal, and take the model from the session record's acknowledged options. The tool scan stops at the live turn's lifecycle row and only runs while a turn is running, so an abandoned call from a crashed turn is never reported as live work. The assistant line is bounded to the shared preview cap rather than the hook field's 8 KB body: a streamed reply re-projects on every journal checkpoint, and the row renders one line of it. * fix: keep structured session status current --------- Co-authored-by: Merge Sim <sim@local>



What
The worktree sidebar row for a structured Claude/Codex chat showed far less than the equivalent hook-reported row. It read
Claude Chat - Claude— the tab title, then the agent-type label the row falls back to when it has nothing else — with no model badge and no sign of what the agent was doing.Why
projectStructuredAgentSessionStatusSummaryfed the sidebar only three things:status,latestPrompt, and (client-side) the agent type. A hook-reported row also carriesmodel,toolName/toolInput, andlastAssistantMessage, which is whatgetCompactAgentSecondaryandDashboardAgentRowrender in the secondary slot and the model badge. With none of them present, every structured row degraded toformatAgentTypeLabel(agentType).How
src/shared/structured-agent-session-projection.ts— the shared projection now also derives from the journal:toolName/toolInputfrom the tool call the live turn is inside, previewed withdescribeToolInput(the same previewer native chat's "Running …" line uses). The backward scan stops at the turn's own lifecycle row, and the fields are only emitted whilestatus === 'working'— the ruleshowsAgentToolPreviewalready enforces on the render side — so an abandonedrunningcall from a crashed turn can never be reported as live work.lastAssistantMessagefrom the newest assistant item that has prose; tool-only assistant items are skipped rather than blanking the row.src/shared/agent-session-wire.ts— four additive optional fields onAgentSessionStatusSummary.structured-agent-session-status-feed.ts—modelcomes from the record's acknowledged options (the journal has none), andsummariesEqualcompares the new fields; without that a tool boundary is deduped away as an unchanged projection.StructuredAgentSessionStatusBridge.tsx— passes all four into the agent-status entry, with the write guard extended to match. The model check reads "only a reported model can differ", because the entry builder carries the last known model forward.A working structured chat now reads
<title> - Read: src/foo.tswith a model badge; a settled one reads<title> - <what the agent said>.Bound on the assistant line
It is capped at the shared 200-char preview rather than the hook field's 8 KB body. A streamed reply re-projects the summary on every journal checkpoint (geometric gate + 60 ms coalescer, so tens of publications per long turn), and the row only ever renders one line of it — the frame has to stay small. Structured sessions are local-only today, so this is a client-side row preview, not a remote-bandwidth question, but the publication rate is the same either way.
Verification
pnpm tcgreenpnpm run check:code-quality:changed— 0 new findings across 7 files (incl. React Doctor)pnpm run audit:code-quality:nativegreen; oxfmt cleanWorktreeCardAgents/DashboardAgentRow/local-structured-session-tabs-syncsummariesEqualcomparison, and removing the bridge's guard comparison, each turn a new test red — the tests pin the mechanism, not just the shapeDeliberately out of scope
Two pre-existing gaps on this surface, both separate from the projection:
monitoringonly when no foreground turn is running, which is exactly when the feed projectsidle— so during a background task the sidebar contradicts the chat. Fixing it needs abackgroundTaskStatedep on the feed plus its own publication edge atpublishBackgroundTaskState(background-task changes deliberately don't fire the journal hook, so today they reach no status edge at all).entry.subagents; structured sessions would needTasktool calls tracked as lifecycle children. That's a feature, not a field.Known minor wart: switching the model mid-session doesn't publish the status feed (
performSetOptiondoesn't callctx.publish()), so the badge refreshes on the next journal event rather than instantly.