Skip to content

Compact external agent transcripts for --full/--verbose display#1421

Open
blackgirlbytes wants to merge 5 commits into
mainfrom
external-agent-transcript-display
Open

Compact external agent transcripts for --full/--verbose display#1421
blackgirlbytes wants to merge 5 commits into
mainfrom
external-agent-transcript-display

Conversation

@blackgirlbytes

@blackgirlbytes blackgirlbytes commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/561

What

entire checkpoint explain --full / --verbose rendered "(failed to parse transcript)" for external agents (goose, amp): the transcript display path only tries built-in agent parsers and stored compact JSONL, and never asks the external agent binary to convert its native transcript — unlike the summary path, which already routes through CompactTranscript.

This runs stored external-agent transcripts through the same compaction before the transcript section renders, in both the committed-checkpoint path and the temporary-checkpoint path. maybeCompactExternalTranscriptForSummary is renamed to maybeCompactExternalTranscript to reflect the second caller. The helper is a no-op for transcripts the built-in parsers already understand, and returns input unchanged when no compactor is available — so built-in agents are unaffected.

Why

External agents that declare compact_transcript (amp, and now goose via entireio/external-agents#39) store transcripts in their native format. Summaries work because the summary path compacts; the display path was left behind, so the documented --full ("Parsed full transcript — all prompts/responses from entire session") shows a parse failure instead of the conversation.

Testing

  • go test ./cmd/entire/cli -run 'Compact|Transcript|Explain' passes
  • Manually verified against a real goose checkpoint: before — "(failed to parse transcript)"; after — full conversation renders ([User]/[Assistant] turns + [Tool] calls)

Related

🤖 Generated with Claude Code

External agents store transcripts in their native format, which the
display parsers (built-in agent formats + stored compact JSONL) can't
read, so `entire checkpoint explain --full` rendered
"(failed to parse transcript)" for goose/amp checkpoints while the
summary path — which already compacts through the agent binary —
worked. Run the stored transcript through the same compaction before
the transcript section renders, in both the committed-checkpoint and
temporary-checkpoint paths. Renamed maybeCompactExternalTranscriptForSummary
to maybeCompactExternalTranscript to reflect the second caller.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 2c750bc8d0d3
Copilot AI review requested due to automatic review settings June 11, 2026 16:03
@blackgirlbytes blackgirlbytes requested a review from a team as a code owner June 11, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes entire checkpoint explain --full/--verbose for external agents (e.g., amp/goose) by routing stored native transcripts through the external agent’s compact-transcript capability so the transcript rendering pipeline can parse and display the conversation.

Changes:

  • Compact external-agent transcripts before transcript rendering for committed checkpoints when --full/--verbose is used.
  • Reuse the same compaction helper for summary generation and transcript display (maybeCompactExternalTranscript rename + new call sites).
  • Apply the same compaction behavior in the temporary-checkpoint explain path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmd/entire/cli/explain.go Adds external transcript compaction to the --full/--verbose transcript rendering paths; renames helper for shared use.
cmd/entire/cli/explain_test.go Updates helper invocation in the existing external-compaction redaction test.
Comments suppressed due to low confidence (2)

cmd/entire/cli/explain.go:963

  • maybeCompactExternalTranscript is now used for transcript display as well as summary generation, but the temp file pattern and debug log messages inside the helper still refer specifically to “summary”. This makes logs harder to interpret when compaction is triggered by --full/--verbose rendering.

Consider renaming these strings (and the temp file pattern) to be transcript-display/compaction generic (e.g., "entire-compact-transcript-*" and "external transcript compaction …").

func maybeCompactExternalTranscript(ctx context.Context, scopedTranscript []byte, agentType types.AgentType) []byte {
	if transcriptHasSummaryContent(scopedTranscript, agentType) {
		return scopedTranscript
	}

cmd/entire/cli/explain_test.go:900

  • The existing external-compaction test only asserts redaction. Since the helper is now also relied on to make --full/--verbose transcript rendering parseable for external agents, add an assertion that the compacted bytes can actually be rendered by the transcript display path (i.e., formatTranscriptBytes should not return "(failed to parse transcript)" and should contain formatted turns like "[User]").
	got := maybeCompactExternalTranscript(ctx, []byte("not-json"), kind)
	if strings.Contains(string(got), secret) {
		t.Fatalf("external compact transcript was not redacted: %s", got)
	}
	if !strings.Contains(string(got), redact.RedactedPlaceholder) {
		t.Fatalf("expected redacted compact transcript, got: %s", got)
	}

Comment thread cmd/entire/cli/explain.go Outdated
Comment thread cmd/entire/cli/explain.go Outdated
blackgirlbytes and others added 4 commits June 11, 2026 12:19
CheckpointTranscriptStart indexes the originally stored transcript, but
compaction changes line counts (streaming fragments merge into fewer
JSONL lines), so compacting before scopeTranscriptForCheckpoint could
produce an empty or wrong checkpoint-scope view. Compute the scoped
slice on native bytes inside formatCheckpointOutput, then compact only
the bytes being displayed — matching the temporary-checkpoint path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
appendTranscriptSection renders fullTranscript in full mode and
scopedTranscript in verbose mode (full wins when both are set, and
verbose is true whenever --short isn't). Compacting the other variant
spawned an extra external-agent invocation and temp-file IO with no
output effect, in both the temporary- and committed-checkpoint paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants