opencode/packages
Developer d3a69ad910 fix(mcp): tolerate invalid tool output schemas
Closes #26529.

When an MCP server returns a tool whose \`outputSchema\` contains a
broken \`$ref\` (e.g. Google Stitch's \`#/$defs/ScreenInstance\`), the
SDK's typed \`listTools()\` validator throws and opencode marks the
ENTIRE server as failed — losing every other valid tool the server
exposes.

Catch the schema-reference errors and retry with a tolerant schema
(\`looseObject\` + \`outputSchema: z.unknown().optional()\`) via the raw
\`request\` path so the bad tool's schema is accepted as opaque while
the others load normally.

Equivalent fix shape to #26530 (nicolascancino) — kept his approach
since it's correct. Bundles our reproducer test from
\`kit/issue-reproducers\` so the regression is locked in.

Verified red → green → red → green:
- pre-fix: server marked \`failed\`
- post-fix: server stays \`connected\`, valid tool present
2026-05-09 19:00:34 -04:00
..
app fix(session): accept legacy summary diffs (#26579) 2026-05-09 16:44:24 -04:00
console sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
containers chore: bump Bun to 1.3.13 (#23791) 2026-04-23 00:25:36 -04:00
core Move schema utilities into core (#26565) 2026-05-09 19:51:09 +00:00
desktop sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
docs
enterprise sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
extensions/zed sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
function sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
http-recorder sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
identity
llm sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
opencode fix(mcp): tolerate invalid tool output schemas 2026-05-09 19:00:34 -04:00
plugin Plugin command API shim (#26564) 2026-05-09 21:56:49 +02:00
script
sdk fix(sdk): wrap thrown error bodies in Error 2026-05-09 18:46:43 -04:00
slack sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00
storybook feat(prompt): add shell mode UI with cancel button, custom icon, and example placeholder (#24105) 2026-04-24 14:04:55 +08:00
ui fix(session): accept legacy summary diffs (#26579) 2026-05-09 16:44:24 -04:00
web sync release versions for v1.14.44 2026-05-09 19:33:26 +00:00