fix(copilot-session-insights): restore transcript fetch after 42-day gap#44822
Conversation
…proach with GitHub API job logs - Replace branch-name-derived session_number extraction (broken since Copilot switched to descriptive branch slugs like copilot/fix-mcp-...) with direct run_id-based job log download via gh api - Replace `gh agent-task view --log` (requires OAuth, no --log flag) with `gh api repos/$REPO/actions/jobs/$job_id/logs` (works with GITHUB_TOKEN) - Filter sessions to actual Copilot agent runs (conclusion != action_required) rather than CI gate runs that have no conversation data - Extract [cca-engine] turn= lines from job logs as conversation transcripts - Update copilot-session-insights.md allow-list (grep *, wc *) and prompt - Fix check-stale-lock-files.sh to skip shared/ and skills/ subdirectories (they compile into parent lock files, not standalone .lock.yml files) - Recompile copilot-session-insights.lock.yml and copilot-opt.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Clarify what CI gate runs are and why they're skipped - Explain why .jobs[0] is always the correct job for Copilot agent runs - Remove inaccurate 'session duration' mention (not available from transcript); replace with 'turn count (last turn=N value)' Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
PR TriageCategory: bug | Risk: medium | Priority: medium | Score: 48/100 (impact:25, urgency:15, quality:8) | Action: batch_review | Batch: pr-batch:draft-review Restores transcript fetch after 42-day data gap by fixing branch-name extraction regression (descriptive slug to session-number). Medium impact/urgency. Still a draft; grouped with other draft PRs.
|
|
Great detective work identifying and fixing the 42-day transcript fetch gap! 🔍 The root cause analysis covering both the branch name extraction bug and the auth failure is thorough and well-documented. One thing that would help:
If you'd like a hand, you can assign this prompt to your coding agent:
|
Copilot session transcript logs have been empty for 42 consecutive days, causing behavioral analytics (loop detection, context confusion) to fall back to run-metadata-only inference.
Two bugs identified:
Bug 1 — branch name extraction broken since ~Jul 8 (primary)
Session numbers were extracted by stripping non-numerics from branch names. Copilot switched from
copilot/issue-123to descriptive slugs (copilot/fix-mcp-gateway-docker-daemon-access), producing empty strings that caused[ -n "$session_number" ]to skip all 50 sessions — zero files downloaded.Bug 2 — auth failure (older, pre-Jul 8)
gh agent-task view --logdoesn't have a--logflag and requires an OAuth token. Cached files from May–July contained "this command requires an OAuth token" error messages rather than transcript data.Changes
shared/copilot-session-data-fetch.md— replaces the broken loop with agh apijob-log approach: filterssessions-list.jsonto actual agent runs (conclusion != "action_required", skipping ~47 CI gate runs per day), fetches job logs viagh api repos/$REPO/actions/jobs/$job_id/logs(works with standardGITHUB_TOKEN), then greps for[cca-engine] turn=lines as the transcriptcopilot-session-insights.md— addsgrep *andwc *to the bash tool allow-list; updates the prompt's transcript format description to match[cca-engine] turn=line structurescripts/check-stale-lock-files.sh— fixes a false failure: shared components undershared/andskills/compile into parent workflow lock files rather than producing standalone.lock.ymlfiles; these paths are now excluded from the stale-lock check