Skip to content

fix(run.sh): use MCP_GATEWAY_AGENT_ID with deprecated fallback for MCP_GATEWAY_API_KEY#7342

Merged
lpcox merged 3 commits into
mainfrom
copilot/fix-deprecated-env-variable-warning
Jun 11, 2026
Merged

fix(run.sh): use MCP_GATEWAY_AGENT_ID with deprecated fallback for MCP_GATEWAY_API_KEY#7342
lpcox merged 3 commits into
mainfrom
copilot/fix-deprecated-env-variable-warning

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

run.sh was checking for the deprecated MCP_GATEWAY_API_KEY variable, causing a misleading "API authentication disabled" warning for users who correctly set MCP_GATEWAY_AGENT_ID per current documentation.

Changes

  • run.sh: Replace the MCP_GATEWAY_API_KEY check with the same pattern already used in run_containerized.sh:
    • No vars set → warns MCP_GATEWAY_AGENT_ID not set, API authentication disabled
    • Only MCP_GATEWAY_API_KEY set → deprecation warning + auto-maps to MCP_GATEWAY_AGENT_ID
    • Updates the "For production, set:" hint to reference MCP_GATEWAY_AGENT_ID
# Before
if [ -z "$MCP_GATEWAY_API_KEY" ]; then
    log_warn "MCP_GATEWAY_API_KEY not set, API authentication disabled"
    warnings=$((warnings + 1))
fi

# After
if [ -z "$MCP_GATEWAY_AGENT_ID" ] && [ -z "$MCP_GATEWAY_API_KEY" ]; then
    log_warn "MCP_GATEWAY_AGENT_ID not set, API authentication disabled"
    warnings=$((warnings + 1))
elif [ -z "$MCP_GATEWAY_AGENT_ID" ] && [ -n "$MCP_GATEWAY_API_KEY" ]; then
    log_warn "MCP_GATEWAY_API_KEY is deprecated; please rename it to MCP_GATEWAY_AGENT_ID"
    export MCP_GATEWAY_AGENT_ID="$MCP_GATEWAY_API_KEY"
fi

Copilot AI linked an issue Jun 10, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix deprecation warning for MCP_GATEWAY_API_KEY in run.sh fix(run.sh): use MCP_GATEWAY_AGENT_ID with deprecated fallback for MCP_GATEWAY_API_KEY Jun 10, 2026
Copilot finished work on behalf of lpcox June 10, 2026 23:54
Copilot AI requested a review from lpcox June 10, 2026 23:54
@lpcox lpcox marked this pull request as ready for review June 11, 2026 00:05
Copilot AI review requested due to automatic review settings June 11, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates run.sh’s optional environment validation to prefer MCP_GATEWAY_AGENT_ID (as documented) while still accepting the deprecated MCP_GATEWAY_API_KEY as a fallback, eliminating a misleading warning for correctly configured users.

Changes:

  • Switch run.sh to check MCP_GATEWAY_AGENT_ID first, with a deprecated fallback mapping from MCP_GATEWAY_API_KEY.
  • Update the “For production, set:” hint to reference MCP_GATEWAY_AGENT_ID instead of MCP_GATEWAY_API_KEY.
Show a summary per file
File Description
run.sh Aligns env-var validation with current docs by preferring MCP_GATEWAY_AGENT_ID and supporting a deprecated fallback from MCP_GATEWAY_API_KEY.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread run.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

📚 Documentation Reconciliation Report - 2026-06-10

3 participants