Repository navigation
fix(server): accept path params longer than 100 characters - #2
Merged
Merged
Conversation
find-my-way defaults maxParamLength to 100, so any route param past that (e.g. long MCP server names on PUT /api/experimental/mcp/:server) returned a bare 404 without reaching its handler. Provide RouterConfig with maxParamLength 512. Fixes anomalyco#53401
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Issue for this PR
Closes anomalyco#53401
Type of change
What does this PR do?
Effect's
HttpRouter.layerbuilds its find-my-way router fromHttpRouter.RouterConfig, which defaults to{}. find-my-way then falls back tomaxParamLength: 100, so any route whose path param exceeds 100 characters never matches and returns a bare 404 before the handler runs. Clients such as T3 Code use MCP server names liket3-code-<threadId>, soPUT /api/experimental/mcp/:serversilently fails for them and those sessions get no MCP tools.makeRoutesinpackages/server/src/routes.tsnow providesRouterConfigwithmaxParamLength: 512to the router layer. This is whatHttpRouter.serve({ routerConfig })does internally, and it applies to every server entry point that goes throughcreateRoutes/createEmbeddedRoutes(process and fetch handler).Server names over 64 characters can still lose their tools for a separate reason (anomalyco#53400). This PR does not touch that.
How did you verify your code works?
packages/server/test/router.test.ts. It requestsGET /api/provider/<300 chars>and asserts that the handler'sProviderNotFoundErrorcomes back, not the router's bare 404. It fails ondevand passes with this change.bun typecheckinpackages/serverpasses.bun testinpackages/server: 80 pass, 3 fail. The 3 failures are OpenAI OAuth callback-port tests that fail identically ondevwithout this change.Screenshots / recordings
N/A, not a UI change.
Checklist