Skip to content

Filter noise from logs command output#8949

Merged
pelikhan merged 3 commits intomainfrom
copilot/improve-logs-command-output
Jan 5, 2026
Merged

Filter noise from logs command output#8949
pelikhan merged 3 commits intomainfrom
copilot/improve-logs-command-output

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

The logs command output was cluttered with repetitive progress messages, debug logs, JSON fragments, and invalid tool names, making it difficult to identify actionable information.

Changes

Progress messages

  • Suppressed per-iteration "✓ Fetched X workflow runs" messages
  • Suppressed per-batch "✓ Processed X/Y runs successfully" messages
  • Added concise final summary with key metrics

Error/warning table

  • Filter debug/validation logs: validation completed, executePromptDirectly
  • Filter JSON fragments: "errorCodesToRetry", "description":
  • Filter MCP server logs: [mcp server safeoutputs stderr]
  • Filter Squid proxy logs: ::1:56072 - -:- 0.0 NONE_NONE:HIER_NONE
  • Filter tool invocation results (outputs, not errors)
  • Limit to top 20 most common errors

Tool usage table

  • Filter common words: calls, to, for, Testing, multiple, launches
  • Filter single characters and empty names: -, a
  • Validate tool names match expected patterns (underscores, hyphens, camelCase)

Example

Before:

✓ Fetched 6 workflow runs
✓ Processed 1/6 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 0/3 runs successfully
...

## Tool Usage Summary
│calls       │34│2│0 B│N/A│
│to          │4 │2│0 B│N/A│
│Testing     │4 │2│0 B│N/A│

## Errors and Warnings
│Error│validation completed successfully│1│
│Error│"errorCodesToRetry": []          │2│
│Error│[safeoutputs] send: {"jsonrpc"..│2│

After:

## Tool Usage Summary
│github_search_issues│5│2│1.2 KB│450ms│
│bash                │3│1│  512 B│  2.1s│

## Errors and Warnings
│Error│failed to get user: 403 Forbidden│2│
│Error│Permission denied accessing repo │1│

✓ Downloaded 2 workflow logs to .github/aw/logs
  • 4 errors, 2 warnings across 2 runs
  • 2 unique tools used

Implementation

Added isActionableError() and isValidToolName() filters in pkg/cli/logs_report.go. Modified progress message handling in logs_github_api.go and logs_orchestrator.go.

Original prompt

Review the output of the "logs" command and make it clearer, more concise, better.

@pelikhan ➜ /workspaces/gh-aw (main) $ ./gh-aw logs -c 2 smoke-copilot
✓ Fetched 6 workflow runs
✓ Downloaded artifacts for run 20700990762
✓ Processed 1/6 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 0/3 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 0/3 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 0/3 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 0/3 runs successfully
✓ Fetched 3 workflow runs
✓ Processed 1/3 runs successfully
## Workflow Logs Summary

  Total Runs         : 2
  Total Duration     : 5.7m
  Total Tokens       : 0
  Total Cost         : 0
  Total Turns        : 13
  Total Errors       : 67
  Total Warnings     : 23
  Total Missing Tools: 0

## Workflow Logs Overview

┌───────────┬─────────────┬─────┬─────────┬────────┬──────┬────────┬─────┬──────┬────────┬───────┬───────────────────┬───────────────────────────────┐
│Run ID     │Workflow     │Agent│Status   │Duration│Tokens│Cost ($)│Turns│Errors│Warnings│Missing│Created            │Logs Path                      │
├───────────┼─────────────┼─────┼─────────┼────────┼──────┼────────┼─────┼──────┼────────┼───────┼───────────────────┼───────────────────────────────┤
│20700990762│Smoke Copilot│-    │completed│2.6m    │0     │0       │6    │39    │15      │0      │2026-01-04 23:47:19│.github/aw/logs/run-20700990762│
│20696085597│Smoke Copilot│-    │completed│3.1m    │0     │0       │7    │28    │8       │0      │2026-01-04 16:50:41│.github/aw/logs/run-20696085597│
└───────────┴─────────────┴─────┴─────────┴────────┴──────┴────────┴─────┴──────┴────────┴───────┴───────────────────┴───────────────────────────────┘
## 🛠️  Tool Usage Summary

┌────────────┬───────────┬────┬──────────┬────────────┐
│Tool        │Total Calls│Runs│Max Output│Max Duration│
├────────────┼───────────┼────┼──────────┼────────────┤
│calls       │34         │2   │0 B       │N/A         │
│to          │4          │2   │0 B       │N/A         │
│Testing     │4          │2   │0 B       │N/A         │
│-           │2          │1   │0 B       │N/A         │
│create_issue│2          │1   │0 B       │N/A         │
│add_comment │2          │1   │0 B       │N/A         │
│add_labels  │2          │1   │0 B       │N/A         │
│for         │2          │2   │0 B       │N/A         │
│multiple    │2          │2   │0 B       │N/A         │
│launches    │2          │2   │0 B       │N/A         │
│command     │2          │2   │0 B       │N/A         │
│invocation  │2          │2   │0 B       │N/A         │
└────────────┴───────────┴────┴──────────┴────────────┘
## Errors and Warnings

┌───────┬────────────────────────────────────────────────────────────────────────────────┬───────────┬──────┬───────────┐
│Type   │Message                                                                         │Occurrences│Engine│Sample Run │
├───────┼────────────────────────────────────────────────────────────────────────────────┼───────────┼──────┼───────────┤
│Error  │Unable to parse tool invocation as JSON. Treating it as a string for filterin...│2          │-     │20700990762│
│Error  │"errorCodesToRetry": [],                                                        │2          │-     │20700990762│
│Error  │failed to get user: GET https://api.github.com/user: 403 Resource not accessi...│2          │-     │20700990762│
│Error  │4. **GitHub MCP Default Toolset Testing**: Verify that the `get_me` tool is N...│2          │-     │20700990762│
│Error  │"description": "Custom agent: Launch specialized agents in separate context w...│2          │-     │20700990762│
│Error  │"onRequestError": [                                                             │2          │-     │20700990762│
│Error  │[2026-01-04T23:48:45.823Z] [safeoutputs] send: {"jsonrpc":"2.0","id":3,"resul...│2          │-     │20700990762│
│Error  │"statement": "# Smoke Test: Copilot Engine Validation\n\n**IMPORTANT: Keep al...│2          │-     │20700990762│
│Error  │Tool invocation result: failed to get user: GET https://api.github.com/user: ...│2          │-     │20700990762│
│Error  │executePromptDirectly completing: hasError=false, will return true              │2          │-     │20700990762│
│Error  │Pattern 14/16: Permission denied error (requires error context) - regex: \ber...│1          │-     │20700990762│
│Error  │Pattern 10/16: Copilot CLI failed command indicator - regex: ✗\s+(.+)           │1          │-     │20700990762│
│Error  │Pattern 15/16: Unauthorized access error (requires error context) - regex: \b...│1          │-     │20700990762│
│Error  │Pattern 16/16: Forbidden access error (requires error context) - regex: \berr...│1          │-     │20700990762│
│Error  │validation completed. Errors found: false                                       │1          │-     │20700990762│
│Error  │1767545527.704 ::1:56072 - -:- 0.0 - 0 NONE_NONE:HIER_NONE error:transaction-...│1          │-     │20696085597│
│Err...

</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/githubnext/gh-aw/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Jan 5, 2026
Copilot AI and others added 2 commits January 5, 2026 00:37
- Suppress repetitive "Fetched X workflow runs" messages per iteration
- Suppress "Processed X/Y runs successfully" per batch
- Filter out non-actionable errors (debug logs, JSON fragments, MCP logs)
- Filter out invalid tool names (common words, single chars, fragments)
- Improve signal-to-noise ratio in error and tool usage tables

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Limit error/warning table to top 20 most common issues
- Add concise final summary with key metrics
- Improve readability of completion message

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance clarity and conciseness of logs command output Filter noise from logs command output Jan 5, 2026
Copilot AI requested a review from pelikhan January 5, 2026 00:44
@pelikhan pelikhan marked this pull request as ready for review January 5, 2026 00:46
@pelikhan pelikhan merged commit aed009b into main Jan 5, 2026
153 of 156 checks passed
@pelikhan pelikhan deleted the copilot/improve-logs-command-output branch January 5, 2026 00:47
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