You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
experimental.ts uses zodToJsonSchema which is broken with Zod v4 #20807
server/routes/experimental.ts line 87 uses zodToJsonSchema() from [email protected] to convert tool parameter schemas for the HTTP API. This library is incompatible with Zod v4 — it returns garbage output for object schemas.
Example: a Zod v4 object schema with two string properties produces {"type": "string", "$schema": "http://json-schema.org/draft-07/schema#"} instead of the correct object schema. All property definitions, descriptions, and required fields are lost.
The prompt path (session/prompt.ts line 440) correctly uses z.toJSONSchema() which works with Zod v4. The experimental API endpoint should use the same method.
Related: #4357 (original report about lost descriptions, now fixed in the prompt path by Zod v4)
Steps to reproduce
Define a custom tool with described parameters
Query the experimental tools endpoint (GET /experimental/tools?provider=...&model=...)
Observe the returned parameter schemas are incorrect
Activity
fix(opencode): replace zodToJsonSchema with z.toJSONSchema for Zod v4…
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.