Skip to content

fix: fall back to reasoningText in the compacted Copilot transcript builder - #2298

Open
suhaanthayyil wants to merge 1 commit into
mainfrom
fix/copilot-compact-reasoning-text-fallback
Open

fix: fall back to reasoningText in the compacted Copilot transcript builder#2298
suhaanthayyil wants to merge 1 commit into
mainfrom
fix/copilot-compact-reasoning-text-fallback

Conversation

@suhaanthayyil

@suhaanthayyil suhaanthayyil commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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

Summary

Evidence

  • Real fixture (`testdata/copilot_full.jsonl`) line 7 has a real `reasoningText` value with empty `content`.
  • Before: compacted output drops the text block entirely.
  • After: recovers "Simple task - create a directory and an markdown file inside it." verbatim.
  • Golden fixture (`copilot_expected.jsonl`) regenerated and diffed — exactly 1 line changed.
  • Regression guards: content-populated case unaffected; empty-content-with-no-reasoningText case still produces no spurious text block.

Test plan

  • `go test ./cmd/entire/cli/transcript/... -race` — 147 passed, 3 packages.
  • `mise run fmt`/`mise run lint` clean.

…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.
Copilot AI lite review requested due to automatic review settings September 7, 2026 03:18
@suhaanthayyil
suhaanthayyil requested a review from a team as a code owner September 7, 2026 03:18

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.

🟢 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 reasoningText support to the Copilot assistant event struct and fall back to it when content is 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.

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