Skip to content

fix(native-chat): drop blank rows left by mid-turn NO_REPLY answers - #52568

Merged
nwparker merged 1 commit into
stablyai:mainfrom
chrobson:fix/native-chat-hide-empty-no-reply-rows
Nov 29, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
chrobson:fix/native-chat-hide-empty-no-reply-rows

Conversation

@chrobson

@chrobson chrobson commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When a bot has nothing to say partway through a task, it sends a hidden "no reply" signal. The chat already hid that text, but it still kept an empty row for it. The empty row cut the list of commands into pieces and left stray Copy / "..." buttons. Now those empty rows are skipped, so the bot's work shows as one group.

What Changed

  • Before: in a bot chat, an assistant message that is only the quiet marker (\n\nNO_REPLY) got its own transcript row. The prose stripped the marker, so the row was blank, but it still took a slot, held the turn's Copy / "..." controls and split the tool run. A working turn of build, NO_REPLY, test, NO_REPLY, lint drew as separate runs with "Nothing to report" between them, on desktop and mobile.
  • After: the same turn draws as one "Running 3 commands" run. A settled turn that neither acted nor came from an automation keeps one "Nothing to report" on its last marker. Acting turns show only their "Worked for" bar.
  • Mechanism:
    • A shared rule, nativeChatUndrawnQuietAnswers (src/shared/native-chat/transcript/turns/native-chat-quiet-turns.ts), uses the anchored isOnlyQuietBotMarker check to find marker-only answers that draw nothing. Answers with tools, images or tasks don't count as marker-only. The result is cached per message.
    • The "Nothing to report" rule now lives in one helper, quietBotSaysNothingToReport (src/shared/bot-quiet-result.ts). quietBotAnswer and the new rule both call it.
    • Desktop: buildNativeChatTranscript gives undrawn answers no slot, so they don't split work runs or set the trailing-run frontier. This applies only in bot chats and group-room turns (botAnswers). The streamed-slot patcher rebuilds when a row becomes marker-only or stops being marker-only.
    • Mobile: useMobileNativeChatQuietAnswers (memoized) and MobileBotGroupTurns apply the same rule. Undrawn rows keep only their turn bar and don't split runs.
    • Turn folding, the side-chat fork point and the newest-response pin still count the hidden answers, as main does. So a turn that ends in a hidden NO_REPLY still forks through that turn, and the previous turn's reply doesn't take the pin.

Why

The stored text isn't empty, so the row got past transcript filtering. The marker was stripped only at render time. Row placement read the raw blocks, while the prose read the quiet-stripped words, so the two disagreed. Returning null from the row would still leave the slot, the split run and the Copy holder. Filtering in the generic projection can't tell bot chats from ordinary chats, and ordinary chats should still show NO_REPLY as written. Making the decision where rows are grouped keeps placement and rendering consistent, for desktop and mobile alike.

Linked Issue

Fixes #52493

Visual Proof

The same working bot turn, rendered through the real slot builder and row stack in a headless fixture (dark theme):

Before After
Before: commands split by Nothing to report rows After: one Running 3 commands run

Testing

  • Reproduced on main: the new native-chat-transcript-slots.test.ts fails there. The live turn drew ask | build | wait-1 | test | wait-2 instead of [ask], [build, test]. On this branch it passes.

  • New tests:

    • Desktop slots: live and settled turns, fork point and newest-response pin, folding, and streamed rebuild when a row becomes NO_REPLY.
    • Shared rule: native-chat-quiet-turns.test.ts.
    • Marker forms: bot-quiet-result.test.ts.
    • Mobile hook: use-mobile-native-chat-quiet-answers.test.tsx.
  • Targeted vitest on the squashed commit:

    • Desktop native-chat slots, messages, bots and shared quiet rules: 80 files, 392 passed.
    • Mobile turn-state and bots: 21 files, 76 passed.
  • oxlint, oxfmt, the anti-slop and code-quality native plugin lint configs, ast-grep and the changed-code quality gate are clean on all 20 files.

  • Tested on macOS with unit tests and a headless fixture render. I didn't run it in a live Electron session.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

No measurable cost on any hot path. Timings are medians of buildNativeChatTranscript runs, main vs branch:

  • Non-bot chats: no change.
  • Bot chats, N=200: 0.22-0.26 ms vs 0.24-0.26 ms.
  • Bot chats, N=2000: 2.2-2.4 ms vs 2.3-2.4 ms.
  • Adversarial N=200 rows of 100 KB each: 0.76-0.86 ms vs 0.77-0.80 ms, because the per-message cache avoids re-checking rows.
  • The anchored marker check runs on every streamed frame and costs a flat ~0.03 us per call, even for a 500 KB row.
  • Fanout: at N=200 with one changed row, there is one marker check per update, for the changed row only. Per-update cost doesn't grow with N.
  • The memoized mobile hook keeps row props stable, so other rows don't re-render.
  • No new I/O, IPC, timers, polling or subprocesses.

Risk

This only affects bot chats and group rooms, and only answers that are just the marker. Other agents' transcripts are unchanged (botAnswers is false there). Visible trade-offs:

  • Repeated "Nothing to report" lines collapse to one per settled turn.
  • When the latest turn's only reply is a hidden marker, that turn has no per-row Copy / "..." / Fork, the same as a tools-only turn. The side chat still forks through that turn.
  • Mobile group rooms now hide marker-only answers in acting turns, which matches desktop.

To back it out, revert the commit. Nothing is stored or migrated.

Level: Low

Review

  • Cross-platform: display logic only, with no OS-specific code. Desktop and mobile share one rule from src/shared.
  • SSH/remote and older paired clients: no transport or protocol change. The rule runs on rows already received.
  • Agents: depends only on the existing NO_REPLY grammar.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Original fix by chrobson. Maintainer follow-ups:

  • Kept the side-chat fork point and the newest-response pin.
  • Left turn folding as on main.
  • Added the per-message cache and the anchored marker check.
  • Memoized the mobile hook.
  • Gave the "Nothing to report" rule one home.

Related: #46310 (generic empty-message filtering), #48444.

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)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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)

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issue was found.

Summary

Removes marker-only bot answers from desktop and mobile chat layouts while keeping the settled “Nothing to report” case.

  • Bot chat pauses no longer leave blank transcript rows.
  • Mobile bot pauses no longer leave blank transcript rows.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Bot answer] --> B{Only the quiet marker?}
  B -- No --> C[Draw normally]
  B -- Yes --> D{Keep Nothing to report?}
  D -- Yes --> E[Draw the settled quiet answer]
  D -- No --> F[Hide the answer row]
  F --> G[Keep command runs joined]
  F --> H[Keep turn bars and fork choices]
Loading

Reviews (4) · Last reviewed commit: "fix(native-chat): drop blank rows left b..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change adds shared detection for assistant messages containing only the quiet marker. Renderer and mobile transcript paths use turn state and bot-answer status to omit qualifying rows while accounting for them in grouping, folding, and fork-point calculations. Tests cover marker formatting and transcript behavior in working and settled turns.

Severity of issue fixed: Medium

Merge Risk: Low · up to 417a7

Marker-only answers are now hidden in bot chats and group turns, and the live command run keeps its progress state. Two narrow cases can still show a stray "Nothing to report" or marker row: a marker followed by a visible answer in the same turn, and a marker-only peer answer in group turns. These are minor visual issues and are worth fixing before or soon after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: blank transcript rows left by mid-turn NO_REPLY answers are dropped. It follows the fix(native-chat) convention and matches the changeset, which adds undrawn quiet-ans…
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #52493), Visual Proof (before/after images), Testing with checklist, Performance, Risk with…
Linked Issues check Passed [#52493] Requirement: in bot chats, a mid-turn assistant row whose text is only NO_REPLY must not render as a blank row, must not keep Copy or "..." controls, and must not split adjacent tool-call run…
Out of Scope Changes check Passed All listed changes connect to the #52493 objective or support it.
- Shared rule and predicates (native-chat-quiet-turns.ts, bot-quiet-result.ts): core undrawn detection.
- Desktop slot builder, input …
Full details: Title check

Explanation

The title names the main change: blank transcript rows left by mid-turn NO_REPLY answers are dropped. It follows the fix(native-chat) convention and matches the changeset, which adds undrawn quiet-answer detection across shared, desktop, and mobile code. It is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #52493), Visual Proof (before/after images), Testing with checklist, Performance, Risk with level Low, AI Disclosure, Review, upstream boundary, Notes, and Checklist. It explains the mechanism and the alternatives considered, and it states the revert path. Minor gaps: the Testing section says manual testing was not run in a live Electron session, yet the manual-test box is unchecked, so this is consistent but worth confirming. The Visual Proof section relies on a fixture rather than a live session, which the author discloses.

Full details: Linked Issues check

Explanation

[#52493] Requirement: in bot chats, a mid-turn assistant row whose text is only NO_REPLY must not render as a blank row, must not keep Copy or "..." controls, and must not split adjacent tool-call runs.

Evidence from the whole-PR change summary (merge base 4468f63 to head 417a704):

  • src/shared/bot-quiet-result.ts adds isOnlyQuietBotMarker and quietBotSaysNothingToReport. The second returns true only when the row is in neither an automation turn nor an acting turn.
  • src/shared/native-chat/transcript/turns/native-chat-quiet-turns.ts adds nativeChatUndrawnQuietAnswers. It marks assistant rows as undrawn when their markdown is only the marker and they have no images, tools, subagent groups, or background tasks. It keeps the last marker-only row of a settled turn that neither acted nor came from automation, which preserves the "Nothing to report" case that the issue's nothingToReport condition implies.
  • Desktop: native-chat-undrawn-quiet-answers.ts and native-chat-transcript-slots.ts give undrawn rows no slot when botAnswers is set. BotGroupTurn.tsx sets botAnswers to true, so group-room turns are covered. native-chat-transcript-streamed-slots.ts includes the marker-only fact in drawnFacts, so rows that change state rebuild.
  • Trailing-run frontier: the latest change excludes undrawn rows from the trailing speaking or acting search on desktop and mobile. The live indicator therefore stays on the visible command run.
  • Mobile: useMobileNativeChatQuietAnswers supplies undrawnRows. use-mobile-native-chat-transcript-rows.ts excludes them from work-run drawing and activity joins. use-mobile-native-chat-turn-disclosure.ts marks them folded away. MobileBotGroupTurns.tsx excludes them for group turns.
  • Turn folding: nativeChatTurnFoldRow with undrawn=true reads the row as empty, so it cannot become the turn answer.
  • Tests: native-chat-transcript-slots.test.ts covers the live turn (one run, no marker slots) and the settled turn (last marker kept). The mobile quiet-answers test covers the bot-chat undrawn case and the non-bot case. native-chat-quiet-turns.test.ts and bot-quiet-result.test.ts cover the shared rule.

Uncertainty: the mobile path and the streamed patcher were assessed from the change summary, not from full source reads. The summary does not name a new desktop test for the trailing-frontier fix, but the mobile test and the slot tests cover the live-turn behavior. No unmet coding requirement is identified.

Full details: Out of Scope Changes check

Explanation

All listed changes connect to the #52493 objective or support it.

  • Shared rule and predicates (native-chat-quiet-turns.ts, bot-quiet-result.ts): core undrawn detection.
  • Desktop slot builder, input flag (botAnswers), undrawn-answer helper, streamed patcher, useNativeChatTranscriptSlots wiring, BotGroupTurn.tsx: apply the rule to desktop bot and group-room transcripts.
  • Mobile hooks and turn-state files (use-mobile-native-chat-quiet-answers.ts, use-mobile-native-chat-transcript-rows.ts, use-mobile-native-chat-turn-disclosure.ts, MobileBotGroupTurns.tsx): apply the same rule on mobile.
  • native-chat-turn-fold.ts: reads undrawn rows as empty. This follows from hiding them.
  • Trailing-run frontier change (desktop and mobile): keeps the live indicator correct once undrawn rows are hidden.
  • native-chat-bot-answer-context.ts, NativeChatAssistantMessageRow.tsx: provide one bot-chat signal (useNativeChatBotAnswers) for the rule. This is a supporting refactor.
  • native-chat-side-chat-fork-point.ts: narrows parameter types so the slot builder can pass partial slots. Behavior is unchanged. This is a supporting change.
  • NativeChatQuietAnswerRow.fixture.tsx: removes the acted argument that no longer applies. This is a supporting fixture update.
  • Test files: test the new behavior.

No change was found that is unrelated to bot chats, group rooms, or quiet-marker rows. Non-bot transcripts keep botAnswers false and draw as written.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Exclude blank marker rows when choosing the… · native-chat-transcript-slots.ts:159-161

src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts:159-161
Minor · Functional Correctness · Quick win

Exclude blank marker rows when choosing the trailing-run frontier.

The trailing-run selector runs before blank quiet answers are removed. A suppressed NO_REPLY row still has its marker text, so nativeChatRowRendersProse reports prose. The row then becomes trailingRunIndex, but its slot is never drawn. No visible row receives trailingRun=true. The preceding command run gets trailingRun=false, and its header loses its live state while the turn is still working. The live state returns when the turn settles.

Compute the frontier after the blank set exists, and skip blank rows:

Suggested fix

   const { quiet, leaving, messages } = nativeChatShownRows(input, settledTurnKeys, imageSources)
-  // Liveness follows the turn frontier, not a call’s stale running flag.
-  const trailingRunIndex = messages.findLastIndex((message) =>
-    nativeChatRowSpeaksOrActs(message, nativeChatRowRendersProse(message), receipts)
-  )
   const automationTurns = nativeChatAutomationTurnKeys(messages, turnKeys)
   const actingTurns = nativeChatActingTurnKeys(messages, turnKeys)
   const workingRows = messages.map((message, index) =>
     isNativeChatRowInLiveWorkingTurn(
       turnKeys[index],
       liveTurnKey,
       isWorking || lifecycleWorking,
       unresolvedRowIds?.has(message.id)
     )
   )
   const blank = nativeChatBlankQuietAnswers(input, messages, {
     automationTurns,
     actingTurns,
     workingRows
   })
+  // Liveness follows the turn frontier, not a call’s stale running flag.
+  // A blank marker row draws no slot, so it cannot hold the frontier.
+  const trailingRunIndex = messages.findLastIndex(
+    (message, index) =>
+      !blank.has(index) &&
+      nativeChatRowSpeaksOrActs(message, nativeChatRowRendersProse(message), receipts)
+  )
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48e4d677-6173-4165-9cf8-c55deb7fee04
Commits

Reviewing files that changed from the base of the PR and between cc18af5 and e331efa.

Files selected for processing: 17

  • mobile/src/bots/MobileBotGroupTurns.tsx
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-quiet-answers.ts
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-transcript-rows.ts
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-turn-disclosure.ts
  • src/renderer/src/components/bots/BotGroupTurn.tsx
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-blank-quiet-answers.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-input.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-streamed-slots.ts
  • src/renderer/src/components/native-chat/conversation/slots/use-native-chat-transcript-slots.ts
  • src/renderer/src/components/native-chat/messages/rows/NativeChatAssistantMessageRow.tsx
  • src/renderer/src/components/native-chat/messages/rows/NativeChatQuietAnswerRow.fixture.tsx
  • src/renderer/src/components/native-chat/messages/rows/native-chat-bot-answer-context.ts
  • src/shared/bot-quiet-result.ts
  • src/shared/native-chat/transcript/folding/native-chat-turn-fold.ts
  • src/shared/native-chat/transcript/turns/native-chat-quiet-turns.ts

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

@chrobson

Copy link
Copy Markdown
Contributor Author

Thanks @coderabbitai, the live-indicator note was real. When a working turn ended on a hidden NO_REPLY, the trailing-run frontier still pointed at that undrawn row, so the visible command run read as settled. Fixed in the latest commit on desktop and mobile by skipping undrawn answers when picking the frontier, plus a test that fails without it.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@chrobson Thanks for fixing the live-indicator issue on desktop and mobile, and for adding a regression test.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

A bot answer that is only the quiet NO_REPLY marker drew nothing, because
the prose strips the marker, but row placement read the raw blocks. The
answer still took a transcript slot with Copy / ... controls and split the
turn's tool run into pieces, on desktop and mobile.

A shared rule, nativeChatUndrawnQuietAnswers, now finds marker-only answers
that draw nothing. A settled turn that neither acted nor came from an
automation keeps its last marker as "Nothing to report"; every other
marker-only answer is undrawn. Desktop slots, work runs, the trailing run
and mobile rows skip undrawn answers, while turn folding, the side-chat
fork point and the newest-response pin still count them, as on main.

Fixes stablyai#52493

Co-authored-by: Mateusz Chrobak <[email protected]>
@nwparker
nwparker force-pushed the fix/native-chat-hide-empty-no-reply-rows branch from 96335e3 to 417a704 Compare November 29, 2026 18:41

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 279e0731-4191-44ea-a276-e368f4122098
Commits

Reviewing files that changed from the base of the PR and between 96335e3 and 417a704.

Files selected for processing: 12

  • mobile/src/bots/MobileBotGroupTurns.tsx
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-quiet-answers.test.tsx
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-quiet-answers.ts
  • mobile/src/session/native-chat/transcript/turn-state/use-mobile-native-chat-transcript-rows.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-undrawn-quiet-answers.ts
  • src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.ts
  • src/shared/bot-quiet-result.test.ts
  • src/shared/bot-quiet-result.ts
  • src/shared/native-chat/transcript/turns/native-chat-quiet-turns.test.ts
  • src/shared/native-chat/transcript/turns/native-chat-quiet-turns.ts

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

() =>
withBotGroupTurnAnswer(
messages.filter((_, index) => !fold.foldedRows.has(index)),
messages.filter((_, index) => !fold.foldedRows.has(index) && !undrawn.has(index)),

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.

Minor · Functional Correctness · Quick win

Marker-only peer answers still draw a row in group turns.

When a member answers a peer request with only NO_REPLY, saveGroupPeerAnswer stores that marker as turn.answer. withBotGroupTurnAnswer then appends it as a text row. This row is added after the undrawn filter at MobileBotGroupTurns.tsx:203-210, so the row is drawn even though the rule for this PR says marker-only answers get no transcript slot.

The required behavior is that a marker-only answer draws nothing. Apply the quiet-marker rule where turn.answer becomes a row: strip the marker the way botGroupTurnReplyText does for reply, and add no row when no words remain. Apply the same rule on the desktop path that uses withBotGroupTurnAnswer.

if (markerOnly.length === 0) {
return NO_ROWS
}
const lastByTurn = new Map(markerOnly.map((index) => [turnKeys[index], index]))

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.

Minor · Functional Correctness · Quick win

Do not keep an intermediate marker beside a later visible answer.

For a settled, non-acting turn with rows [NO_REPLY, "Here is the result."], the marker-only selection keeps the NO_REPLY row. The visible answer is not considered when the final row is chosen, so the marker draws as "Nothing to report" beside the actual answer.

Retain a marker only when it is the turn's final answer, meaning no visible answer follows it in that turn. Choose the final answer from the turn's visible answers, not from marker-only rows alone. A marker followed by a visible answer takes no transcript slot, as other marker-only answers do. Keep the final marker of a turn with no later visible answer, including the [NO_REPLY, tool, NO_REPLY] case.

@nwparker
nwparker merged commit bb06913 into stablyai:main Nov 29, 2026
59 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.

[Bug]: Mid-turn NO_REPLY assistant messages render as blank rows with orphaned Copy / "..." controls

2 participants