Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Fix gh aw status incorrect workflow count display

Problem: The command shows "Fetched 6 workflows" but only displays 3 in the table because internal workflows (without .md files) are counted but not displayed.

Solution:

  • Explore codebase and understand the issue
  • Identify where workflow count is reported
  • Separate user workflows (with .md) from internal workflows (without .md)
  • Update the success message to show "Fetched X public and Y internal workflows"
  • Add/update tests to verify the fix
  • Fix unrelated build error (duplicate logger declaration)
  • Run formatter
  • Run linter
  • Run validation tests (all our changes pass)
  • Merge main branch
  • Recompile workflows
  • Refactor to use existing helper functions

Changes made:

  1. Modified pkg/cli/workflows.go:

    • After fetching workflows from GitHub, separate them into user workflows (those with .md files) and internal workflows (those without)
    • Updated the spinner message to show "✓ Fetched X public and Y internal workflows" when internal workflows exist
    • Falls back to "✓ Fetched X workflows" when no internal workflows are present
    • Refactored to use extractWorkflowNameFromPath helper instead of manual string manipulation
  2. Added pkg/cli/workflows_count_test.go:

    • Test validates the counting logic for user vs internal workflows
    • Confirms the correct message format is generated
    • Updated to use extractWorkflowNameFromPath helper
  3. Fixed pkg/workflow/compiler_safe_outputs_config.go:

    • Resolved merge conflict with main branch
    • Added back logger import and declaration
  4. Merged main branch and recompiled all workflows

Validation:

  • All status-related tests pass ✅
  • Build successful ✅
  • Linting passed ✅
  • Formatting validated ✅
  • Workflows recompiled successfully ✅
Original prompt

This section details on the original issue you should resolve

<issue_title>bug: gh aw status: off by 3 (there are some internal workflows)</issue_title>
<issue_description>I noticed a bug with gh aw status.
The number of listed workflows does not match with the numerical number displayed.

e.g. see in the example below, there are 3 workflow listed

  • daily-team-status,
  • python-format-typecheck,
  • test-copilot-minimal

but the message above says: "Fetched 6 workflows".

There are 3 internal workflows e.g.

  • Agentics Maintenance
  • Copilot Setup Steps
  • Copilot code review

@copilot please fix this and display the right number, or even better display "Fetched 3 public and 3 internal workflows" (in this case) instead of "Fetched 6 workflows"

merklbe1@H69LST3:~/githubnext/gh-aw-python-project (main =)$ gh aw status
✓ Fetched 6 workflows
┌───────────────────────┬───────┬────────┬──────┬──────────────┬──────┬──────────┬──────────────┐
│Workflow               │Engine │Compiled│Status│Time Remaining│Labels│Run Status│Run Conclusion│
├───────────────────────┼───────┼────────┼──────┼──────────────┼──────┼──────────┼──────────────┤
│daily-team-status      │copilot│Yes     │active│19d 17h       │-     │-         │-             │
│python-format-typecheck│copilot│Yes     │active│N/A           │-     │-         │-             │
│test-copilot-minimal   │copilot│Yes     │active│N/A           │-     │-         │-             │
└───────────────────────┴───────┴────────┴──────┴──────────────┴──────┴──────────┴──────────────┘
merklbe1@H69LST3:~/githubnext/gh-aw-python-project (main =)$ gh workflow list
NAME                          STATE   ID
Agentics Maintenance          active  222438688
Copilot Setup Steps           active  222430216
Daily Team Status             active  222403267
Python Format and Type Check  active  222565460
Minimal Copilot Test          active  222455430
Copilot code review           active  222402093
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 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.

Copilot AI and others added 2 commits January 22, 2026 07:39
…nal workflows

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix gh aw status to display correct workflow count Fix workflow count mismatch in gh aw status output Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 07:57
@pelikhan pelikhan marked this pull request as ready for review January 22, 2026 11:42
@pelikhan
Copy link
Contributor

@copilot Merge main and recompile

Copilot AI and others added 2 commits January 22, 2026 11:47
…orkflows

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

Copilot AI commented Jan 22, 2026

@copilot Merge main and recompile

Done! Merged main branch and recompiled all workflows. The merge conflict in compiler_safe_outputs_config.go has been resolved. Commit: 3e9440e

mdWorkflowNames := make(map[string]bool)
for _, file := range mdFiles {
base := filepath.Base(file)
name := strings.TrimSuffix(base, ".md")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use existing helpers to resolve names of workflows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Refactored to use the existing extractWorkflowNameFromPath helper function instead of manually extracting workflow names. This makes the code more maintainable and consistent with the rest of the codebase. Commit: e012d69

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan January 22, 2026 11:59
@pelikhan pelikhan merged commit 1a45f76 into main Jan 22, 2026
83 checks passed
@pelikhan pelikhan deleted the copilot/fix-gh-aw-status-count branch January 22, 2026 12:05
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.

bug: gh aw status: off by 3 (there are some internal workflows)

2 participants