Skip to content

Refactor engine log parsing to canonical Copilot event format#38781

Merged
pelikhan merged 6 commits into
mainfrom
copilot/refactor-log-parser-js
Jun 12, 2026
Merged

Refactor engine log parsing to canonical Copilot event format#38781
pelikhan merged 6 commits into
mainfrom
copilot/refactor-log-parser-js

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This change makes the Copilot event log schema the canonical parser output across engine parsers and aligns rendering on that schema. Copilot session events.jsonl inputs now pass through without conversion, while legacy Claude/Codex/Gemini/Pi/Antigravity shapes are normalized to Copilot events.

  • Canonical event schema adoption

    • Added shared helpers to detect Copilot event logs and convert between legacy trace entries and Copilot event entries.
    • Standardized parser outputs on event types like session.init, assistant.message, tool.execution_start, tool.execution_complete, and session.result.
  • Renderer compatibility via normalization

    • Updated shared formatter/render paths to normalize event logs into renderer-friendly structures internally.
    • Preserved existing summary/markdown output behavior while changing upstream parser output contracts.
  • Parser refactors by engine

    • Updated Claude, Codex, Gemini, Pi, and Antigravity parsers to emit canonical Copilot event entries.
    • Updated Copilot parser to retain event-format inputs as-is and only synthesize missing session.result metadata when absent.
  • Bootstrap/model metadata alignment

    • Updated bootstrap summary model extraction to support both legacy init entries and canonical session.init entries.
  • Test updates

    • Updated parser tests to assert event-format logEntries and event-based metadata access patterns.
const canonicalLogEntries = isEventFormat
  ? logEntries
  : convertLegacyLogEntriesToCopilotEvents(logEntries, { sourceEngine: "claude" });

const conversationResult = generateConversationMarkdown(canonicalLogEntries, {
  formatToolCallback: (toolUse, toolResult) => formatToolUse(toolUse, toolResult, { includeDetailedParameters: false }),
  formatInitCallback: initEntry => formatInitializationSummary(initEntry, { includeSlashCommands: true }),
});


✨ PR Review Safe Output Test - Run 27439065442

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 9.05 AIC · ⊞ 947 ·


Changeset

  • Type: patch
  • Description: Refactored engine log parsing to use the canonical Copilot event format and normalize legacy engine log shapes.

Generated by 📋 Changeset Generator for issue #38781 ·

Copilot AI and others added 4 commits June 12, 2026 04:44
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Refactor log parsing to Copilot event format and renderer normalization Refactor engine log parsing to canonical Copilot event format Jun 12, 2026
Copilot AI requested a review from pelikhan June 12, 2026 05:08
@pelikhan pelikhan marked this pull request as ready for review June 12, 2026 14:03
Copilot AI review requested due to automatic review settings June 12, 2026 14:03

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

This pull request standardizes engine log parser outputs on a canonical Copilot “event” schema, and updates shared rendering/summary code paths to accept those canonical entries (normalizing internally as needed). It also adjusts the compiled Copilot smoke workflow to use $HOME-based Copilot config paths.

Changes:

  • Introduces shared helpers to detect Copilot event logs and convert between legacy trace entries and canonical Copilot event entries.
  • Refactors multiple engine parsers/tests to emit and assert against canonical event entries (e.g., session.init, assistant.message, tool.execution_*, session.result).
  • Updates the compiled Copilot smoke workflow to avoid hardcoded /home/runner paths and to set Copilot config env paths via $HOME.
Show a summary per file
File Description
pkg/workflow/action_resolver.go Fixes/cleans up error handling when resolving gh-aw refs via gh api.
actions/setup/js/parse_pi_log.cjs Converts Pi legacy entries to canonical Copilot event entries before rendering/returning.
actions/setup/js/parse_gemini_log.cjs Converts Gemini legacy entries to canonical Copilot event entries before rendering/returning.
actions/setup/js/parse_custom_log.test.cjs Loosens assertions to match updated “Custom Engine Log” rendering expectations.
actions/setup/js/parse_copilot_log.test.cjs Updates tests to validate canonical session.result data shape (numTurns, etc.).
actions/setup/js/parse_copilot_log.cjs Treats event-format inputs as canonical, converts legacy to events, and normalizes for rendering/information sections.
actions/setup/js/parse_codex_log.test.cjs Updates Codex tests to assert tool.execution_* and session.init events.
actions/setup/js/parse_codex_log.cjs Converts Codex legacy entries to canonical Copilot event entries for logEntries output.
actions/setup/js/parse_claude_log.cjs Converts Claude legacy entries to canonical Copilot event entries for logEntries output and rendering.
actions/setup/js/parse_antigravity_log.test.cjs Updates Antigravity tests to assert presence of assistant.message events.
actions/setup/js/parse_antigravity_log.cjs Converts Antigravity legacy entries to canonical Copilot event entries before returning.
actions/setup/js/log_parser_shared.cjs Adds event-format detection + bidirectional legacy↔event conversion helpers and exports them.
actions/setup/js/log_parser_format.cjs Normalizes event entries to legacy trace shape internally for rendering and summaries.
actions/setup/js/log_parser_bootstrap.cjs Allows model extraction from either legacy init or canonical session.init.
.github/workflows/smoke-copilot-aoai-entra.lock.yml Switches Copilot config paths to $HOME and adjusts env exports accordingly.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 14/15 changed files
  • Comments generated: 1

Comment on lines 200 to 203
// Add Information section
const lastEntry = logEntries[logEntries.length - 1];
const initEntry = logEntries.find(entry => entry.type === "system" && entry.subtype === "init");
const lastEntry = legacyRenderEntries[legacyRenderEntries.length - 1];
const initEntry = legacyRenderEntries.find(entry => entry.type === "system" && entry.subtype === "init");

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel failed to deliver outputs during test quality analysis.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #38781 does not have the implementation label (has_implementation_label=false) and has only 8 new lines of code in business logic directories, below the 100-line threshold (requires_adr_by_default_volume=false).

@github-actions github-actions Bot mentioned this pull request Jun 12, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

@github-actions github-actions Bot 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.

✅ Test Quality Sentinel: 73/100. Test quality is acceptable — 15.8% of modified tests are implementation tests (threshold: 30%). The 3 flagged tests are false positives where only the test accessor was refactored; all behavioral assertions remain intact. No coding-guideline violations detected.

…ver.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Done. Removed the unused initEntry variable from parse_copilot_log.cjs and also fixed a pre-existing perfsprint lint error in pkg/workflow/action_resolver.go (needed for make agent-report-progress to pass). Commit: Remove unused initEntry variable; fix perfsprint lint in action_resolver.go.

@github-actions

Copy link
Copy Markdown
Contributor

``
@copilot please refresh the branch and confirm the log parser changes still match the canonical event format.

Generated by 👨‍🍳 PR Sous Chef · 53.8 AIC · ⌖ 0.972 AIC · ⊞ 17.3K ·

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ Smoke Gemini failed. Gemini encountered unexpected challenges...

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (apikey) is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.54.0
jq 1.7
yq v4.53.3
curl 8.5.0
gh 2.93.0
node v22.22.3
python3 3.11.15 (PyPy 7.3.23)
go 1.24.13
java 10.0.300
dotnet 10.0.300

Result: 12/12 tools available ✅ — PASS

🔧 Tool validation by Agent Container Smoke Test · 28.6 AIC · ⌖ 13.1 AIC · ⊞ 28.1K ·

@github-actions

Copy link
Copy Markdown
Contributor

Merged PRs: [dead-code] chore: remove dead functions — 1 function removed; Add missing pull-requests: read scope to Designer Drift Audit workflow
✅ GitHub reads
✅ Serena analysis
✅ Playwright title check
✅ Build and file/cache checks
Overall: PASS

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex · 46.4 AIC · ⌖ 3.56 AIC · ⊞ 11.4K ·

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Silent wind in code
Tests wake the sleeping branches
Dawn keeps the green path

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex · 46.4 AIC · ⌖ 3.56 AIC · ⊞ 11.4K ·

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Smoke Test: Claude — Run 27439065442

Core #1-12: ✅ all passed
PR review #13-18: ✅ all passed
#19 Close PR: ⚠️ skipped (no safe test PR)

Overall: PASS 🎉

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 9.05 AIC · ⊞ 947 ·

@github-actions github-actions Bot 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.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 9.05 AIC · ⊞ 947

MAX_AGENT_TEXT_LENGTH,
SIZE_LIMIT_WARNING,
} = deps;

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.

Nice extraction of normalizeEntriesForRendering — keeps the conversion concern in one place.

*/
function generateConversationMarkdown(logEntries, options) {
const { formatToolCallback, formatInitCallback, summaryTracker } = options;
const renderEntries = normalizeEntriesForRendering(logEntries);

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.

Good call normalizing once before collectToolUsePairs; avoids repeated conversion downstream.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke tests results:
1: ✅
2: ❌
3: ❌
4: ❌
5: ✅
6: ✅
7-15: ❌
Overall: FAIL
@app/copilot-swe-agent @pelikhan @Copilot

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot - AOAI (Entra) · 64.3 AIC · ⌖ 1.84 AIC · ⊞ 19K ·

@github-actions

Copy link
Copy Markdown
Contributor

Commit pushed: 1a9d5d7

Generated by Changeset Generator

@github-actions

Copy link
Copy Markdown
Contributor

Smoke 27439104838 — FAIL
PR: Refactor engine log parsing to canonical Copilot event format
1❌ 2✅ 3✅ 4✅ 5❌ 6✅ 7✅ 8✅
9✅ 10❌ 11✅ 12✅ 13❌ 14✅ 15✅
Author: @app/copilot-swe-agent
Assignees: @pelikhan @Copilot

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 175.8 AIC · ⌖ 16.4 AIC · ⊞ 20.3K ·

@pelikhan pelikhan merged commit b483881 into main Jun 12, 2026
37 checks passed
@pelikhan pelikhan deleted the copilot/refactor-log-parser-js branch June 12, 2026 21:14
@github-actions

Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · 77 AIC · ⌖ 1.04 AIC · ⊞ 17.3K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants