Repository navigation
mcpx: honour ?codemode=false on /mcp — expose raw tools (PLG-35 of #1940) - #2992
Conversation
) ServeHTTP reads codemode=false from the request URL; that request gets the raw surface instead of the code-mode surface: every upstream tool flat under <namespace>_<tool>, gateway tools absent, tools/call routed to the owning upstream under its own name. New mcpserver.RawToolsBackend, implemented by the CLI backend over the visible namespaces (UpstreamTools per namespace); an unlistable namespace fails the whole list rather than serving a partial catalogue. Absence and any other value change nothing. Tests: 5 new HTTP-level cases in internal/mcpserver/codemode_test.go (raw list, unchanged default/other values, call routing, gateway tools refused -32602, unlistable backend/upstream = -32603). go test ./internal/mcpserver/ and ./internal/cli/ pass on the laptop; go vet clean.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 213d74349d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ridge, and list-changed delivery Codex review round on #2992, three P2 threads: - Tasks: runInner now takes the request context and re-applies its raw-surface selection to the task body context. The task store runs the body on a fresh background context, so the inner tools/call was judged against the gateway surface and a validated raw name was refused with -32602. - Ask bridge: daemonAsker.Begin resolves raw names through the new mcpserver.RawToolOf (the request raw lookup, mirroring PassToolOf) to namespace + the upstream own tool name, with client capabilities relayed as on the pass-through path. Raw names previously fell to ErrNotInterruptible and ran with no ask attribution. - Notifications: one predicate, toolsListChangedFor, now decides tools.listChanged in capabilities(), the subscriptions/listen agreement, and the legacy notifier stream. The latter two used only toolsVary(), so a raw request was advertised listChanged:true but never delivered a tools/list_changed. Regression tests cover each fix and were verified to fail pre-fix.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a05c6e6195
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…asks, capabilities, and protocol errors Round-2 Codex review on #2992 (PLG-35 of #1940): - taskSupportOf/legacyTaskSupport now consult the request raw tool definitions, so a raw tool execution.taskSupport is honoured (required -> -32021 without the tasks extension; legacy task-augmented calls follow the declaration instead of always -32601). - mcpBackend.Call forwards DeclaredCapabilities for raw calls (isRawCall via RawToolOf), not only pass-through namespaces, so upstreams narrow by what the caller can answer. - The same direct treatment applies to relayedFault in mcpBackend.Call and to passCall in the ask bridge, so upstream JSON-RPC errors (incl. -32021 with its data) relay as errors instead of flattening into isError results. Tests: TestCodemodeFalseRequiredRawToolWithoutTheExtensionIsMissingCapability, TestCodemodeFalseLegacyTaskAugmentedRawCalls, TestCodemodeFalseAskBridgeRelaysUpstreamProtocolErrors; full mcpserver+cli suites pass on laptop.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbf364f4c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Implements PLG-35 of #1940 (queue task 3240): the daemon's
/mcpendpoint honours?codemode=falseby exposing the raw upstream tools surface instead of the code-mode surface. Absence of the parameter — and any value other than exactlyfalse— changes nothing. This does not close #1940: CODE-53 (docs) and PLG-38 (plugin abort) remain open slices on the issue.What
internal/mcpserver/codemode.go(new): the switch is read once inServeHTTPfrom the request URL and rides the request context. That request'stools/listis every upstream tool, flat, under<namespace>_<tool>(the registry's existing Native spelling); the gateway's own tools are absent from that surface, andtools/callfor a raw name routes to its owning upstream under the upstream's own name viaBackend.Call. Gateway tools called through the raw surface are refused (-32602, via the surface check).mcpserver.RawToolsBackend; collisions that join to the same exposed name are refused rather than silently resolved (same rule as pass-through), and a backend/upstream that cannot be listed is an error (-32603), never a partial catalogue.internal/cli/serve.go:mcpBackend.RawToolslists each visible namespace through the sameUpstreamToolspass-through mode uses.tools.listChangedfollows it on a codemode=false request.docs/mcp.mdgains the per-connection raw surface; register row PLG-35 updated to "honours, does not send" with a dated detail note (mcpx as a client sending the parameter remains open and is recorded there).Tests
New HTTP-level tests in
internal/mcpserver/codemode_test.go(the switch lives on the URL, so they go throughServeHTTP):true/1/FALSEvalues keep the gateway surfacemcpx_execthrough the raw surface is -32602Verified on the laptop:
go test ./internal/mcpserver/pass,go test ./internal/cli/pass,go vetclean,gofmtclean.Refs #1940
Need help on this PR? Tag
@codesmith-botwith what you need.