Skip to content

fix(mcp): expect the server-named crash error in the installer MCP harness - #5405

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:fix/mcp-harness-crash-error
Oct 19, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:fix/mcp-harness-crash-error

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Build Installers has been red on main since #5346. Its custom-agent MCP harness fails on both Windows and Ubuntu. That PR made a crashed MCP server's error name the server and the program it ran, but the harness still expected the old message, which didn't name either. The new message is easier to diagnose, so this updates the test instead of reverting the product change. The test now also checks that the error shows only the program's file name, not its directory or launch arguments.

🔍 Technical details
  • The expected text is built from os.path.basename(sys.executable) (python / python.exe), so it holds on every runner.
  • A slow interpreter outlives the 0.1 s startup check and dies during initialize instead, so the same diagnostic arrives as Error during initialization: … rather than Transport error for 'dummy': …. That race predates fix(mcp): stop a hung MCP stdio server from freezing the turn #5346 (CI wins it, a slower dev box doesn't). The test accepts either wrapper and still pins the diagnostic exactly.

Test plan

  • python -m pytest tests/installer/test_custom_agent_mcp_harness.py passes locally (Windows)
  • python util/lint.py --black --isort
  • Build Installers → Custom agent MCP harness passes on windows-latest and ubuntu-latest

…rness

The custom-agent MCP harness failed on main on Windows and Ubuntu: amd#5346
made a crashed stdio server's error name the server and its program
("MCP server 'dummy (python)' process died (exit code: 17)"), and the
harness still expected the old unnamed text. The message got better, so
the expectation is updated rather than the product.

The harness now also checks that the error shows the program by file
name only, without its directory or arguments, and accepts both wrappers
a crash can arrive in: a slow interpreter outlives the 0.1 s startup check
and dies during initialize instead, which made the test fail locally.
@github-actions github-actions Bot added the tests Test changes label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

This test-only fix brings the installer's MCP harness back in line with the clearer crash message added in #5346. That message now names the server and the program it ran. The new expectation matches what the product code actually produces, and the test gained a useful extra guarantee: the error never leaks the interpreter's directory or its launch arguments. Nothing blocks merge.

Real-world evidence

N/A: this PR only changes a test, so no evidence bundle was produced. The verdict rests on static review. I checked the expected strings against the MCP client and stdio transport source. The pytest run couldn't execute on this runner (pytest isn't installed in its Python), so the Build Installers checks on Windows and Ubuntu are the proof to wait for.

🔍 Technical details

Issues found: none blocking.

Verification

  • stdio.py:625 emits MCP server '{self.label}' process died (exit code: …). label (stdio.py:201-213) gives "dummy (<basename>)" when there are args and the command resolves to a real file. sys.executable always does, so os.path.basename(sys.executable) matches on every runner.
  • Both accepted wrappers exist: Transport error for '…': {e} (mcp_client.py:501) and Error during initialization: {e} (mcp_client.py:540). Accepting either covers the existing startup-check race without loosening the diagnostic itself.
  • os was already imported.

Strengths

  • The test now uses an argument the error must not echo (--token=harness-secret-marker) and checks that the interpreter's directory doesn't appear either. So it pins the redaction behaviour from fix(mcp): stop a hung MCP stdio server from freezing the turn #5346, not just the wording.
  • Popping error and comparing the rest of the dict exactly keeps the other status fields fully checked.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 19, 2026
Merged via the queue into amd:main with commit b458622 Oct 19, 2026
25 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/mcp-harness-crash-error branch October 19, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant