Skip to content

Conversation

@tidely
Copy link
Contributor

@tidely tidely commented Nov 8, 2025

Closes #42303

Ollama added tool call identifiers (ollama/ollama#12956) in its latest version v0.12.10. This broke our json schema and made all tool calls fail.

This PR fixes the schema and we now use the identifier provided by Ollama for our generic internal representation of language model responses.

NOTE: Currently this change is not backwards compatible with old Ollama installations. This can be changed by making making the new ID field optional and re-introducing the custom id logic. I think adding a migration period for adds unnecessary complexity and we've had breaking Ollama changes previously as well IIRC.

Note to reviewer: The fix to this issue should likely get cherry-picked into the next release, since Ollama becomes unusable as an agent without it.

Release Notes:

  • Fixed tool calling with the latest version of Ollama v0.12.10

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 8, 2025
@SomeoneToIgnore SomeoneToIgnore added the ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Nov 8, 2025
@js-0s
Copy link

js-0s commented Nov 9, 2025

@tidely great work! your PR is more simplistic (not introducting logging) and as you mention not backwards compatible as the id is not optional. i think i'll add a test like you did so it covers both types of possible inputs.
Maybe we should add a issue and link it to both PR's so zed-maintainers can decide how to proceed with that.

May i ask how - if you did not have logging - you discovered that? I must admit that i had a really hard time to figure out what was going on.

@tidely
Copy link
Contributor Author

tidely commented Nov 9, 2025

not introducting logging

I think the error already gets logged in high level code after the error bubbles up. Not sure how useful the errors are anyway, I think it might be worth exploring using the serde_path_to_error crate already used in other places in the Zed codebase. We should definitely merge our efforts on this though.

Maybe we should add a issue and link it to both PR's so zed-maintainers can decide how to proceed with that.

Sounds good!

May i ask how - if you did not have logging - you discovered that?

I compared the request schema used in tests to the one returned by curling the newest ollama version, and then I did some digging in the Ollama repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement community champion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: Unable to parse chat response

3 participants