fix(tui): render CoT once per turn, stop clipping tool output (#415, #414)

The reasoning trace was rendered twice: once as its own "thinking" row on
inference.completed, and again as a ✼ block on the following tool row, whose
Reasoning was copied from Model.lastReasoning. The fallback branch was worse —
lastReasoning is current model state, so every tool row with no Reasoning of its
own (all non-diff rows, all snapshot-restored rows) got the newest trace stamped
on it retroactively. Drop the block, the copy, and the now-dead
RouterEntry.Reasoning / Model.lastReasoning; the standalone row already covers
tool turns.

actionToolText clipped every summary to 48 columns, which cut tool output and —
worse — harness coach text: read-before-write rejections, write blocks, gate
feedback, exactly the messages that say whether the agent was steered or
silently blocked. The action renderer already wraps to panel width, so the clip
was the only single-line ceiling; raise it to 4000 chars.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 23:46:25 +04:00
parent 45a9fe3369
commit 5ed8ebd0c5
5 changed files with 58 additions and 31 deletions
-5
View File
@@ -75,7 +75,6 @@ type RouterEntry struct {
Content string
Icon string // action role only: the gutter glyph (✓ ✎ ✗ ⌘ ✕ ⊞ ⊟)
Metrics *TurnMetrics
Reasoning string // model reasoning/CoT that preceded this entry (tool/artifact turns)
}
// TurnMetrics carries optional latency + token cost for a ROUTER chat turn.
@@ -442,10 +441,6 @@ type Model struct {
// (0 = tail-follow the newest output). PgUp/PgDn + ctrl+u/d move it; esc snaps back.
outputScroll int
// lastReasoning holds the model's reasoning/CoT trace from the most recent
// inference.completed, surfaced on the following tool-call and artifact rows.
lastReasoning string
// event-inspector filter (OverlayEventInspector): narrows the event list by a substring
// of type/detail. eventFilterTyping is true while the operator is editing the query after /.
eventFilter string