Skip to content

fix(native-chat): the working line shows only what the agent is doing now - #24218

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/claude-working-indicator-stale
Sep 30, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/claude-working-indicator-stale

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118 $\color{#cf222e}{\Huge{\mathbf{−}}}$​45 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​73
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13

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:

  • Skip warning rows in the fallback. Fixes this screenshot but not "Context compacted", cancellation notes, or notification summaries, which go stale the same way. Rejected.
  • Report the retry through the live activity instead of a row. Claude sends no later frame that would clear it, so "Retrying…" would stay stuck until the turn ended: the same bug. Rejected.

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).

Before: spinner line stuck on the retry notice while a command runs

After: the same moment reads "Working…"; the retry warning stays as its own row in the transcript.

After: spinner line reads Working… while the retry warning stays in the transcript

After, unchanged live descriptions: Claude still shows "Compacting the conversation" while compacting, and Codex still shows its step ("Running a command").

After: Claude spinner line reads Compacting the conversation

After: Codex spinner line reads 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, the NativeChatMessageList/NativeChatResolvedView turn-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

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

… 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.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes how the live activity line is selected and displayed.

The PR appears safe to merge; no actionable new issue or outstanding previous finding was identified.

Summary

The PR removes journal status rows as a source for the running-turn activity line. Desktop and mobile now use matching live provider activity or their existing fallback; the updated tests cover stale notices, mobile behavior, and Codex subagent compaction.

Reviews (2) · Last reviewed commit: "test(codex): guard that a subagent's com..."

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f519bfc2-ec8b-42bc-a9f8-25cbe6d12522

📥 Commits

Reviewing files that changed from the base of the PR and between 6164e8c and d442497.

📒 Files selected for processing (1)
  • src/main/codex/codex-structured-journal-subagent-readers.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The 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 d4424

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, specific, and accurately describes the main change: limiting the native chat working line to the agent’s current activity.
Description check ✅ Passed The description is complete and covers the user-visible behavior, implementation, rationale, alternatives, compatibility, visual proof, testing, and scope. The missing linked issue is explained as a m…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Journal fallback removed from the live line — selectStructuredAgentTurnActivity now returns the host's per-turn live activity only, dropping the scan of journal status rows 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.each covers 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.ts rewording; 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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Regression guard for a subagent's compaction — codex-structured-journal-subagent-readers.test.ts now records every live activity the host publishes and asserts a child's contextCompaction never reaches the wire as the parent's activity, while the parent's own compaction and its subagentActivity line 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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: ready

Problem: 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:

  • A Codex test meant to check that a subagent's compaction never becomes the parent's spinner line could no longer fail after this change. It now drives the host translator and checks the real guard (the host only publishes the main thread's live activity); it fails if that guard is removed (d442497, test-only).

Deferred (nits, not blocking):

  • Two tests in src/shared/native-chat-turn-activity.test.ts now pass trivially because they pass no live activity, and they overlap the new cases; they could be removed or folded in.
  • Unrelated to this PR: journal-per-session-import.test.ts ("commits copy batches unsynced…") is flaky. Its timer callback can read the database after the test closes it, which failed one CI shard once; a re-run passed.

Verified:

  • Review of the host side (every live-activity and notice-row producer for Claude and Codex): nothing users relied on came only through the removed fallback, and Claude's live compaction text clears when compaction ends.
  • Review of the desktop and mobile readers and tests: the new tests fail against the old code and pass now.
  • After pressing Stop, the spinner shows "Working…" rather than "Cancellation requested." only for the instant before the turn ends, because that note is written only after the provider accepts the stop.
  • Live before/after run on a separate Mac with a stand-in Claude CLI (retry, commands, mid-turn "Continue") and a local Codex model endpoint. Before: the retry notice stayed on the spinner line for the whole 62-second turn. After: "Working…" throughout, with the retry warning still in the transcript; "Compacting the conversation" and Codex's "Running a command" still show. Screenshots are in the PR body.
  • Node typecheck, readiness checklist and all CI checks pass on d442497.

Not verified:

  • A real provider retry from Anthropic's servers; the live run used a stand-in that sends the same retry message.
  • The mobile app on a device (covered by its unit tests only).
  • Whether hosts older than September 6 are still supported; with those, the line would read "Working…" instead of the model's reasoning text, which is cosmetic.

@brennanb2025
brennanb2025 merged commit 3ab3c92 into main Sep 30, 2026
59 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant