fix(mcp): pin platform-toolset executor through dispatch#2885
Merged
Conversation
The /platform/mcp/{slug} endpoint matched a toolset entry by name for
listing and feature gating, then dispatched via the URN-keyed registry
on the runtime Service. When a toolset advertises a scoped variant of
a tool that shares its URN with a registry default — assistant-self
configure_trigger vs the non-assistant configure_trigger — the
dispatcher silently swapped to the default, whose input schema demands
fields the scoped tool strips. Result: the assistant's configure call
shipped a valid payload but landed on an executor that rejected it as
"target_ref is required", surfaced as -32603 internal error.
Add a PlatformDirectExecutor hook on PlatformToolCallPlan and have the
platform-toolset endpoint pin it to the already-matched executor. The
runtime prefers the override before falling back to the URN registry,
so the toolset slice becomes the single source of truth for which
executor backs a platform-toolset call.
As a side effect, the assistant list_triggers path now actually
applies its self-scoping filter, since both list and configure were
running as the non-assistant variants under the same wiring bug.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
🦋 Changeset detectedLatest commit: 78be5a0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
🚀 Preview Environment (PR #2885)Preview URL: https://pr-2885.dev.getgram.ai
Gram Preview Bot |
Comments on PlatformDirectExecutor, the runtime override, and the serve_platform pin were narrating the trigger bug rather than the mechanism. Reduced to one short rationale each. Override tests built full AuthContext/ToolDescriptor/ToolCallPlan literals — existing tests in this file use partial literals. Trimmed to match, and pulled the shared plan plumbing into overridePlan.
disintegrator
approved these changes
May 20, 2026
Collapse the two-level `plan.Platform != nil && plan.Platform.Executor != nil` override check by making non-nil Platform part of the ExecuteTool invariant alongside Descriptor.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
configure_triggeron an existing trigger were getting-32603 internal erroron every update. The/platform/mcp/{slug}endpoint matched the assistant-scoped executor from the toolset slice for listing/auth, but then dispatched through the runtime's URN-keyed registry, which had the default (non-assistant) variant registered under the same URN. The default variant requirestarget_kind/target_ref/target_displayin input — fields the assistant schema strips — so the call died withtarget_ref is required, masked as a generic internal error by the platform call wrapper.PlatformDirectExecutoronPlatformToolCallPlanand pins it to the matched executor incallPlatformToolsetTool. The runtime Service prefers the override before falling back to the URN registry, so the toolset slice becomes the single source of truth for platform-toolset dispatch.list_triggersnow applies its self-scoping filter again. Both list and configure were silently running as the non-assistant variants under the same wiring bug; list "worked" only because the default variant has no required input and returned every trigger in the project, including ones owned by sibling assistants.✻ Clauded...