Pretty print Codex logs to core.info using shared renderer#15688
Pretty print Codex logs to core.info using shared renderer#15688pelikhan merged 3 commits intocopilot/review-codex-agentic-enginefrom
Conversation
- Convert Codex log parser to return structured logEntries format - Add convertToLogEntries helper to transform parsed data - Update parseCodexLog to return object with markdown, logEntries, mcpFailures, maxTurnsHit - Update parse_custom_log.cjs to handle new return format - Update all tests to access result.markdown property - Codex logs now output to core.info via generatePlainTextSummary Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
51683f8
into
copilot/review-codex-agentic-engine
There was a problem hiding this comment.
Pull request overview
This PR enhances the Codex log parser to return structured logEntries (matching the pattern used by Claude and Copilot parsers), enabling pretty-printed execution summaries in core.info console output instead of generic "log parsed successfully" messages.
Changes:
- Modified
parseCodexLog()to return an object with{markdown, logEntries, mcpFailures, maxTurnsHit}instead of just a markdown string - Added
convertToLogEntries()function to transform parsed Codex data (thinking, tool calls, bash commands) into standardized logEntries format - Updated
parse_custom_log.cjsto handle the new object return type from Codex parser - Updated all tests in
parse_codex_log.test.cjsto checkresult.markdowninstead of justresult
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| actions/setup/js/parse_codex_log.cjs | Added convertToLogEntries() function and changed parseCodexLog() return type from string to object with markdown, logEntries, mcpFailures, and maxTurnsHit fields |
| actions/setup/js/parse_custom_log.cjs | Updated to handle Codex parser's new object return type, extracting and forwarding all fields (markdown, logEntries, mcpFailures, maxTurnsHit) |
| actions/setup/js/parse_codex_log.test.cjs | Updated all test assertions to access result.markdown instead of treating result as a string |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| type: "tool_use", | ||
| id: toolUseId, | ||
| name: item.toolName, // Already in server__method format |
There was a problem hiding this comment.
The tool name format needs to be prefixed with "mcp__" for proper display in plain text summaries. The generatePlainTextSummary function expects MCP tools to be in the format "mcp__server__method" (e.g., "mcp__github__list_pull_requests") to apply proper formatting. Currently, the name is "server__method" (e.g., "github__list_pull_requests"), which will not be formatted correctly.
Change line 169 to:
name: mcp__${item.toolName}, // Convert to mcp__ format for plain text rendering
| name: item.toolName, // Already in server__method format | |
| name: `mcp__${item.toolName}`, // Convert to mcp__ format for plain text rendering |
| expect(result.markdown).toContain("## 🤖 Reasoning"); | ||
| expect(result.markdown).toContain("## 🤖 Commands and Tools"); | ||
| expect(result.markdown).toContain("github::list_pull_requests"); | ||
| expect(result.markdown).toContain("✅"); | ||
| }); |
There was a problem hiding this comment.
Missing test coverage for the new logEntries array returned by parseCodexLog. While the tests verify the markdown field, they should also verify that logEntries contains properly structured conversation data (tool calls, bash commands, thinking sections) that can be used by generatePlainTextSummary.
Codex logs were displaying as generic "Codex log parsed successfully" instead of structured execution summaries in
core.info, unlike Claude/Copilot parsers.Changes
Return structured logEntries from Codex parser
convertToLogEntries()to transform parsed Codex data (thinking, tool calls, bash commands) into standardized logEntries formatparseCodexLog()return type from string to object:{ markdown, logEntries, mcpFailures, maxTurnsHit }parse_custom_log.cjsto handle object return instead of stringResult
Codex logs now render structured summaries to
core.infoviageneratePlainTextSummary():The bootstrap code (
log_parser_bootstrap.cjs) checks forlogEntriespresence to determine whether to call the plain text renderer. Codex now follows the same contract as other engines.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.