Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Daily News workflow failing at Step 31 (Start MCP gateway) with configuration error: TAVILY_API_KEY environment variable undefined despite being referenced in the Tavily MCP server configuration.

Root Cause

The compiler's collectMCPEnvironmentVariables function only collected environment variables for known tools (github, playwright, safe-outputs, etc.) but skipped custom HTTP MCP servers from imports.

When the gateway starts, it validates the MCP configuration and resolves ${VAR} references. If a variable is missing from the step environment, startup fails.

Changes

Compiler (pkg/workflow/mcp_servers.go)

  • Extended collectMCPEnvironmentVariables to iterate through all tools and extract secrets from HTTP MCP server headers
  • Uses existing ExtractSecretsFromMap to parse ${{ secrets.* }} expressions
  • Also extracts from env sections for future HTTP MCP server support

Example: For this MCP server configuration:

mcp-servers:
  tavily:
    type: http
    url: "https://mcp.tavily.com/mcp/"
    headers:
      Authorization: "Bearer ${{ secrets.TAVILY_API_KEY }}"

The compiler now adds to the "Start MCP gateway" step:

env:
  TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}

Workflow Lock File

  • Recompiled daily-news.lock.yml with TAVILY_API_KEY now in gateway startup environment

Tests

  • Added http_mcp_env_vars_test.go covering single/multiple HTTP MCP servers with/without secrets
Original prompt

This section details on the original issue you should resolve

<issue_title>[deep-report] Stabilize Daily News workflow MCP gateway startup</issue_title>
<issue_description>Description: Weekly workflow analysis shows Daily News at 0% success due to MCP gateway startup failures (Step 31). Investigate the gateway startup configuration in .github/workflows/daily-news.lock.yml and add a recovery or validation step to prevent hard failures.

Expected Impact: Restores Daily News to steady green runs and reduces repeated failure noise in audits.

Suggested Agent: Daily News workflow owner

Estimated Effort: Medium (1-4 hours)

Data Source: DeepReport Intelligence Briefing 2026-01-20; discussion #10669 (run §21131810833).

AI generated by DeepReport - Intelligence Gathering Agent

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 21, 2026 00:04
Extracts secrets from HTTP MCP servers (like Tavily) and adds them to the
Start MCP gateway step's environment. This resolves the gateway startup
failure caused by missing TAVILY_API_KEY environment variable.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Tests verify that secrets from HTTP MCP server headers are correctly
extracted and added to the Start MCP gateway step environment.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MCP gateway startup failures in Daily News workflow Fix MCP gateway startup by extracting HTTP MCP server environment variables Jan 21, 2026
Copilot AI requested a review from mnkiefer January 21, 2026 00:18
@pelikhan pelikhan marked this pull request as ready for review January 21, 2026 00:23
@pelikhan
Copy link
Contributor

@copilot forma, lint

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

@copilot merge main, format, lint go, fix tests

@pelikhan
Copy link
Contributor

@copilot merge main, format lint

@pelikhan
Copy link
Contributor

@copilot merge main, format lint

@pelikhan
Copy link
Contributor

@copilot merge main, format, lint

@pelikhan
Copy link
Contributor

@copilot merge main, format, lint

@pelikhan
Copy link
Contributor

@copilot merge main, format, lint

@pelikhan
Copy link
Contributor

@copilot merge main, format, lint

@pelikhan pelikhan merged commit dee7a77 into main Jan 21, 2026
48 checks passed
@pelikhan pelikhan deleted the copilot/stabilize-daily-news-gateway branch January 21, 2026 12:35
Copilot stopped work on behalf of pelikhan due to an error January 21, 2026 12:35
@dereklegenzoff
Copy link

@copilot - explain what we did in this PR

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.

[deep-report] Stabilize Daily News workflow MCP gateway startup

4 participants