Repository navigation
fix(native-chat): the working line shows only what the agent is doing now - #24218
Conversation
… now A chat's live "Working…" line could show an old notice, such as "Claude hit a temporary problem and is retrying.", long after the agent had moved on and was running new commands. When the host had no live activity for the turn, the line fell back to the newest status row in the turn, and any status row qualified: retry warnings, "Context compacted", "Cancellation requested.", and notification summaries. Those rows record the past and already appear in the transcript. The line now reads only the host's live, per-turn activity, which is never saved and is cleared at turn boundaries. Without it, the line says Thinking or Working…. Desktop and mobile share the selector, so both change.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe selector now returns activity from matching provider turn activity. It rejects missing or mismatched turn IDs, empty activity text, and text that repeats a recent root-agent tool label. Journal status rows no longer supply selected activity. Tests cover provider activity, excluded status text, and the mobile turn indicator. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The inspected activity paths preserve the active turn association, and no concrete issue requiring resolution before merge was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 new issues found.
Reviewed changes
- Journal fallback removed from the live line —
selectStructuredAgentTurnActivitynow returns the host's per-turn live activity only, dropping the scan of journalstatusrows that could show a stale retry/compaction/cancellation notice on the spinner. - Tool-label de-dup preserved — the returned live text is still suppressed when it repeats a recent root-agent tool label (child rows excluded via
isRootAgentJournalItem). - Tests updated — new
it.eachcovers retry warning, compaction marker, cancellation note, and suppressed-notification summary both before and after later tool activity; the tail-line test feeds provider activity instead of a status row; mobile gains a "never reads a journal status row" case. Two tests asserting the old fallback were removed. - Comment-only —
structured-agent-session-live-turn.tsrewording; no behavior change.
I verified the removed fallback never dropped information from the transcript: structured-agent-session-projection.ts:127-130 renders every non-turn status body as its own system row, so the fallback was a duplicate. The live-activity path is behavior-equivalent to the old code (same turnId match, same de-dup), and the caller-side null fallback ("Thinking"/"Working…") is intact in NativeChatTurnActivityLine and mobile NativeChatTurnStatus. I ran the shared, mobile, renderer turn-indicator/resolved-view, and Codex subagent-reader suites — all pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ent's live activity
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Regression guard for a subagent's compaction —
codex-structured-journal-subagent-readers.test.tsnow records every live activity the host publishes and asserts a child'scontextCompactionnever reaches the wire as the parent's activity, while the parent's own compaction and itssubagentActivityline still do. It also keeps the child's "Context compacted" row assertion for the transcript.
The only production change in this PR (native-chat-turn-activity.ts dropping the journal fallback and the comment reword in structured-agent-session-live-turn.ts) is unchanged since the prior review at 6164e8c; this commit only adds test coverage. I ran the suite (pnpm test src/main/codex/codex-structured-journal-subagent-readers.test.ts) — 5/5 pass. The guard is real rather than tautological: the child's item/started copy is suppressed by the primary-thread check in publishActivity (src/main/codex/codex-structured-journal-translation.ts:95), so removing that check would publish "Compacting the conversation" for the child and fail the new assertion.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review status: readyProblem: in a running Claude chat, the spinner line at the bottom could stay stuck on an old notice such as "Claude hit a temporary problem and is retrying." while Claude was clearly running new commands. When there was no live description, the line fell back to the newest notice row in the turn, and a mid-turn "Continue" joins that same turn, so the old notice stayed the label for the rest of the turn. What changes for users: the spinner line now shows only what the agent is doing right now. For Claude that is "Working…" or "Thinking", or "Compacting the conversation" while it compacts. Codex keeps its step descriptions such as "Running a command". Notices like the retry warning, "Context compacted" and stop notes still appear, as their own rows in the transcript, and no longer take over the spinner line. Fixed during review:
Deferred (nits, not blocking):
Verified:
Not verified:
|

ELI5
While an agent works in a chat, the spinner line at the bottom ("Working…") is supposed to say what it is doing right now. It could instead get stuck showing an old notice, such as "Claude hit a temporary problem and is retrying.", while the agent was clearly busy running new commands. This PR makes that line show only what the agent is doing at this moment.
What Changed
Scope: the live spinner line at the bottom of a running structured chat (Claude and Codex), on desktop and mobile. The transcript itself is unchanged: every notice still appears as its own row where it happened. Terminal panes, the sidebar status, and settled turns are not affected.
Before: when the host had no live description for the running turn, the spinner line fell back to the newest status row anywhere in that turn and kept showing it until a newer status row replaced it. Any status row qualified: a retry warning, "Context compacted", "Cancellation requested.", or "3 more provider notifications not shown for this turn". A message sent mid-turn (for example "Continue") joins the same turn, so a retry warning from twenty minutes earlier could sit on the spinner line while the agent ran new commands. That notice was also already visible as its own row in the transcript, so it showed twice.
After: the spinner line reads only the host's live activity for the turn: the per-turn text the host keeps in memory, never writes to the journal, and clears when the turn ends. When there is none, the line says "Thinking" while the agent is reasoning, otherwise "Working…". For Claude that means "Working…"/"Thinking" for most of a turn and "Compacting the conversation" while compacting. Codex keeps its step descriptions ("Running a command", "Editing files", …) because those already come from the live activity.
Mechanism:
selectStructuredAgentTurnActivity(src/shared/native-chat-turn-activity.ts), which desktop and mobile both use, no longer scans journal status rows. It returns the live activity for the running turn, still dropping text that only repeats the turn's own current tool label, or nothing.Why
The bug was having two sources for one fact. The host already kept a live activity value with the right lifecycle: set by the provider translators, never saved, cleared at turn boundaries. The journal fallback was a second source, and it was built from history. A journal row records something that happened; nothing ever retires it as "current," so treating the newest one as the present will always go stale. Removing that source removes the whole bug class, not just the retry case.
Alternatives considered:
Compatibility: nothing on the wire changes. Hosts already publish the live activity to desktop and mobile clients. Older clients keep the old fallback until they update; a newer client talking to an older host behaves correctly because older hosts already send the live activity.
Known follow-up (not in this PR): the retry warning row stays in the transcript as a warning even after Claude recovers. Marking it as recovered once Claude responds again is a separate change.
Linked Issue
None. Reported from a live session (maintainer PR).
Visual Proof
Built and run on a separate Mac, before (main) and after (this PR). A stand-in Claude CLI reports a provider retry, then keeps running commands; "Continue" is sent mid-turn and joins the same turn.
Before: the spinner line under "Running 1 command cat README.md" still reads the retry notice (it stayed for the whole 62-second turn).
After: the same moment reads "Working…"; the retry warning stays as its own row in the transcript.
After, unchanged live descriptions: Claude still shows "Compacting the conversation" while compacting, and Codex still shows its step ("Running a command").
Testing
New tests put a retry warning, a compaction marker, a cancellation note, or a suppressed-notification summary into a running turn, both before and after newer tool activity, and assert that none becomes the spinner line. With this change reverted, all four fail; with it, they pass.
Updated the existing tests that expected a status row to become the label so they feed the same text through the live activity instead. Added a mobile test that a journal status row alone leaves the indicator empty.
Passing locally on macOS:
src/shared/native-chat-turn-activity.test.ts,src/shared/native-chat-activity-tail-line.test.ts,src/shared/native-chat-turn-status.test.ts, theNativeChatMessageList/NativeChatResolvedViewturn-indicator suites, the related Codex subagent reader suite, and the mobile session turn-status/indicator suites; web and node typechecks; mobile typecheck plus its test-file typecheck;check:code-quality:changed.Live run on a separate Mac (before and after builds, stand-in Claude CLI and a local Codex model endpoint): the before build kept the retry notice on the spinner line for the whole turn, including after "Continue"; the after build showed "Working…" throughout, still showed "Compacting the conversation" during compaction, and Codex still showed "Running a command". A Codex warning row also stayed off the spinner line.
A Codex test now checks that a subagent's compaction never becomes the parent's spinner line; it fails if the host's main-thread check is removed.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security: none; this only chooses which text a label shows. Cross-platform: shared TypeScript, no platform code. SSH/remote: the live activity is already published by the execution host to every client; no new field. Mobile: uses the same selector and changes the same way. Performance: the selector now scans journal items only when there is live text to de-duplicate against the turn's tool labels.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)