fix: fall back to reasoningText in the compacted Copilot transcript builder - #2298
Open
suhaanthayyil wants to merge 1 commit into
Open
fix: fall back to reasoningText in the compacted Copilot transcript builder#2298suhaanthayyil wants to merge 1 commit into
suhaanthayyil wants to merge 1 commit into
Conversation
…nt is empty copilotAssistantLine in transcript/compact/copilot.go only read the assistant.message event's "content" field. Some Copilot CLI sessions emit an empty content with the only displayable text in "reasoningText" (verified against testdata/copilot_full.jsonl raw line 7, whose reasoningText was silently dropped from the compacted transcript.jsonl). This is the same class of bug already fixed for the CLI-side extraction path in cmd/entire/cli/agent/copilotcli/transcript.go (#1070), but in the compact-transcript-building pipeline's own struct and parsing code. Fall back to reasoningText when content is empty; content still takes precedence when populated. Adds ReasoningText to copilotAssistantData and regenerates testdata/copilot_expected.jsonl's affected line from the real compactCopilot output.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, well-scoped to the compact Copilot transcript path, and is backed by both golden fixture coverage and targeted regression tests.
Pull request overview
This PR fixes a gap in the Copilot CLI compact-transcript builder so assistant text is not silently dropped when data.content is empty but data.reasoningText is present, ensuring transcript.jsonl stored in checkpoints preserves the human-readable assistant message.
Changes:
- Add
reasoningTextsupport to the Copilot assistant event struct and fall back to it whencontentis empty. - Update the Copilot compacted transcript golden fixture to include the recovered assistant text block.
- Add focused regression tests covering reasoningText fallback behavior and precedence rules.
File summaries
| File | Description |
|---|---|
| cmd/entire/cli/transcript/compact/copilot.go | Falls back from empty assistant content to reasoningText when building compacted transcript lines. |
| cmd/entire/cli/transcript/compact/copilot_test.go | Adds regression tests for reasoningText fallback, precedence over content, and no-spurious-text behavior. |
| cmd/entire/cli/transcript/compact/testdata/copilot_expected.jsonl | Updates expected compacted output to include the recovered assistant text block. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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/1248
Summary
Evidence
Test plan