[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
Draft
[rendering-scripts] fix(copilot): add rich text format parser for Copilot CLI modern output#23222github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
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>
This was referenced Mar 27, 2026
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.
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
parseCopilotLoginparse_copilot_log.cjstried three formats in order: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 §23642529425 — Daily 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
parse_copilot_logparse_claude_logrender_templateNo regressions. Rich text logs now render correctly.
References: