fix(gsd): validate inline workflow MCP preflight config#809
Merged
Conversation
Contributor
🟢 PR Risk Report — LOW
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Stale last probe error text
- The polling loop now updates lastProbeError from each probe result (including clearing it when a successful probe has no error), so timeout diagnostics reflect the final probe state.
- ✅ Fixed: Inline preflight skips env validation
- normalizeInlineWorkflowMcpServerConfig now populates envWarnings via the shared collectMcpEnvWarnings helper so inline configs fail fast on unset ${ENV} placeholders like name-based lookups.
You can send follow-ups to the cloud agent here.
311977e to
016a05f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Inline transport detection mismatch
- Exported
detectTransportfrom the MCP manager and used it innormalizeInlineWorkflowMcpServerConfigso inline preflight selects the same transport as persisted config normalization.
- Exported
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 016a05f. Configure here.
25715f0 to
7c6dded
Compare
7f8d7c2 to
69b2921
Compare
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.

TL;DR
What: Workflow MCP preflight now probes the same inline MCP server config passed to Claude Code SDK runs.
Why: Issue #808 showed readiness could falsely fail with
Unknown MCP serverwhen the SDK had inline MCP config but persisted project config did not.How: The stream adapter resolves the workflow MCP server from SDK
mcpServers, the readiness probe accepts that inline config, and timeout diagnostics preserve the final useful probe error.What
Closes #808
Why
Claude Code can receive workflow MCP config inline through the SDK while the project has no persisted MCP server by that name. The old readiness preflight only checked persisted config by server name, so it could report tool readiness failure before dispatch even though the SDK run itself had the correct MCP config.
How
stream-adapterselects the workflow MCP server entry from the SDK config and passes it intoawaitWorkflowMcpToolRegistration.tool-surface-readinessnormalizes that inline config using the same manager helpers for env warnings and transport detection, probes it directly, and keeps timeout errors actionable by appending the last relevant probe error.Verification
node --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --test src/resources/extensions/gsd/tests/workflow-mcp-preflight.test.ts src/resources/extensions/claude-code-cli/tests/stream-adapter.test.tslast probe error: Unknown MCP server.pnpm run verify:fast69b2921e6390d96cee0228ea46fdc7f27ad3ac71.Impact analysis
mcpServers.Change type checklist
fix- Bug fixtest- Adding or updating testsdocs- Documentation updatesNote
Medium Risk
Changes Claude Code workflow MCP startup readiness and probing only, but that path is on the critical path before tool-dependent units run; fallback to name-based persisted config remains when no inline config is passed.
Overview
Fixes false workflow MCP readiness failures when Claude Code gets
gsd-workflowonly via inline SDKmcpServers, not from persisted project MCP config (e.g.Unknown MCP serverbefore the first turn).Before starting the SDK query, the stream adapter resolves the workflow server entry with
resolveWorkflowMcpPreflightServerConfigand passes it intoawaitWorkflowMcpToolRegistration. The readiness layer normalizes that inline config (transport detection and env warnings aligned with the MCP manager) and probes that config directly instead of looking up the server by name alone. Preflight timeouts append the last useful probe error; stale errors are cleared when a later probe connects without an error but tools are still missing.detectTransportandcollectMcpEnvWarningsare exported from the MCP manager for reuse. ADR-036 and user docs describe inline preflight behavior. Regression tests cover config resolution, end-to-end preflight with inline config, and timeout diagnostics.Reviewed by Cursor Bugbot for commit 69b2921. Bugbot is set up for automated code reviews on this repo. Configure here.