Umesh Yadav and Peter Tripp
4c411b9fc8
language_models: Make JsonSchemaSubset the default tool_input_format for the OpenAI-compatible provider ( #34921 )
...
Closes #30188
Closes #34911
Closes #34906
Many OpenAI-compatible providers do not automatically filter the tool
schema to comply with the underlying model's requirements; they simply
proxy the request. This creates issues, as models like **Gemini**,
**Grok**, and **Claude** (when accessed via LiteLLM on Bedrock) are
incompatible with Zed's default tool schema.
This PR addresses this by defaulting to a more compatible schema subset
instead of the full schema.
### Why this approach?
* **Avoids Poor User Experience:** One alternative was to add an option
for users to manually set the JSON schema for models that return a `400
Bad Request` due to an invalid tool schema. This was discarded as it
provides a poor user experience.
* **Simplifies Complex Logic:** Another option was to filter the schema
based on the model ID. However, as demonstrated in the attached issues,
this is unreliable. For instance, `claude-4-sonnet` fails when proxied
through LiteLLM on Bedrock. Reliably determining behavior would require
a non-trivial implementation to manage provider-and-model combinations.
* **Better Default Behavior:** The current approach ensures that tool
usage works out-of-the-box for the majority of cases by default,
providing the most robust and user-friendly solution.
Release Notes:
- Improved tool compatibility with OpenAI API-compatible providers
Signed-off-by: Umesh Yadav <git@umesh.dev >
Co-authored-by: Peter Tripp <peter@zed.dev >
2025-09-02 14:29:07 -04:00
..
2025-09-02 08:48:33 +00:00
2025-08-25 16:04:44 -06:00
2025-08-20 14:07:37 +02:00
2025-09-02 16:51:13 +02:00
2025-08-26 13:55:09 +00:00
2025-09-02 08:48:33 +00:00
2025-09-02 08:48:33 +00:00
2025-09-01 18:42:33 -04:00
2025-09-02 16:39:55 +00:00
2025-09-02 16:51:13 +02:00
2025-08-28 12:00:44 +00:00
2025-08-19 21:26:17 +02:00
2025-08-13 13:25:52 -06:00
2025-08-20 12:20:13 +02:00
2025-08-27 23:24:19 +00:00
2025-08-28 13:32:30 -06:00
2025-08-27 23:24:19 +00:00
2025-09-02 16:51:13 +02:00
2025-09-01 18:42:33 -04:00
2025-09-01 18:42:33 -04:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-07-22 11:55:24 -04:00
2025-08-29 18:13:06 -04:00
2025-08-27 23:24:19 +00:00
2025-08-22 03:48:47 -04:00
2025-09-01 18:42:33 -04:00
2025-08-20 12:20:13 +02:00
2025-09-01 08:33:59 +00:00
2025-09-01 18:42:33 -04:00
2025-08-22 11:45:47 -04:00
2025-08-07 01:28:41 +00:00
2025-08-11 15:34:34 +02:00
2025-08-29 17:08:42 +03:00
2025-09-01 18:42:33 -04:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-08-22 13:16:42 +00:00
2025-08-31 18:51:17 -04:00
2025-08-21 19:59:42 -04:00
2025-08-19 21:26:17 +02:00
2025-09-01 18:42:33 -04:00
2025-08-28 07:53:32 +00:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-09-02 16:51:13 +02:00
2025-09-01 10:49:09 +02:00
2025-08-29 17:08:42 +03:00
2025-08-27 03:24:50 +08:00
2025-08-22 11:45:47 -04:00
2025-08-22 11:45:47 -04:00
2025-09-02 00:26:42 +00:00
2025-08-20 20:14:30 +02:00
2025-07-10 21:08:43 +02:00
2025-08-19 20:33:44 +00:00
2025-08-20 12:05:58 +02:00
2025-08-16 19:00:31 +00:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-08-26 15:30:26 +02:00
2025-08-21 19:59:42 -04:00
2025-09-01 18:42:33 -04:00
2025-08-19 21:26:17 +02:00
2025-08-28 13:32:30 -06:00
2025-08-19 13:27:24 +00:00
2025-08-06 10:53:20 +02:00
2025-08-20 20:14:30 +02:00
2025-08-29 16:56:10 -04:00
2025-09-02 16:51:13 +02:00
2025-09-01 18:42:33 -04:00
2025-08-28 12:00:44 +00:00
2025-09-02 16:18:49 +00:00
2025-08-29 16:56:10 -04:00
2025-08-21 17:19:57 +00:00
2025-08-19 13:27:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-28 07:53:32 +00:00
2025-08-29 16:56:10 -04:00
2025-08-24 11:01:42 +00:00
2025-08-18 21:54:35 +00:00
2025-08-19 20:33:44 +00:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-09-02 00:26:42 +00:00
2025-08-18 21:54:35 +00:00
2025-08-27 12:53:07 +00:00
2025-09-02 14:29:07 -04:00
2025-08-19 13:27:24 +00:00
2025-08-29 12:23:45 +00:00
2025-08-29 17:08:42 +03:00
2025-08-21 15:56:16 +02:00
2025-07-25 09:36:43 -04:00
2025-08-29 17:08:42 +03:00
2025-08-26 12:55:40 -03:00
2025-08-31 11:43:24 +03:00
2025-08-20 12:20:13 +02:00
2025-08-28 12:00:44 +00:00
2025-08-24 09:59:32 +03:00
2025-07-17 14:25:55 +00:00
2025-07-08 14:34:57 +00:00
2025-08-19 20:33:44 +00:00
2025-08-19 13:27:24 +00:00
2025-08-06 10:44:15 -04:00
2025-09-01 18:42:33 -04:00
2025-08-28 12:00:44 +00:00
2025-08-28 12:00:44 +00:00
2025-09-01 18:42:33 -04:00
2025-08-20 12:20:13 +02:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-08-19 21:26:17 +02:00
2025-09-02 16:39:55 +00:00
2025-09-01 18:42:33 -04:00
2025-08-29 14:07:27 -03:00
2025-08-20 12:20:13 +02:00
2025-08-28 14:40:43 +00:00
2025-09-02 16:51:13 +02:00
2025-08-19 13:27:24 +00:00
2025-09-02 07:07:23 -07:00
2025-08-29 17:08:42 +03:00
2025-09-02 16:51:13 +02:00
2025-08-20 12:05:58 +02:00
2025-08-19 13:27:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-21 06:48:04 +00:00
2025-08-28 03:51:22 +00:00
2025-08-29 03:50:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-19 13:27:24 +00:00
2025-09-02 01:17:27 +00:00
2025-08-20 12:20:13 +02:00
2025-09-02 01:17:27 +00:00
2025-09-02 01:17:27 +00:00
2025-08-19 21:26:17 +02:00
2025-08-19 21:26:17 +02:00
2025-08-19 13:27:24 +00:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-08-19 20:33:44 +00:00
2025-08-18 21:54:35 +00:00
2025-08-19 21:26:17 +02:00
2025-08-29 16:17:22 -04:00
2025-08-19 21:26:17 +02:00
2025-08-19 20:33:44 +00:00
2025-08-21 19:59:42 -04:00
2025-08-28 21:07:02 +00:00
2025-08-28 14:40:43 +00:00
2025-08-20 14:35:59 +00:00
2025-08-19 21:26:17 +02:00
2025-08-15 15:37:52 -04:00
2025-09-02 10:42:29 +00:00
2025-09-01 11:21:55 +03:00
2025-08-19 21:26:17 +02:00
2025-09-01 18:42:33 -04:00
2025-08-20 12:20:13 +02:00
2025-08-08 15:34:36 -03:00
2025-09-01 18:42:33 -04:00
2025-08-21 09:37:45 +00:00
2025-09-02 16:51:13 +02:00
2025-08-20 12:20:13 +02:00
2025-07-30 23:03:53 +05:30
2025-08-28 13:32:30 -06:00
2025-08-15 13:54:24 +03:00
2025-09-02 09:11:35 -06:00
2025-08-29 16:56:10 -04:00
2025-08-25 14:28:11 -04:00
2025-08-20 12:20:13 +02:00
2025-08-19 20:33:44 +00:00
2025-09-01 18:42:33 -04:00
2025-09-01 18:42:33 -04:00
2025-08-26 21:08:45 +00:00
2025-09-02 16:51:13 +02:00
2025-08-26 16:59:12 -03:00
2025-09-02 17:23:35 +00:00
2025-08-20 12:20:13 +02:00
2025-08-20 12:20:13 +02:00
2025-08-29 16:56:10 -04:00