Repository navigation
fix(client): hint at wrong-path agent_uri in discovery failure error (#1234) - #1247
Merged
Merged
Conversation
`SingleAgentClient.discoverMCPEndpoint` only auto-probes `/`, `/mcp`, and `/mcp/`. When the registered `agent_uri` is the host root but the actual MCP endpoint lives at a non-standard path (e.g. `/api/mcp`, `/v1/mcp`), operators see a generic "Failed to discover MCP endpoint" error and typically reach for transport-level debugging when the actual cause is the registration. Append a hint to that error pointing at the most common fix: register the exact MCP path as `agent_uri`. No behavior change. Closes #1234. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous "only probes /, /mcp, and /mcp/" was inaccurate — the SDK auto-appends those suffixes to whatever path is provided, not just the host root. Also surface SSE/legacy paths since FastMCP and reference servers commonly expose MCP at /sse. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
added a commit
that referenced
this pull request
May 2, 2026
Drive-by unblock: this file landed in main via #1247 with a single prettier nit (one-line array got line-broken). The repo-wide `prettier --check` step then fails on every PR. Format-only change.
bokelley
added a commit
that referenced
this pull request
May 2, 2026
…1241) * fix(harness): close stdin on grader spawnSync to prevent 120s hang Closes #1237. `runGrader` invokes the storyboard CLI with `--webhook-receiver` via spawnSync. Empirically the parent saw `status=null signal=SIGTERM stdout=0b stderr=0b` at 120s, while the same args run directly from a shell completed in ~1.3s. Root cause is stdio inheritance, not sync-vs-async spawn. spawnSync without an explicit `stdio` option defaults stdin to `'pipe'` — the child receives an open, never-written stdin pipe. Some libraries the CLI loads probe stdin/TTY state on startup and stall when stdin is a disconnected pipe. Direct shell invocation works because the child inherits the parent's TTY. Fix is one option: `stdio: ['ignore', 'pipe', 'pipe']`. Closes stdin up front so any TTY/stdin probing fast-fails, while keeping stdout/stderr captured for JSON parsing. Also adds a diagnostic log that fires on `signal === 'SIGTERM'` with empty stdout — copy-pasteable repro command so operators don't mistake a harness-level kill for an agent conformance failure. And a one-line note in `docs/guides/VALIDATE-YOUR-AGENT.md` so contributors who hit the timeout from the validate guide know what they're seeing. No changeset: `scripts/manual-testing/` is excluded from the published `files` array. * chore: empty changeset for harness-only #1237 fix `scripts/manual-testing/` is not in `package.json#files`; no published package change. Empty changeset satisfies the changeset-check CI step. * fix(harness): use ETIMEDOUT and bump maxBuffer per pre-merge review Two correctness fixes from code-reviewer + nodejs-testing-expert: - Replace `res.signal === 'SIGTERM' && !res.stdout` with `res.error?.code === 'ETIMEDOUT'`. The signal-only predicate also matches Ctrl-C, OOM kill, external kill, and maxBuffer overflow — none of which deserve the "timed out after 120s" message. Node sets ETIMEDOUT specifically when `options.timeout` fires, on both POSIX and Windows. - Bump `maxBuffer` from the 1 MiB default to 16 MiB. A passing webhook- bundle JSON report approaches the default on its own; on overflow spawnSync kills with SIGTERM and returns *truncated* stdout, which silently mis-grades as fail when JSON.parse trips on the truncation. * chore: prettier-write test/lib/discover-mcp-endpoint-hint.test.js Drive-by unblock: this file landed in main via #1247 with a single prettier nit (one-line array got line-broken). The repo-wide `prettier --check` step then fails on every PR. Format-only change.
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.
Summary
Closes #1234. Appends a hint to the
discoverMCPEndpoint"Failed to discover MCP endpoint" error pointing operators at the most common cause:agent_uriregistered at the host root when the actual MCP endpoint lives at a non-standard path. Five lines, no behavior change.Discovered while investigating #1231 (closed as not-a-bug — root cause was registration mismatch). The original symptom: a dashboard probe showed "agent offline" when the agent was healthy and just registered with the wrong path. Better discovery diagnostics shorten the time-to-fix for the most common operator mistake.
This replaces the closed PR #1244, which bundled a more invasive symmetry-fix that wasn't justified by a reproducible failure. The retry-predicate concern surfaced during that review is filed separately as #1246.
Test plan
npm run typecheck— cleantest/lib/discover-mcp-endpoint-hint.test.jsasserts both the existing failure-list output and the new hint text + example paths