You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logs MCP tool (and gh aw logs CLI command) fails with an unhelpful error message when GitHub CLI authentication is not configured. The underlying gh run list command exits with status 1 and prints an actionable message to stderr, but this information is not surfaced to the user.
Command/Tool
Tool: logs
MCP error: McpError: MCP error -32603: calling "tools/call": failed to download workflow logs: exit status 1
Steps to Reproduce
Run the logs MCP tool in an environment where GH_TOKEN/GITHUB_TOKEN is not set
Observe the error output
MCP server 'agenticworkflows': McpError: MCP error -32603: calling "tools/call": failed to download workflow logs: exit status 1
```
## Expected Behavior
The error should include the underlying reason from the `gh` CLI, such as:
```
failed to download workflow logs: GitHub CLI authentication required.
To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable.
Example: env: GH_TOKEN: $\{\{ github.token }}
Actual Behavior
The error message exit status 1 is opaque and gives no indication of what went wrong or how to fix it. Users are left to guess why logs download failed.
Root Cause
The logs download command runs gh run list (or similar), which exits with status 1 and prints an actionable message to stderr. However, the calling code only captures the exit code without capturing stderr output.
Fix Suggestion
Capture the combined stdout/stderr from the gh CLI subprocess and include it in the error message. Using cmd.CombinedOutput() instead of cmd.Run() (or ensuring stderr is captured) would surface the actionable message from gh.
Environment
Repository: github/gh-aw
Run ID: 22979850751
Date: 2026-03-11
gh version: 2.87.3
Impact
Severity: Medium
Frequency: Always (when GH_TOKEN is not set)
Workaround: Ensure GH_TOKEN or GITHUB_TOKEN is set in the environment
Additional Context
This was discovered during daily exploratory testing of the audit, logs, and compile MCP tools. The compile and audit tools work correctly. All logs-related test cases (basic download, filtered queries, edge cases) failed with the same cryptic error, making it impossible to verify log download functionality without first diagnosing the authentication issue manually.
Problem Description
The
logsMCP tool (andgh aw logsCLI command) fails with an unhelpful error message when GitHub CLI authentication is not configured. The underlyinggh run listcommand exits with status 1 and prints an actionable message to stderr, but this information is not surfaced to the user.Command/Tool
logsMcpError: MCP error -32603: calling "tools/call": failed to download workflow logs: exit status 1Steps to Reproduce
logsMCP tool in an environment whereGH_TOKEN/GITHUB_TOKENis not setActual Behavior
The error message
exit status 1is opaque and gives no indication of what went wrong or how to fix it. Users are left to guess why logs download failed.Root Cause
The logs download command runs
gh run list(or similar), which exits with status 1 and prints an actionable message to stderr. However, the calling code only captures the exit code without capturing stderr output.Fix Suggestion
Capture the combined stdout/stderr from the
ghCLI subprocess and include it in the error message. Usingcmd.CombinedOutput()instead ofcmd.Run()(or ensuring stderr is captured) would surface the actionable message fromgh.Environment
Impact
GH_TOKENorGITHUB_TOKENis set in the environmentAdditional Context
This was discovered during daily exploratory testing of the
audit,logs, andcompileMCP tools. Thecompileandaudittools work correctly. All logs-related test cases (basic download, filtered queries, edge cases) failed with the same cryptic error, making it impossible to verify log download functionality without first diagnosing the authentication issue manually.Warning
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.