Compact external agent transcripts for --full/--verbose display#1421
Open
blackgirlbytes wants to merge 5 commits into
Open
Compact external agent transcripts for --full/--verbose display#1421blackgirlbytes wants to merge 5 commits into
blackgirlbytes wants to merge 5 commits into
Conversation
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
Contributor
There was a problem hiding this comment.
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/--verboseis used. - Reuse the same compaction helper for summary generation and transcript display (
maybeCompactExternalTranscriptrename + 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)
}
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>
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.
https://entire.io/gh/entireio/cli/trails/561
What
entire checkpoint explain --full/--verboserendered "(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 throughCompactTranscript.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.
maybeCompactExternalTranscriptForSummaryis renamed tomaybeCompactExternalTranscriptto 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'passesRelated
🤖 Generated with Claude Code