fix(runtime): mount /mcp and /keys HTTP routes — were unreachable (ADR-0036)#1631
Merged
Conversation
…R-0036) The dispatcher mounts routes explicitly (no catch-all). #1626 (MCP transport) and #1630 (key-gen) added dispatch() branches but never registered the HTTP routes, so /api/v1/mcp and /api/v1/keys 404'd at the HTTP layer before reaching the dispatcher. Unit tests called handlers directly, hiding it; caught in live staging e2e. - Register /mcp (GET/POST/DELETE) + /keys (POST) via dispatch() in the dispatcher plugin (transport reads the method from the request). - dispatcher-plugin.routes.test.ts asserts the registrations (the missing regression). Full runtime suite 379 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
The dispatcher mounts HTTP routes explicitly (no catch-all). #1626 (MCP transport) and #1630 (key-gen) added branches inside
dispatch()but never registered the matchingserver.<verb>()routes — so/api/v1/mcpand/api/v1/keys404'd at the HTTP layer before reaching the dispatcher. Unit tests called the handlers directly, which hid the gap; it surfaced in live staging e2e (generic{"error":"Not found"}, noroutes.mcpin discovery).Fix
/mcp(GET/POST/DELETE →dispatch(), transport reads the method) and/keys(POST) in the dispatcher plugin, routed throughdispatch()so the host's project-aware kernel swap + executionContext resolution run first.dispatcher-plugin.routes.test.ts— the regression test that asserts the routes are registered (would have caught this).Verify
Full runtime suite 379 green; tsc clean. After merge + cloud bump + a fresh env spawn,
/api/v1/mcpand/api/v1/keysare reachable on staging.🤖 Generated with Claude Code