Skip to content

Fix silent conversation-transcript fetch failures in Copilot session data fetcher - #51195

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-root-cause-conversation-transcript-fet
Aug 7, 2026
Merged

Fix silent conversation-transcript fetch failures in Copilot session data fetcher#51195
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-root-cause-conversation-transcript-fet

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

copilot-session-data-fetch.md has produced zero *-conversation.txt transcripts for 71+ consecutive days, blocking turn-by-turn tool use, token counts, loop detection, and prompt-quality analysis in Copilot Session Insights — reporting has silently degraded to run-metadata-only.

Root cause

Copilot coding-agent runs execute under a special dynamic/copilot-swe-agent/copilot workflow path. Their job logs do contain the expected [cca-engine] turn=N ... lines (confirmed on real runs), but the fetch script's gh api calls to list jobs and download job logs discarded all stderr/exit codes (2>/dev/null || true). Once the default GITHUB_TOKEN lost the ability to fetch these logs, every failure went completely unnoticed — the logs/ directory stayed empty with no signal as to why.

Changes

  • Elevated token fallback: use secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN, matching the existing repo convention for operations that need permissions beyond the default token.
  • Exit-code-based diagnostics: capture stderr and exit codes for both the job-listing and job-log-download gh api calls; classify each failure (API error, no jobs found, empty log, no matching lines) by actual exit code rather than stderr presence, and log the specific reason per run.
  • Summary warning: when zero transcripts/events are retrieved across all runs, emit a breakdown by failure category with remediation guidance (configure GH_AW_GITHUB_TOKEN).
  • Docs: updated "Session Log Access" and "Requirements" sections to describe the token fallback chain, the new diagnostics, and the documented root cause.
  • Recompiled the two consumers of this shared component: copilot-session-insights.md and copilot-opt.md.
# before: failure was invisible
gh api "repos/$REPO/actions/runs/$run_id/jobs" --jq '.jobs[].id' 2>/dev/null || true

# after: failure is captured, classified, and surfaced
job_ids="$(gh api "repos/$REPO/actions/runs/$run_id/jobs" --jq '.jobs[].id' 2>"$jobs_err")" || jobs_rc=$?
if [ -z "$job_ids" ] && [ "$jobs_rc" -ne 0 ]; then
  echo "Failed to list jobs for run $run_id (exit=$jobs_rc): $(head -c 300 "$jobs_err")" | tee -a "$FETCH_STATUS_LOG"
  API_ERROR_COUNT=$((API_ERROR_COUNT + 1))
fi

…ack and diagnostics

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Root cause conversation-transcript fetch failure in Copilot Session Insights Fix silent conversation-transcript fetch failures in Copilot session data fetcher Aug 7, 2026
Copilot AI requested a review from pelikhan August 7, 2026 21:45
@pelikhan
pelikhan marked this pull request as ready for review August 7, 2026 22:40
Copilot AI balanced review requested due to automatic review settings August 7, 2026 22:40
@pelikhan
pelikhan merged commit e1e298d into main Aug 7, 2026
@pelikhan
pelikhan deleted the copilot/deep-report-root-cause-conversation-transcript-fet branch August 7, 2026 22:40

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

Improves Copilot session transcript retrieval and failure visibility.

Changes:

  • Adds elevated-token fallback and exit-code diagnostics.
  • Emits failure summaries with remediation guidance.
  • Recompiles both consuming workflows.
Show a summary per file
File Description
.github/workflows/shared/copilot-session-data-fetch.md Adds authentication fallback, diagnostics, and documentation.
.github/workflows/copilot-session-insights.lock.yml Regenerates the session-insights workflow.
.github/workflows/copilot-opt.lock.yml Regenerates the optimization workflow.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

> "$raw_log" 2>/dev/null || true
> "$raw_log" 2>"$raw_log_err" || log_rc=$?

if [ -f "$raw_log" ] && [ -s "$raw_log" ]; then
@@ -1,4 +1,4 @@
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"138fe93c4df6669482e2736e3bf8ce91e31439f6c921848737f80f9c10028fa1","body_hash":"3e7da356432617f7a3740f0dbb7cdde755e1c78d89c38f99b59c1810029c84f6","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.224"}}
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1a205bf3354b3cf4ede0f23f8443a2f0dd553ee0a66727371426742bf0733e68","body_hash":"2a96a21304b975c51504dd556731857febd942d37b53e1fcc5b42a29855ab23e","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.223"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Root-cause the 71+ day conversation-transcript fetch failure blocking Copilot Session Insights

3 participants