Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 7, 2025

Add Missing Tools Column to Logs Overview Table ✅

Problem Solved

The logs command now prominently displays missing tools in the main overview table. Previously, missing tools were parsed correctly but only shown in a separate detailed summary section, making them easy to overlook.

Solution

Added a "Missing" column to the logs overview table showing the count of missing tools for each workflow run, positioned alongside the existing Errors and Warnings columns for immediate visibility.

Enhanced with verbose mode support: When running with the --verbose flag, the Missing column displays the actual tool names instead of just the count.

Changes Made

  • Added MissingToolCount field to WorkflowRun struct
  • Populated count from MissingTools array when preparing overview display
  • Added "Missing" column to overview table headers
  • Display missing tools count for each run in the table
  • Include total missing tools in summary row
  • Verbose mode shows tool names (e.g., "terraform" or "kubectl, docker, helm")
  • Updated displayLogsOverview to accept ProcessedRun and verbose parameters
  • Created comprehensive test coverage (10 tests)
  • Verified all existing tests pass (unit + integration)
  • Built and validated changes
  • Formatted code with make fmt
  • Fixed all linting issues - all linter checks pass

Visual Example

Normal Mode (gh aw logs):

Run ID | Workflow  | Status  | Duration | Tokens | Cost ($) | Turns | Errors | Warnings | Missing | Created    
------ | --------- | ------- | -------- | ------ | -------- | ----- | ------ | -------- | ------- | ----------
12345  | Workflow A| success | 5.0m     | 1.00k  | 0.010    | 3     | 0      | 2        | 1       | 2025-10-07
67890  | Workflow B| failure | 3.0m     | 500    | 0.005    | 2     | 1      | 0        | 3       | 2025-10-07
------ | --------- | ------- | -------- | ------ | -------- | ----- | ------ | -------- | ------- | ----------
TOTAL  |           |         | 8.0m     | 1.50k  | 0.015    | 5     | 1      | 2        | 4       |

Verbose Mode (gh aw logs --verbose):

Run ID | Workflow  | Status  | Duration | Tokens | Cost ($) | Turns | Errors | Warnings | Missing               | Created    
------ | --------- | ------- | -------- | ------ | -------- | ----- | ------ | -------- | --------------------- | ----------
12345  | Workflow A| success | 5.0m     | 1.00k  | 0.010    | 3     | 0      | 2        | terraform             | 2025-10-07
67890  | Workflow B| failure | 3.0m     | 500    | 0.005    | 2     | 1      | 0        | kubectl, docker, helm | 2025-10-07
------ | --------- | ------- | -------- | ------ | -------- | ----- | ------ | -------- | --------------------- | ----------
TOTAL  |           |         | 8.0m     | 1.50k  | 0.015    | 5     | 1      | 2        | 4                     |

Note: In verbose mode, the "Missing" column shows actual tool names (truncated to 30 chars if needed).

Test Coverage

Created pkg/cli/logs_overview_test.go with 10 comprehensive tests:

  • ✅ Overview table includes missing tools column
  • ✅ WorkflowRun struct has MissingToolCount field
  • ✅ Count population from ProcessedRun works correctly
  • ✅ Display handles various scenarios (0, 1, multiple missing tools)
  • ✅ Total calculation is accurate
  • ✅ Integration flow from ProcessedRun to display
  • ✅ Verbose and non-verbose modes tested

Implementation Details

Modified Files:

  • pkg/cli/logs.go - Enhanced to support verbose mode

    • Added MissingToolCount int field to WorkflowRun struct
    • Changed displayLogsOverview signature to accept ProcessedRun and verbose bool
    • In verbose mode: shows tool names instead of counts
    • In normal mode: shows just the count
    • Truncates tool names to 30 chars if needed
  • pkg/cli/logs_overview_test.go - Updated tests to use new signature

    • All tests now pass ProcessedRun with MissingTools data
    • Tests cover both verbose and non-verbose modes
    • Fixed linting issues (removed unused function and import)

Key Benefits

  1. Immediate Visibility: Missing tools count shown alongside Errors/Warnings
  2. Verbose Mode Detail: See actual tool names at a glance with --verbose
  3. Per-Run Clarity: Quickly identify which specific runs have missing tools
  4. Total Tracking: Summary row shows aggregate missing tools across all runs
  5. No Breaking Changes: Existing functionality fully preserved
  6. Consistent Pattern: Follows same pattern as Errors and Warnings columns

Backward Compatibility

✅ No breaking changes - all existing functionality preserved
✅ Additional column enhances existing display
✅ Detailed missing tools summary section still displays below the overview

Testing Results

✅ All unit tests pass (including new verbose mode tests)
✅ All integration tests pass  
✅ 10 comprehensive tests added with 100% pass rate
✅ Build succeeds
✅ Code formatted with make fmt
✅ All linter checks pass (make lint)

How It Works

  1. extractMissingToolsFromRun() parses agent_output.json artifacts
  2. Missing tools are stored in ProcessedRun.MissingTools array
  3. When creating overview, count is calculated: len(pr.MissingTools)
  4. Count is stored in WorkflowRun.MissingToolCount field
  5. displayLogsOverview() receives verbose parameter
  6. In verbose mode: extracts and displays tool names
  7. In normal mode: displays just the count
  8. displayMissingToolsAnalysis() still shows detailed breakdown separately

This implementation ensures that missing tools are now prominently visible in the main logs overview, with optional verbose mode to see the actual tool names.

Original prompt

The "logs" command should show a list of missing tools in runs. Make sure it parses missing-tools properly.

This run https://github.com/githubnext/gh-aw/actions/runs/18319686735 has one missing tool in the agent-output.json artifact.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add MissingToolCount field to WorkflowRun struct
- Populate count from MissingTools array in ProcessedRun
- Display "Missing" column in overview table alongside Errors/Warnings
- Include total missing tools count in summary row
- Add comprehensive test coverage for missing tools display

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add logging for missing tools in runs Add Missing Tools column to logs overview table Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 18:05
@pelikhan
Copy link
Contributor

pelikhan commented Oct 7, 2025

@copilot in verbose mode, show full list of missing tools

- Pass verbose parameter to displayLogsOverview
- In verbose mode, display actual tool names instead of count
- Update function signature to accept ProcessedRun for access to tool details
- Truncate long tool lists to fit table (max 30 chars)
- Update all tests to use new signature with ProcessedRun
- Test both verbose and non-verbose modes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot in verbose mode, show full list of missing tools

Done! The overview table now shows full tool names in verbose mode.

Normal mode:

  • Shows count: "1" or "3"

Verbose mode (--verbose):

  • Shows tool names: "terraform" or "kubectl, docker, helm"
  • Truncates if too long (max 30 chars)

Commit: Added in commit that enhances the overview table to display actual tool names when --verbose flag is used.

Copilot AI changed the title Add Missing Tools column to logs overview table Add Missing Tools column to logs overview table with verbose mode support Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 18:22
@pelikhan pelikhan marked this pull request as ready for review October 7, 2025 18:24
@pelikhan
Copy link
Contributor

pelikhan commented Oct 7, 2025

@copilot format, lint, fix tests

- Remove unused containsString helper function
- Remove unused strings import
- All linter checks now pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot format, lint, fix tests

Done! Fixed all linting issues.

Changes:

  • Removed unused containsString helper function
  • Removed unused strings import

Validation:

  • make fmt - code formatted
  • make lint - all linter checks pass
  • make test-unit - all tests pass
  • make build - builds successfully

Commit: Fixed in latest commit.

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