Replace markdown headers with styled section headers in audit command output #8959
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 audit command was rendering section headers with markdown syntax (
## Overview), which appeared asℹ ## Overviewin CLI output—awkward and unprofessional.Changes
Console package:
FormatSectionHeader()helper that appliesstyles.Header(bold green with margin) in TTY mode, plain text otherwiseAudit rendering:
console.FormatInfoMessage("## Section")calls withconsole.FormatSectionHeader("Section")renderConsole()and all section render functions to usefmt.Fprint(os.Stderr, ...)Tests:
audit_agent_example_test.goto capture stderr and expect header format without markdownBefore/After
Headers render with bold green styling in terminals, plain text when piped.
Original prompt
Improve the rendering of the "audit" command. Make it clearer, simpler, better information density. Improve the console.renderTable helpers. The markdown headers do not look good in a cli. We need header styles.
See this output
./gh-aw audit 20701642088
ℹ # Workflow Run Audit Report
ℹ ## Overview
Run ID : 20701642088
Workflow: Smoke Copilot
Status : completed (success)
Duration: 2.5m
Event : schedule
Branch : main
URL : https://github.com/githubnext/gh-aw/actions/runs/20701642088
Files : .github/aw/logs/run-20701642088
ℹ ## Key Findings
🟠 ⚠ Multiple Errors [error]
Encountered 19 errors during execution
Impact: Multiple errors may indicate systemic issues requiring attention
ℹ ## Recommendations
Reason: Tracking metrics helps identify trends and optimization opportunities
Example: Run 'gh aw logs' periodically to review cost and performance trends
ℹ ## Performance Metrics
Most Used Tool: calls (9 calls)
ℹ ## Metrics
Turns : 7
Errors : 19
Warnings: 9
ℹ ## Jobs
┌───────────────────┬─────────┬──────────┬────────┐
│Name │Status │Conclusion│Duration│
├───────────────────┼─────────┼──────────┼────────┤
│pre_activation │completed│success │5.0s │
│activation │completed│success │6.0s │
│agent │completed│success │1.4m │
│detection │completed│success │25.0s │
│safe_outputs │completed│success │10.0s │
│update_cache_memory│completed│success │7.0s │
│conclusion │completed│success │8.0s │
└───────────────────┴─────────┴──────────┴────────┘
ℹ ## Downloaded Files
• .github/aw/logs/run-20701642088/agent_output.json (848 B) - Validated safe outputs
• .github/aw/logs/run-20701642088/detection.log (636 B) - Log file
• .github/aw/logs/run-20701642088/outputs.jsonl (825 B) - JSON Lines data file
• .github/aw/logs/run-20701642088/run_summary.json (21.8 KB) - Cached summary of workflow run analysis
ℹ ## Tool Usage
┌──────────┬─────┬─────────┬──────────┬────────────┐
│Tool │Calls│Max Input│Max Output│Max Duration│
├──────────┼─────┼─────────┼──────────┼────────────┤
│- │2 │N/A │N/A │N/A │
│launches │1 │N/A │N/A │N/A │
│for │1 │N/A │N/A │N/A │
│invocation│2 │N/A │N/A │N/A │
│command │1 │N/A │N/A │N/A │
│calls │9 │N/A │N/A │N/A │
│noop │2 │N/A │N/A │N/A │
│Testing │1 │N/A │N/A │N/A │
│multiple │1 │N/A │N/A │N/A │
│to │2 │N/A │N/A │N/A │
└──────────┴─────┴─────────┴──────────┴────────────┘
ℹ ## Errors and Warnings
✗ Errors (19):
agent-stdio.log:301: 4. GitHub MCP Default Toolset Testing: Verify that the
get_metool is NOT available with default toolsets. Try to use it and confirm it fails with a tool not found error.agent-stdio.log:386: failed to get user: GET https://api.github.com/user: 403 Resource not accessible by integration
server.log:39: [2026-01-05T00:38:39.059Z] [safeoutputs] send: {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{"result":"success"}"}],"isError":false}}
access.log:1: 1767573493.798 ::1:53504 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
access.log:2: 1767573498.832 ::1:53506 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
access.log:6: 1767573503.869 ::1:57032 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
access.log:10: 1767573508.904 ::1:57042 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
access.log:11: 1767573513.941 ::1:34644 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
access.log:12: 1767573518.978 ::1:34650 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-end-before-headers "-"
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:180: "statement": "# Smoke Test: Copilot Engine Validation\n\nIMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.\n\n## Test R...
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:267: "errorCodesToRetry": [],
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:294: "onRequestError": [
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:685: "description": "Custom agent: Launch specialized agents in separate context windows for specific tasks.\n\nThe Task tool launches specialized agents that autonomously handle complex tasks. Each age...
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:1886: Unable to parse tool invocation as JSON. Treating it as a string for filtering: SyntaxError: Unexpected token 'i', "failed to ge"... is not valid JSON
session-b9e49277-3712-4c9a-bc38-ee4c173fb2ba.log:18...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.