fix(chat): keep assistant text visible across tool calls #14698
Completed turns can hide substantive assistant text inside “Worked for” when that text precedes the final response. Keep every assistant message outside the work fold on web/desktop and mobile, while preserving tool/reasoning folding and timing.
Rebuilt on current architecture from @maria-rcks’s original contribution, retaining the contributor’s history. The obsolete first-assistant bookkeeping is removed; no new helper or component is needed.
Verification#
- Existing suites: 267 → 267 tests across two files (168 web, 99 mobile). Updated existing behavior cases; no new test files or cases. The current-main implementation fails eight updated assertions; the rebuilt implementation passes all 267.
- Scoped lint, web/mobile typechecks, formatting and diff checks passed.
- Linux headless web: identical synthetic completed turn, viewport and scroll on actual main and rebuilt code. Opening and middle assistant text stay visible; expanding/collapsing “Worked for” still reveals/hides tool activity.
- This fixture verifies client rendering, not provider execution. A temporary local font was used because the headless environment lacked working system font rendering; it is absent from the change.
- macOS, Windows, Electron desktop, iOS and Android were not exercised. Native device access is disabled here. Mobile rendering, keyboard/safe-area behavior and native screenshots remain for a human.
- Two parallel adversarial review rounds completed. Round one found a lost resource-summary test branch; the existing fixture was corrected. Round two returned no findings.
- Draft retained: human approval is still required.
Before — main

After — rebuilt head

Models/harness: T3 Code with Codex gpt-6-astra (tests), Codex gpt-6.1-sol (implementation), Claude claude-opus-5-5 and Codex gpt-6-sol (independent review).
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge added labelsmacroscope-review
juliusmarminge assignedjuliusmarminge
Taking over this one. I’ll rebuild the assistant-text visibility fix against current main, keep work and reasoning folds intact on web and mobile, and leave the PR in draft pending approval.
Hello, in my t3 code when AI sends me a message during work and then finishes and sends last message, the previous disappear. This could be a fix. Can we merge it or include a setting to not fold into work for or to at least not auto collapse it?
I cannot tell you how many times I asked an agent something and then I am left confused they didn't answer, but they did and it is hidden in a Worked for block. Thanks.
Verified the assistant-visibility change from this PR in T3 Code's Browser panel on macOS, applied as the same two visibility guards on current main
78f1ba8.This covers the Codex steering display case reported in #8879. The persisted rendering fixture has one completed run containing prompt → steer → optimization answer → tradeoffs answer, with no tools or reasoning.
- On main, only the tradeoffs answer stays visible. Expanding “Worked for 56s” reveals the intact optimization table.
- With this change, both answers remain visible after a full reload. The empty work fold disappears.
I also ran the free
Replay (dev)showcase through the real adapter and orchestration, including its approval. Tools still expand and collapse under “Worked for”; the earlier assistant message and final answer stay visible throughout. Progress prose stays visible too, as intended by this approach.The two-answer case is a rendering fixture, not a fresh Codex execution. Native Electron, iOS and Android were not exercised, and I did not rerun this PR's full test suite. This supports the visibility fix; it is not a review of the entire PR.
Verified with GPT-6.1-Sol, high reasoning, through the Codex harness in T3 Code.
tanstack-source added labelsbug
@juliusmarminge this draft would have caught a real security warning that I missed.
Full details: https://github.com/pingdotgg/t3code/issues/8879#issuecomment-6948881352. In short, a Claude agent leaked my password into the session output, told me so mid-run, and that note folded under "Worked for …" with the rest of the run. The final reply only said "And again: please change that macOS password", so I didn't know what had happened until I asked.
That makes #8879 more than a readability problem. Agents report leaked credentials, destructive mistakes and risky actions in exactly these mid-run notes, and right now the UI hides them by default.
I checked current main (
25fada9351).deriveTurnFoldsstill keeps only the run's last assistant message visible, and none of the merged changes cover this.send_to_user(#36384) helps only when the model chooses to call it, and thefinal_answerexemption from #34501 is Codex-only. Keeping assistant messages out of the fold, as this PR does, is the only change I've seen that doesn't depend on the model.What's blocking this? If it's a design worry, such as long turns getting longer, I'd much rather scroll past a few extra progress notes than miss a warning like this one. I'm happy to test a rebased build on macOS desktop with Claude if that helps.
Drafted by Claude Opus 5.5 (Claude Code in T3 Code).
Note
Posted by Claude for the account owner.
+1 for this, or for a setting that turns the message fold off.
Our use: long Claude turns where the agent reports findings in several messages before the last one. Once the turn ends, only the last message stays in view and the earlier ones sit under "Worked for", so the reader misses them unless they know to expand that row.
send_to_user(#36384) helps, but only when the agent remembers to use it.We now run a small local patch with the same effect on our desktop builds (0.1.12-nightly.20261122.5098, macOS and Windows): assistant messages never enter the fold's hidden set, while tool calls still fold. A client setting such as "keep assistant messages visible" would let us drop the patch.
+1 for this. I keep hitting this issue, especially during grilling sessions with the question tool and its driving me nuts!
Sign in to join this conversation.
Thread transfer impact#
⚠️ The latest CI run did not produce a thread transfer result for
8fd403c.This comment will update automatically after the next completed run.