Publish review_upload as one object so Anthropic accepts it - #621
Merged
Merged
Conversation
OpenCode forwards MCP input schemas to the Anthropic API unchanged, and the API rejects oneOf/anyOf/allOf at the top level of a tool input_schema. The upload tool published its discriminated union verbatim, so enabling Whiteboard broke every request. Claude Code flattens such schemas itself, which hid the problem there. Publish upload as one object with kind as an enum and the kind-specific fields optional; the host still validates the union. Agent-Session: 0e2e21cf-19cf-4e82-b801-11a38760f54a Agent-Session: ffd15b4f-a561-403e-bf42-e841bd247f58
Agent-Session: 0e2e21cf-19cf-4e82-b801-11a38760f54a Agent-Session: ffd15b4f-a561-403e-bf42-e841bd247f58
sidkmenon
approved these changes
Sep 27, 2026
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.
Fixes a user report: with OpenCode, requests fail with
tools.302.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level.The upload tool published
uploadSchema, az.discriminatedUnion, as its input schema, so the JSON Schema had a top-leveloneOf. The Anthropic API rejects that. OpenCode forwards MCP schemas unchanged, so enabling Whiteboard broke every request. Claude Code flattens top-level combinators itself, which is why it kept working there.review_upload/session_uploadnow publish one object:id,repositoryIdandkind(enumimage | trace | map) are required, and the kind-specific fields (base64,trace,pins,side,model) are optional. The flat shape is derived fromuploadSchema.options, so the two can't drift apart.anyOf,oneOforallOf. It failed onsession_uploadbefore this change.Pi is unaffected: its package is a skill that shells out to
whiteboard api, so no MCP schema goes to the model.Verification
vitest run src/review-api: 315 passed.pnpm lintand thepackages/reviewtypecheck are clean.session_uploadwith a flat image payload.anthropic/claude-haiku-4-5against the same stub server: the old tool list reproduces the reportedtools.N.custom.input_schemaerror, and the new one produces a correctsession_uploadcall.gpt-6-solagainst the same stub server: the old and new tool lists produce the samesession_uploadcall. OpenAI accepts the top-leveloneOf, so Codex was never affected.The MCP adapter reads tool schemas from the running host, so users get this fix when their Whiteboard Desktop updates.