Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

The MCP gateway download step in release mode now uses the install-awmg.sh script from the main branch instead of manually implementing platform detection and gh CLI downloads.

Changes

Modified pkg/workflow/gateway.go:

  • Downloads install-awmg.sh from main branch via curl
  • Uses the CLI's embedded version from GetVersion() and IsRelease() helpers to determine which version to download
  • Checks if awmg is already installed at $HOME/.local/bin/awmg before downloading to avoid unnecessary downloads
  • If the CLI is a release build, passes the CLI version to the install script
  • If the CLI is not a release build, downloads the latest version
  • Sets AWMG_CMD to $HOME/.local/bin/awmg after installation

Key Implementation

The function checks for existing awmg installations before downloading:

# Check if awmg is already in PATH
if command -v awmg &> /dev/null; then
  echo 'awmg is already available in PATH'
  echo "AWMG_CMD=awmg" >> $GITHUB_ENV
# Check for local awmg build
elif [ -f "./awmg" ]; then
  echo 'Using existing local awmg build'
  echo "AWMG_CMD=./awmg" >> $GITHUB_ENV
# Check if awmg is already installed at $HOME/.local/bin/awmg
elif [ -f "$HOME/.local/bin/awmg" ]; then
  echo 'awmg is already installed at $HOME/.local/bin/awmg'
  echo "AWMG_CMD=$HOME/.local/bin/awmg" >> $GITHUB_ENV
else
  # Download and install awmg
  ...
fi

The version selection uses the CLI's embedded Go code:

// Use the release tag from the CLI version if this is a release build
version := GetVersion()
if IsRelease() && version != "" && version != "dev" {
    gatewayLog.Printf("Using CLI release version: %s", version)
    stepLines = append(stepLines,
        "            # Download awmg for CLI release version: "+version,
        fmt.Sprintf("            /tmp/install-awmg.sh %s", version),
    )
} else {
    gatewayLog.Print("CLI is not a release build, downloading latest awmg")
    stepLines = append(stepLines,
        "            # Download latest awmg release (CLI is not a release build)",
        "            /tmp/install-awmg.sh",
    )
}

Examples

When compiled with gh-aw v1.2.3 (release build):

# Download awmg for CLI release version: v1.2.3
/tmp/install-awmg.sh v1.2.3

When compiled with gh-aw dev build:

# Download latest awmg release (CLI is not a release build)
/tmp/install-awmg.sh

This approach ensures:

  • Version consistency between the CLI and MCP gateway binary
  • Workflows compiled with gh-aw v1.2.3 will consistently use awmg v1.2.3
  • The generated code is specialized based on the compile-time release mode
  • Dev builds always get the latest version
  • Avoids unnecessary downloads when awmg is already installed

This centralizes installation logic in the script rather than duplicating platform detection and download logic in the compiled workflow.

[!WARNING]

Original prompt

Update the "Download MCP gateway" step code in release mode to use the install-awmg.sh script from main to download the awmg cli executable. Pass the release tag if available in the cli.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Changeset

  • Type: patch
  • Description: Use install-awmg.sh from main to download the awmg MCP gateway binary in release mode; checks for existing installations before downloading and passes the CLI release version when available to ensure version consistency.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot generateMCPGatewayDownloadStep should generate specialized shell script code based on the release mode. It should change the generated code base on the mode.

Copilot AI changed the title [WIP] Update download MCP gateway step code to use install-awmg.sh Use install-awmg.sh script for MCP gateway binary downloads in release mode Jan 6, 2026
Copilot AI requested a review from pelikhan January 6, 2026 07:22
The release tag should be detected at runtime in the shell script based on GITHUB_REF, not at compile time in Go using GetCurrentGitTag(). This ensures that the same compiled workflow can adapt to different release contexts when it actually runs.

Co-authored-by: pelikhan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot generateMCPGatewayDownloadStep should generate specialized shell script code based on the release mode. It should change the generated code base on the mode.

Fixed in 3fab956. The function now generates shell script code that detects the release tag at runtime using $GITHUB_REF, rather than detecting it at compile time. The generated code is now consistent regardless of when/where the workflow is compiled, and adapts to the actual GitHub Actions context at runtime.

Copilot AI requested a review from pelikhan January 6, 2026 07:31
@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot use the release tag stored in the cli GO code itself, not GITHUB_REF. Use the helper to determine if isRelease

The release tag is now determined from the CLI's embedded version (GetVersion() and IsRelease()) rather than detecting it from GITHUB_REF at runtime. This ensures that workflows compiled with gh-aw v1.2.3 will download awmg v1.2.3, maintaining version consistency between the CLI and MCP gateway binary.

Co-authored-by: pelikhan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot use the release tag stored in the cli GO code itself, not GITHUB_REF. Use the helper to determine if isRelease

Fixed in 6a8a36a. The function now uses GetVersion() and IsRelease() helpers to determine the version from the CLI's embedded Go code. When compiled with a release build (e.g., v1.2.3), it generates code that passes that version to install-awmg.sh. For dev builds, it downloads the latest version.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot check if awmg is already available before using the install script.

Added a check for $HOME/.local/bin/awmg before downloading the install-awmg.sh script. If awmg is already installed at that location, the workflow will skip the download and use the existing binary, saving time and bandwidth.

Co-authored-by: pelikhan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot check if awmg is already available before using the install script.

Fixed in e2b71bd. Added a check for $HOME/.local/bin/awmg before downloading the install script. If awmg is already installed at that location, the workflow skips the download and uses the existing binary.

@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 07:51
@pelikhan pelikhan added the smoke label Jan 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results

File Writing Test: Successfully created /tmp/gh-aw/agent/smoke-test-copilot-20741850197.txt
Bash Tool Test: File read back successfully with timestamp
Safe Input gh Tool Test: safeinputs-gh tool not available in workflow

Overall Status: ⚠️ PARTIAL PASS (2/3 tests passed)

Note: safeinputs-gh tool may need to be configured in workflow definition

AI generated by Smoke Copilot Safe Inputs

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results - Copilot Engine

Last 2 merged PRs:

GitHub MCP Testing - Retrieved PR data successfully
File Writing - Created /tmp/gh-aw/agent/smoke-test-copilot-20741850185.txt
Bash Tool - Read file successfully
GitHub MCP Default Toolset - get_me correctly unavailable (403 error as expected)
Cache Memory - Created /tmp/gh-aw/cache-memory/smoke-test-20741850185.txt
Web Fetch - Retrieved GitHub API data (valid JSON)
Tools Available - Verified all workflow tools accessible

Overall Status: PASS

cc: @pelikhan

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

PRs: [WIP] Split daily-news shell script into multiple steps; Replace manual prompt handling with console.ConfirmAction in trial command
✅ OpenAI curl blocked
✅ GitHub MCP (fetched 2 merged PR titles)
✅ File write/read (/tmp/gh-aw/agent/smoke-test-codex-firewall-20741850214.txt)
✅ example.com blocked
Network: SANDBOXED
Overall: PASS

AI generated by Smoke Codex Firewall

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results

  • ❌ Playwright MCP: Module not installed
  • ✅ Cache Memory: Successfully wrote and read test file
  • ❌ Safe Input GH Tool: Tool not available in this workflow configuration

Status: FAIL

Details: Playwright module not found, safe-input gh tool not configured in workflow.

AI generated by Smoke Copilot Playwright

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Claude Smoke Test Results

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP - Retrieved PR data with pagination
✅ File Writing - Created /tmp/gh-aw/agent/smoke-test-claude-20741850231.txt
✅ Bash Tool - Verified file creation successful
✅ Playwright MCP - Navigated to GitHub, title contains "GitHub"
✅ Cache Memory - Created /tmp/gh-aw/cache-memory/smoke-test-20741850231.txt
❌ Safe Input gh Tool - Tool not configured (gh CLI available but not exposed via MCP)

Overall Status: PASS (5/6 tests successful, 1 test N/A)

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke test results:
PRs: [WIP] Split daily-news shell script into multiple steps | Replace manual prompt handling with console.ConfirmAction in trial command
GitHub MCP fetch merged PRs ✅
File write/read + cat ✅
Playwright github.com title ✅
Cache memory write/read ✅
safeinputs-gh issues list ❌ (safeinputs-gh command not found)
Overall: FAIL

AI generated by Smoke Codex

@pelikhan pelikhan closed this Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants