Skip to content

[rendering-scripts] fix(copilot): add rich text format parser for Copilot CLI modern output#23222

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
fix/copilot-rich-text-parser-4830ef4d39982dc7
Draft

[rendering-scripts] fix(copilot): add rich text format parser for Copilot CLI modern output#23222
github-actions[bot] wants to merge 1 commit intomainfrom
fix/copilot-rich-text-parser-4830ef4d39982dc7

Conversation

@github-actions
Copy link
Contributor

The Copilot CLI now emits "rich text" output using Unicode box-drawing symbols ( ) rather than the structured JSON or [DEBUG] log formats the parser previously handled. Every Copilot run using this new format produced a useless 147-byte step summary saying "Log format not recognized as Copilot JSON array or JSONL."

Root cause

parseCopilotLog in parse_copilot_log.cjs tried three formats in order:

  1. JSON array
  2. Debug log (`[DEBUG] (redacted) blocks)
  3. JSONL

The modern Copilot CLI output contains none of these — it uses a human-readable display format with Unicode symbols for tool calls.

Fix

Added two new functions called as a last-resort fallback in parseCopilotLog:

  • parseRichTextFormat(logContent) — detects the format via // prefixes, skips Docker/firewall infrastructure preamble before the first tool call, maps rich text tool names ((shell)Bash, Search (glob)Glob, Read ...Read, Explore ...Agent, etc.) to internal types, and assembles the same structured entry array used by all other parsers.

  • parseRichTextStats(statsText) — extracts model name, token counts (input/output in millions/thousands), and session duration from the footer statistics block.

Triggered by

Run §23642529425Daily Community Attribution Updater (copilot engine, 2026-03-27) — produced a 147-byte placeholder summary despite completing 65 turns.

After the fix, the same log renders a 4575-byte summary with full conversation, tool calls, and statistics.

Test results

Suite Before After
parse_copilot_log 23/23 ✅ 23/23 ✅
parse_claude_log 34/34 ✅ 34/34 ✅
render_template 17/17 ✅ 17/17 ✅

No regressions. Rich text logs now render correctly.

References:

Generated by Daily Rendering Scripts Verifier ·

  • expires on Mar 30, 2026, 11:27 AM UTC

The Copilot CLI now emits "rich text" output using Unicode box-drawing
symbols (● ✓ ✗) instead of structured JSON or debug log format. The
existing parser failed to recognize this format and returned a
"Log format not recognized" placeholder for every run.

Add `parseRichTextFormat` and `parseRichTextStats` as a last-resort
fallback in `parseCopilotLog`. The new parser:
- Detects the format by presence of ●/✓/✗ tool-call lines
- Skips Docker/firewall infrastructure preamble before the first tool call
- Maps rich text tool names (shell, glob, grep, explore, read, etc.)
  to internal tool types for consistent rendering
- Extracts turn count, token usage, and session duration from the
  statistics footer

Triggered by run 23642529425 (Daily Community Attribution Updater,
copilot engine) which produced a 147-byte summary instead of expected
rich content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix javascript Pull requests that update javascript code rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants