Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

The audit command was rendering section headers with markdown syntax (## Overview), which appeared as ℹ ## Overview in CLI output—awkward and unprofessional.

Changes

Console package:

  • Added FormatSectionHeader() helper that applies styles.Header (bold green with margin) in TTY mode, plain text otherwise

Audit rendering:

  • Replaced all console.FormatInfoMessage("## Section") calls with console.FormatSectionHeader("Section")
  • Migrated all output from stdout to stderr for consistency
  • Updated renderConsole() and all section render functions to use fmt.Fprint(os.Stderr, ...)

Tests:

  • Fixed audit_agent_example_test.go to capture stderr and expect header format without markdown

Before/After

Before:
ℹ # Workflow Run Audit Report
ℹ ## Overview
ℹ ## Metrics

After:
Workflow Run Audit Report
Overview
Metrics

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

  1. [LOW] Monitor workflow performance over time
    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_me tool 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.

Copilot AI and others added 2 commits January 5, 2026 02:40
- Add FormatSectionHeader() to console package for styled section headers
- Replace all markdown-style headers (## ...) with FormatSectionHeader()
- Update all audit report rendering functions to use os.Stderr consistently
- Add test for FormatSectionHeader function
- Remove awkward "ℹ ## Header" output in favor of clean styled headers

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Update test to capture stderr instead of stdout
- Remove markdown-style header expectations (## ...)
- Update expected sections to match new FormatSectionHeader output
- All tests now pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve rendering of audit command output Replace markdown headers with styled section headers in audit command output Jan 5, 2026
Copilot AI requested a review from pelikhan January 5, 2026 02:51
@pelikhan pelikhan marked this pull request as ready for review January 5, 2026 02:52
@pelikhan pelikhan merged commit 36b4e5f into main Jan 5, 2026
4 checks passed
@pelikhan pelikhan deleted the copilot/improve-audit-command-rendering branch January 5, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants