Skip to content

fix: fall back to transformedContent/reasoningText when Copilot CLI content is empty - #2296

Open
suhaanthayyil wants to merge 1 commit into
mainfrom
fix/1070-copilot-empty-transcript-fallback
Open

suhaanthayyil wants to merge 1 commit into
mainfrom
fix/1070-copilot-empty-transcript-fallback

Conversation

@suhaanthayyil

@suhaanthayyil suhaanthayyil commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

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

Summary

  • Copilot CLI sessions captured checkpoints fine, but the transcript detail view was empty/incomplete: Entire's extraction only read the primary `content` field of user/assistant message events, with no fallback for when Copilot CLI populates `transformedContent`/`reasoningText` instead.
  • Prompts now fall back to `transformedContent` (stripped of Copilot's injected wrapper blocks); summaries fall back to `reasoningText`. Populated `content` still always wins.

Evidence

  • Real fixture lifted from an actual captured Copilot CLI transcript.
  • Before: `extractPromptsFromEvents` → `nil`, `extractSummaryFromEvents` → `""`.
  • After: real recovered prompt/summary text, verbatim.
  • Regression guards confirm normal (content-populated) case is unaffected.

Test plan

  • `go test ./cmd/entire/cli/agent/copilotcli/... -race -count=1` — 164/164 pass.
  • `mise run fmt`/`mise run lint` clean.

Note: the compacted-transcript builder (`transcript/compact/copilot.go`) had the same class of bug — that's fixed separately in a follow-up PR.

Fixes #1070

…CLI transcript content

Copilot CLI's user.message/assistant.message events sometimes carry an empty
"content" field, with the real displayable text only in transformedContent
(user) or reasoningText (assistant). Prompt/summary extraction only read
"content", so those sessions showed up in Entire with blank or partial
transcripts even though checkpoints captured correctly.

Fall back to transformedContent (stripping Copilot's injected
<current_datetime>/<reminder> wrapper blocks) and reasoningText when content
is empty; content still takes precedence when populated.

Fixes #1070
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 narrowly scoped, includes strong regression coverage, and directly addresses the documented Copilot transcript schema variance without affecting the normal content-populated path.

Pull request overview

This PR fixes Copilot CLI transcript extraction so Entire can recover displayable prompt/summary text when Copilot’s primary data.content fields are empty, aligning behavior with the observed Copilot CLI JSONL schema and closing issue #1070.

Changes:

  • Added fallback extraction for user prompts: content → transformedContent (with Copilot wrapper blocks stripped).
  • Added fallback extraction for assistant summary text: content → reasoningText.
  • Added regression + fixture-based tests to ensure fallbacks work and precedence rules remain unchanged.
File summaries
File Description
cmd/entire/cli/agent/copilotcli/transcript.go Adds transformedContent/reasoningText support and strips Copilot wrapper noise for prompt fallback extraction.
cmd/entire/cli/agent/copilotcli/transcript_test.go Adds fixture-based tests for empty-content fallback plus regression guards ensuring content still wins when present.
cmd/entire/cli/agent/copilotcli/AGENT.md Updates agent documentation to reflect the new fallback extraction behavior.
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.

Copilot CLI sessions appear in Entire, but transcript details are empty or incomplete

2 participants