Fetch Copilot session event logs for optimization audits - #50071
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing Copilot session logs from optimization data pipeline
Fetch Copilot session event logs for optimization audits
Aug 3, 2026
pelikhan
marked this pull request as ready for review
August 3, 2026 20:08
Contributor
There was a problem hiding this comment.
Pull request overview
Adds structured Copilot session telemetry retrieval for optimization audits.
Changes:
- Fetches
events.jsonlartifacts with job-log fallback. - Enforces log completeness and cache freshness.
- Regenerates affected workflow lock files.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/shared/copilot-session-data-fetch.md |
Implements telemetry fetching, validation, caching, and documentation. |
.github/workflows/copilot-session-insights.lock.yml |
Regenerates Session Insights with shared fetch logic. |
.github/workflows/copilot-opt.lock.yml |
Regenerates Copilot Opt with shared fetch logic and permissions. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 4
- Review effort level: Balanced
Comment on lines
+211
to
+213
| if [ "$AGENT_COUNT" -gt 0 ] && [ "$LOG_RUN_COUNT" -lt "$AGENT_COUNT" ]; then | ||
| echo "::error::Missing per-session logs for $((AGENT_COUNT - LOG_RUN_COUNT)) of $AGENT_COUNT agent runs; failing to prevent incomplete optimization analysis" | ||
| exit 1 |
Comment on lines
+164
to
+165
| if [ -s "$events_tmp" ]; then | ||
| cp "$events_tmp" "$events_out" |
| rm -f "$events_tmp" | ||
| rm -rf "$artifact_work_dir" | ||
|
|
||
| if [ ! -s "$events_out" ]; then |
Comment on lines
+74
to
+77
| CACHED_AGENT_COUNT=$(jq '[.[] | select(.status == "completed" and .conclusion != "action_required")] | length' "$CACHE_DIR/copilot-sessions-${TODAY}.json") | ||
| CACHED_LOG_RUN_COUNT=$(count_agent_logs "$CACHE_DIR/copilot-sessions-${TODAY}.json" "$CACHE_DIR/session-logs-${TODAY}") | ||
| if [ "$CACHED_AGENT_COUNT" -eq 0 ] || [ "$CACHED_LOG_RUN_COUNT" -ge "$CACHED_AGENT_COUNT" ]; then | ||
| USE_CACHE=true |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
Copilot optimization audits were operating on session metadata only because per-session
events.jsonl/conversation logs were not populated. That blocked tool latency, payload size, validation timing, context size, and prompt drift analysis from using real telemetry.Session telemetry fetch
events.jsonlfiles as the preferred per-session data source.[cca-engine] turn=transcript extraction when artifacts are unavailable.Data-quality enforcement
::error::and exits non-zero when any completed agent run has neitherevents.jsonlnor transcript fallback.Workflow sync