fix(web,mobile): keep substantive assistant prose outside the settled-turn fold #8075
main fromrefs/pull/8075/head·opened View on GitHubWhen a settled turn folds behind the "Worked for ..." row, every assistant message between the first and the terminal one is hidden, regardless of what it contains. The server mints a separate message per assistant stream segment (segments close at tool boundaries), so a model that interleaves real prose with tool calls gets the substance of its reply folded: write three paragraphs of analysis, run a tool, close with "Done", and the analysis is invisible until the fold is clicked. With reasoning-heavy models this happens on most turns, and users report the majority of a reply routinely hidden.
The middle of a turn is only sometimes narration. "Looking around first." should fold; a multi-paragraph explanation of the root cause should not. Since nothing in the data model distinguishes the two, this adds a small shared predicate, isFoldableAssistantNarration in @t3tools/client-runtime/state/turn-fold: a mid-turn assistant message folds only when it is a single block (no blank-line paragraph break) of at most 240 characters. Web and mobile both apply it, so the two surfaces keep agreeing on what a fold contains. Everything else is unchanged: tool and work rows still fold, the first and terminal messages stay visible as today, agent-spawn rows keep their escape, and the running turn is never folded.
One boundary I left alone: the copy button still appears only on the terminal message, because showAssistantMeta doubles as the row-spacing signal in the timeline and decoupling them is a layout change of its own.
Verification#
vp test run src/state/turnFold.test.tsinpackages/client-runtime: 6 passed (boundary at 240, paragraph breaks, whitespace-only)vp test run src/components/chat/MessagesTimeline.logic.test.tsinapps/web: 46 passed, including a new case asserting a long mid-turn message stays visible while tool rows still fold; the new case fails on mainvp test run src/lib/threadActivity.test.tsinapps/mobile: 20 passed, same new case for the mobile fold; also fails on maintsgo --noEmit: clean inapps/webandpackages/client-runtime;apps/mobileoutput byte-identical to the main baseline (pre-existing react-navigation noise only)- No existing test expectation changed; the short narration fixtures in the current fold tests still fold
Screenshots#
Same seeded thread, identical crops, collapsed state in both (the fold was never expanded). The turn is: "Looking around first." / tool run / two-paragraph analysis / tool run / "Done. The fix is batching the rebuild."
Before, the analysis is inside the fold:

After, the analysis renders; the tool rows are still behind "Worked for 18s":

Change made by Claude Opus via Claude Code.
Note
Low Risk Presentation-only fold heuristic on web and mobile; no auth, data, or protocol changes. Heuristic may still hide some mid-length single-paragraph answer text.
Overview Stops the settled-turn “Worked for …” fold from hiding real mid-turn answer text. Stream segments close at tool calls, so one reply is often several messages; previously everything between the first and last assistant message was folded.
Web and mobile now share isFoldableAssistantNarration: a mid-turn assistant message folds only if it is a single block of at most 240 characters. Longer or multi-paragraph chunks stay visible; tool/work rows, first/terminal messages, and running turns are unchanged.
Note
Keep substantive mid-turn assistant messages visible in settled-turn folds#
- Adds
isFoldableAssistantNarrationin turnFold.ts: an assistant message is foldable only if it is under 240 chars and contains no blank-line paragraph break. - Exposes this utility via the new
./state/turn-foldsubpath export in package.json. - Updates
deriveThreadFeedTurnFolds(threadActivity.ts) andderiveTurnFolds(MessagesTimeline.logic.ts) so mid-turn assistant messages that are not foldable narration stay visible instead of being hidden with other work entries. - Risk: any mid-turn assistant message shorter than
FOLDABLE_NARRATION_MAX_CHARSwith no paragraph break will still be folded; content that previously collapsed may now appear inline and change timeline scroll height.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
57238e2Macroscope's review found this PR approvable — This is a narrowly scoped settled-turn rendering fix: substantive assistant segments remain visible while short narration and work entries continue to fold. The only notable effect is potentially increased timeline height when previously hidden prose is displayed.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).I can reproduce the settled-turn folding behavior during an interactive interview flow.
The affected turn contains multiple assistant outputs: first a substantive Markdown question round, then a shorter progress/status or follow-up message. Once the turn settles, the UI keeps the last assistant entry visible and folds the earlier assistant output into the work section. As a result, the question list appears to be missing even though it was emitted and persisted normally.
Asking the agent to repeat the questions as plain text makes them visible because the repeated response is the terminal assistant output of a new turn. This suggests the issue is related to settled-turn folding and terminal-message selection, rather than question generation or data loss.
This appears to be another instance of the existing issue where substantive assistant prose is hidden when a turn ends with a shorter progress message. Keeping substantive assistant messages visible while folding only work/progress entries would address this case as well.
closing this version as part of a pr cleanup at the request of @StiensWout.
a 240-character cutoff and paragraph breaks cannot reliably distinguish progress narration from substantive assistant output. short but important answers still get folded. a replacement should preserve assistant prose or use explicit metadata to identify progress messages, rather than infer importance from length.
thanks for the contribution. if you disagree with this decision, you are welcome to open a new pr, link back to this one, and explain how your proposal addresses these concerns or why a different approach is warranted.
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
df1ec92a-471c-486c-b828-48aec306cba3You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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