Fix MCP gateway step succeeding when server checks fail#9555
Merged
Conversation
The issue was that when check_mcp_servers.sh was piped through tee, the exit code was ignored because the shell returned tee's exit code (which always succeeds) instead of check_mcp_servers.sh's exit code. This fix enables pipefail before the check and disables it after, so the pipeline returns the exit code of check_mcp_servers.sh. Now when MCP servers fail to connect, the "Start MCP Gateway" step will properly fail as expected. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix MCP gateway check to fail on connection errors
Fix MCP gateway step succeeding when server checks fail
Jan 10, 2026
Contributor
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
Contributor
|
💀 Blimey! Changeset Generator failed and walked the plank! No treasure today, matey! ☠️ |
Contributor
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
Contributor
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Start MCP Gateway" step was succeeding even when all MCP servers failed to connect because the exit code of
check_mcp_servers.shwas being masked by piping throughtee.Changes
pipefailbefore runningcheck_mcp_servers.shso the pipeline returns the check script's exit code instead oftee'spipefailafter the check to avoid affecting other parts of the scriptThe step will now correctly fail when MCP servers cannot be reached, terminating the gateway process and failing the workflow as intended.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.