cmux NEXT: a thought dates its first and latest chunk

Merged
TE
19d ago
+52-7

A thought in the agent transcript now records when its first chunk arrived (startedAt) and when its latest one did (endedAt), taken from each chunk's event time. appendThought sets both. The parent transcript (direct.ts) and a subagent's own view (childRows.ts) pass the time through. Nothing draws these fields yet. They're what a folded thought needs to read "Thought for 12s", which comes in a later slice of #20963.

The gallery fixture's thought() also takes optional fields, so later gallery plays can build a dated thought.

Testing

  • bun test src/agent-session/acpmux/thoughtTiming.test.ts: 4 pass. They cover a first chunk dating start and end, a later chunk moving only the end, a thought after a tool call starting its own clock, an undated chunk leaving dates alone, and a subagent's thought dated from its events.
  • bun run check in webviews/ passes: lint, types, format, layers, type scale and protocol codegen.
  • bun test src/agent-session/acpmux: 51 pass, 1 fail. The failure is iconPack.test.ts ("icon pack out of date"). It comes from this Linux checkout's sparse tree, and this change doesn't touch icons.

Changelog

none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Records the arrival time of a thought's first and latest chunk so a folded thought can later display "Thought for 12s" (part of #20963). appendThought now sets startedAt on a thought's first chunk and endedAt on each later chunk, using each chunk's event time; the parent transcript, subagent view, and gallery fixture thread that time through. Nothing renders these fields yet.