Skip to content

Fix: Remove env_vars from HTTP MCP server config for safe-inputs#8244

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-gh-aw-action-step
Dec 31, 2025
Merged

Fix: Remove env_vars from HTTP MCP server config for safe-inputs#8244
pelikhan merged 2 commits intomainfrom
copilot/fix-gh-aw-action-step

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Fixed workflow failure at step 39 ("Ingest agent output") in daily-performance-summary workflow caused by invalid MCP server configuration.

Root Cause

Used the audit tool to download logs from workflow run 20610417177. The error was:

Error loading config.toml: env_vars is not supported for streamable_http
in `mcp_servers.safeinputs`

The safe-inputs MCP server was configured with type: http but incorrectly included env_vars in the TOML configuration. The MCP protocol does not support env_vars for HTTP transport - environment variables must be passed via the workflow job's env: section instead.

Changes Made

Fixed in pkg/workflow/mcp_renderer.go:

  • Removed lines 247-256 that generated env_vars for HTTP safe-inputs config
  • Added comment explaining why env_vars is not supported for HTTP transport
  • Environment variables are correctly passed via the job's env section

Updated tests in pkg/workflow/safe_inputs_http_codex_test.go:

  • Changed tests to verify env_vars is NOT in HTTP MCP config (was incorrectly testing for the bug)
  • Tests now verify environment variables are only in the job's env section
  • Both TestCodexSafeInputsHTTPTransport and TestCodexSafeInputsWithSecretsHTTPTransport now pass

Recompiled workflow:

  • .github/workflows/daily-performance-summary.lock.yml updated without env_vars in safe-inputs config

Testing

  • ✅ Downloaded and analyzed error logs using gh-aw audit 20610417177
  • ✅ Identified root cause: env_vars in HTTP MCP config
  • ✅ All unit tests pass
  • ✅ Workflow compiles without errors
  • ✅ Validated fix addresses the exact error from the logs

Before

[mcp_servers.safeinputs]
type = "http"
url = "http://host.docker.internal:$GH_AW_SAFE_INPUTS_PORT"
headers = { Authorization = "Bearer $GH_AW_SAFE_INPUTS_API_KEY" }
env_vars = ["GH_AW_SAFE_INPUTS_PORT", "GH_AW_SAFE_INPUTS_API_KEY", "GH_TOKEN"]  # ❌ Not supported

After

[mcp_servers.safeinputs]
type = "http"
url = "http://host.docker.internal:$GH_AW_SAFE_INPUTS_PORT"
headers = { Authorization = "Bearer $GH_AW_SAFE_INPUTS_API_KEY" }
# Environment variables passed via job env section instead

This fix resolves the workflow failure at step 39 ("Ingest agent output") in the daily-performance-summary workflow.

[!WARNING]

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20610417177/job/59193791309#step:39:1

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance


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

Copilot AI changed the title [WIP] Fix action step issue in gh-aw Investigation: workflow run 20610417177 step 39 failure - no reproducible issues found Dec 31, 2025
Copilot AI requested a review from pelikhan December 31, 2025 02:43
@pelikhan
Copy link
Contributor

@copilot use audit tool to download error logs

The error "env_vars is not supported for streamable_http" was caused by
including env_vars in the HTTP-based safe-inputs MCP server configuration.

Fixed by:
- Removing env_vars generation in renderSafeInputsTOML() in mcp_renderer.go
- Updated tests to verify env_vars is NOT in HTTP MCP config
- Environment variables are correctly passed via job's env section instead

This resolves the workflow run failure at step 39 (Ingest agent output).

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

Copilot AI commented Dec 31, 2025

@copilot use audit tool to download error logs

Downloaded logs using audit tool. Found the error:

Error loading config.toml: env_vars is not supported for streamable_http
in `mcp_servers.safeinputs`

Fixed in commit d78fab4:

  • Removed env_vars from HTTP MCP server config (not supported for HTTP transport)
  • Updated tests to verify correct behavior
  • Environment variables now correctly passed via job env section only

The workflow should now run successfully.

Copilot AI changed the title Investigation: workflow run 20610417177 step 39 failure - no reproducible issues found Fix: Remove env_vars from HTTP MCP server config for safe-inputs Dec 31, 2025
@pelikhan pelikhan marked this pull request as ready for review December 31, 2025 03:02
@pelikhan pelikhan merged commit ff4bcda into main Dec 31, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-gh-aw-action-step branch December 31, 2025 03:03
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