Skip to content

Skip redundant gh-aw extension installation when provided by imports - #6111

Merged
mnkiefer merged 4 commits into
mainfrom
copilot/remove-install-gh-aw-step
Dec 11, 2025
Merged

mnkiefer merged 4 commits into
mainfrom
copilot/remove-install-gh-aw-step

Conversation

Copilot AI commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

Workflows using the agentic-workflows tool that import shared/mcp/gh-aw.md were getting duplicate installation steps: one from the import (via make install) and one auto-generated by the compiler (via gh extension install githubnext/gh-aw).

Changes

  • pkg/workflow/mcp_servers.go: Check ImportedFiles for shared/mcp/gh-aw.md before generating installation step
  • pkg/workflow/agentic_workflow_test.go: Add tests verifying skip logic for both scenarios (with/without import)
  • portfolio-analyst.md: Remove redundant agentic-workflows: tool declaration since the import already provides it
  • workflows: Recompile to remove redundant steps where applicable

Recommended Patterns

After these changes, there are two recommended patterns:

Pattern 1: Just tools: agentic-workflows:

  • Installs public gh-aw extension from GitHub
  • Use when you only need the agentic-workflows tool in your AI agent

Pattern 2: Import shared/mcp/gh-aw.md

  • Builds gh-aw from local source (make install)
  • Use when you need gh aw commands in pre-download steps OR testing local changes
  • The import already provides the agentic-workflows tool, so no need to declare it separately in tools

Example

Before (portfolio-analyst.lock.yml):

- name: Install binary as 'gh-aw'    # from import
  run: make install
# ...
- name: Install gh-aw extension      # redundant, auto-generated
  run: gh extension install githubnext/gh-aw

After:

- name: Install binary as 'gh-aw'    # from import only
  run: make install

Workflows without the import continue to get the auto-generated installation step as before.

Original prompt

See: https://github.com/githubnext/gh-aw/actions/runs/20127255038/job/57759729982
We don't need step Install gh-aw extension.


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

@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot, we no longer need imports: - shared/mcp/gh-aw.md if we have tools: agentic-workflows:? What is the preferred pattern?

Copilot AI changed the title [WIP] Remove step to install gh-aw extension Skip redundant gh-aw extension installation when provided by imports Dec 11, 2025
Copilot AI requested a review from mnkiefer December 11, 2025 09:20
@mnkiefer
mnkiefer marked this pull request as ready for review December 11, 2025 09:24

Copilot AI commented Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

@copilot, we no longer need imports: - shared/mcp/gh-aw.md if we have tools: agentic-workflows:? What is the preferred pattern?

Good question! After my changes, there are now two patterns:

Pattern 1: Just tools: agentic-workflows: (e.g., example-workflow-analyzer.md)

  • Installs public gh-aw extension from GitHub
  • MCP server runs via gh aw mcp-server
  • Use when you only need the agentic-workflows tool in your AI agent

Pattern 2: Import shared/mcp/gh-aw.md (e.g., portfolio-analyst.md)

  • Builds gh-aw from local source (make install)
  • Sets up Go + dev dependencies
  • Starts MCP server on localhost:8765
  • Use when you need gh aw commands in pre-download steps OR when testing local changes

Currently portfolio-analyst.md has BOTH (line 15 + line 31), which creates duplicate MCP servers. The import is needed because line 23 uses gh aw logs in a pre-download step.

Recommendation: Keep the import for portfolio-analyst since it uses gh aw logs in pre-download. For workflows that only use the tool within the AI agent (not in pre-download), just tools: agentic-workflows: is sufficient.

Should we remove the redundant agentic-workflows: tool declaration from portfolio-analyst since the import already provides it?

@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot Yes, remove the redundant agentic-workflows: tool declaration from portfolio-analyst since the import already provides it.

Copilot AI commented Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Yes, remove the redundant agentic-workflows: tool declaration from portfolio-analyst since the import already provides it.

Done in c12dc2d. Removed the redundant agentic-workflows: tool declaration from portfolio-analyst.md. The workflow now only uses the gh-aw MCP server provided by the import, eliminating the duplicate server configuration.

@mnkiefer
mnkiefer merged commit 37fc639 into main Dec 11, 2025
@mnkiefer
mnkiefer deleted the copilot/remove-install-gh-aw-step branch December 11, 2025 09:44
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