fix(chat): keep the full agent trace visible in history and never end a turn without a summary#160
Merged
Merged
Conversation
… a turn without a summary Persisted transcripts hid every intermediate iteration: only the final assistant row was visible, so a turn that burned all 8 iterations on tool calls showed the literal '[tool calls]' placeholder as its entire answer, and the graceful-close wrap could return zero content without erroring (observed on staging) leaving no summary at all. - buildTraceRows: every assistant iteration row is now visible (internal=false); tool_result payload rows stay internal. Token and model columns still land only on the final row - graceful close: the tools-disabled wrap now carries an explicit summarize instruction appended after the tool_result blocks (message replaced, not mutated — the trace keeps only the real tool results); if the wrap still returns no text, a deterministic fallback summary built from the executed tool names streams to the client and lands as the final trace iteration - messages endpoint: projection gains turn_id; limit 100 → 300 since heavy turns now surface up to ~10 visible rows instead of 2 - loadConversation folds consecutive same-turn assistant rows into one message whose segments concatenate chronologically; legacy rows with distinct turn ids keep one message per row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #159 (2/2). Persisted transcripts hid every intermediate iteration: only the final assistant row was `internal=false`, so a turn that burned all 8 iterations on tool calls showed the literal `[tool calls]` placeholder as its entire answer on reload (verified on staging, conversation `8ad2bba3…`). The graceful-close wrap could also return zero content without erroring — no error in Railway logs, no summary in the trace.
Changes
Documented side effect: the ee Conversation API `/history.get` uses the same default visibility filter, so intermediate assistant rows now appear there too (additive). Existing conversations are not backfilled — old turns keep their previous single-row rendering.
Test
🤖 Generated with Claude Code