pingdotgg / pingdotgg/t3code

Turn folding hides the substantive answer when a provider ends a turn with a short progress note (Grok)

Open
#8,879 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Summary

deriveTurnFolds keeps exactly one entry visible per settled turn — the last assistant message, per deriveTerminalAssistantMessageIds. With providers that interleave short progress commentary with the actual answer, the last message of a turn is frequently a one-line "now I'll check X" note, so the real answer is folded away under Worked for Ns and the visible remainder is a fragment that reads like a non sequitur.

This is not the "collapse noisy tool calls" case the fold is designed for: the folded content is the response itself.

Environment
  • Server t3@0.0.33 (headless t3 serve, Linux x64, Bun runtime)
  • Desktop client T3Code(Alpha)/0.0.33, Electron 41.5.0, macOS
  • Provider: Grok Build 1.0.4 (ACP over grok agent stdio), model grok-4.6
What happens

A Grok turn emits assistant messages as separate segments (assistant:…:segment:N) interleaved with tool calls. The turn commonly ends on a progress note rather than on the answer, e.g. turn a210c1f8:

segment time length content
segment:5 10:07:34 3178 chars the actual answer
segment:6 10:10:12 146 chars a progress note ("looks like a shared session — checking where live dev redirects to")

segment:6 is the terminal message, so it stays visible; segment:5 is hidden behind Worked for ….

How common

One thread, 108 messages, 68 assistant messages across 36 turns. 19 turns had more than one assistant message; in 18 of those 19 the last message was not the longest. Terminal notes clustered at 77–146 chars while the answers they hid ran to 3178 chars.

Turn size distribution: 17 turns × 1 message, 14 × 2, 3 × 3, 1 × 5, 1 × 9.

Expected

The visible entry after folding should be the turn's substantive response. Folding should not be able to hide every assistant message that carries the answer.

Code

apps/web/src/components/chat/MessagesTimeline.logic.ts

  • deriveTerminalAssistantMessageIdslastAssistantMessageIdByResponseKey.set(responseKey, message.id) on every assistant message, so the winner is positional: whichever message came last.
  • deriveTurnFolds — everything in the group except terminalEntry goes into hiddenEntryIds (only work entries with agentSpawn are exempt).

apps/mobile/src/lib/threadActivity.ts appears to carry the same rule, so mobile is affected identically.

Possible directions
  1. Keep all assistant messages visible and fold only work entries — the fold then does what its docstring says ("commentary and tool activity") without depending on which message happens to be last.
  2. Treat a trailing assistant message that is immediately followed by tool activity as commentary rather than as the terminal message.
  3. Pick the terminal message by content rather than position.

Option 1 is the smallest change and does not need heuristics.

Notes

Reproduced against a live grok agent stdio session; the segmentation is the provider's normal output shape, not an error path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with deriveTerminalAssistantMessageIds and deriveTurnFolds in apps/web/src/components/chat/MessagesTimeline.logic.ts, then compare the matching rule in apps/mobile/src/lib/threadActivity.ts. Reproduce a turn with multiple assistant segments and tool activity, and verify that folding no longer hides the substantive assistant response while still folding the intended work entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.