Conversation
Meta's Model API rejects tool schemas nested deeper than 10 levels and fails the whole request instead of the offending tool, so one deep MCP tool (the Vercel MCP server publishes twelve) breaks every request for Muse Spark, both on the `meta` provider and through the opencode gateways. Drop the members that would nest past the limit for Meta/Muse models. Every other keyword stays on the node, so a lowered tool keeps its shape and stays callable instead of failing the request.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
This was referenced Sep 27, 2026
This branch has not been deployed
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 #50297
Type of change
What does this PR do?
Meta's Model API rejects tool schemas nested deeper than 10 levels and fails the whole request instead of the offending tool, so a single deep MCP tool (the Vercel MCP server publishes twelve) breaks every request for Muse Spark, both on the
metaprovider and through the opencode gateways.ProviderTransform.schemaalready lowers schemas per provider for OpenAI, Moonshot and Gemini; this adds the missing Meta/Muse pass. It keeps the schema within the nesting limit by dropping the members (properties,items,additionalProperties,anyOf/oneOf/allOf,$defs/definitions) that would nest past it, so every other keyword stays on the node and a lowered tool keeps its shape instead of failing the request.Depth is counted the way the issue measures it: the tool parameter root is level 0 and every member step below it adds one level. The deepest schema that survives is 9 steps below the root, i.e. 10 levels counting the root — the tools the issue reports as failing at depth 10.
How did you verify your code works?
bun test test/provider/transform.test.ts— 569 pass, including the new cases: a depth-14 property chain, combiner/array/additionalPropertiesbranches, a deep$defssubtree, a schema already within the limit (unchanged) and a non-Meta provider (unchanged).bun run typecheckis clean.Only
meta/musemodels are affected, so no other provider's tool schemas change.Screenshots / recordings
Not a UI change.
Checklist