[PR #13525] [MERGED] preserve tool definition and call JSON ordering #14257

Closed
opened 2026-04-13 00:49:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13525
Author: @drifkin
Created: 12/19/2025
Status: Merged
Merged: 1/6/2026
Merged by: @drifkin

Base: mainHead: drifkin/stable-tool-args-redux


📝 Commits (2)

  • c4dd1a0 preserve tool definition and call JSON ordering
  • 260a5fd orderedmap_test: remove testify

📊 Changes

45 files changed (+1769 additions, -563 deletions)

View changed files

📝 api/types.go (+146 -13)
📝 api/types_test.go (+277 -18)
📝 app/ui/ui.go (+4 -4)
📝 go.mod (+4 -0)
📝 go.sum (+9 -0)
📝 integration/tools_test.go (+11 -2)
internal/orderedmap/orderedmap.go (+94 -0)
internal/orderedmap/orderedmap_test.go (+348 -0)
📝 middleware/openai_test.go (+49 -15)
📝 model/parsers/cogito_test.go (+33 -33)
📝 model/parsers/deepseek3_test.go (+39 -39)
📝 model/parsers/functiongemma.go (+2 -2)
📝 model/parsers/functiongemma_test.go (+27 -24)
📝 model/parsers/ministral.go (+3 -3)
📝 model/parsers/nemotron3nano.go (+7 -5)
📝 model/parsers/nemotron3nano_test.go (+29 -29)
📝 model/parsers/olmo3.go (+5 -5)
📝 model/parsers/olmo3_test.go (+31 -31)
📝 model/parsers/qwen3coder.go (+3 -3)
📝 model/parsers/qwen3coder_test.go (+16 -16)

...and 25 more files

📄 Description

This is another iteration of https://github.com/ollama/ollama/pull/12518, but this time we've simplified things by relaxing the competing requirements of being compatible AND order-preserving with templates (vs. renderers). We maintain backwards compatibility at the cost of not guaranteeing order for templates. We plan on moving more and more models to renderers, which have been updated to use these new data types, and additionally we could add an opt-in way of templates getting an order-preserved list (e.g., via sibling template vars)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13525 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 1/6/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/stable-tool-args-redux` --- ### 📝 Commits (2) - [`c4dd1a0`](https://github.com/ollama/ollama/commit/c4dd1a09994072c550f350bffd3fadf198547447) preserve tool definition and call JSON ordering - [`260a5fd`](https://github.com/ollama/ollama/commit/260a5fd7160f9c9a0fe87a08deb5c424e823038f) orderedmap_test: remove testify ### 📊 Changes **45 files changed** (+1769 additions, -563 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+146 -13) 📝 `api/types_test.go` (+277 -18) 📝 `app/ui/ui.go` (+4 -4) 📝 `go.mod` (+4 -0) 📝 `go.sum` (+9 -0) 📝 `integration/tools_test.go` (+11 -2) ➕ `internal/orderedmap/orderedmap.go` (+94 -0) ➕ `internal/orderedmap/orderedmap_test.go` (+348 -0) 📝 `middleware/openai_test.go` (+49 -15) 📝 `model/parsers/cogito_test.go` (+33 -33) 📝 `model/parsers/deepseek3_test.go` (+39 -39) 📝 `model/parsers/functiongemma.go` (+2 -2) 📝 `model/parsers/functiongemma_test.go` (+27 -24) 📝 `model/parsers/ministral.go` (+3 -3) 📝 `model/parsers/nemotron3nano.go` (+7 -5) 📝 `model/parsers/nemotron3nano_test.go` (+29 -29) 📝 `model/parsers/olmo3.go` (+5 -5) 📝 `model/parsers/olmo3_test.go` (+31 -31) 📝 `model/parsers/qwen3coder.go` (+3 -3) 📝 `model/parsers/qwen3coder_test.go` (+16 -16) _...and 25 more files_ </details> ### 📄 Description This is another iteration of <https://github.com/ollama/ollama/pull/12518>, but this time we've simplified things by relaxing the competing requirements of being compatible AND order-preserving with templates (vs. renderers). We maintain backwards compatibility at the cost of not guaranteeing order for templates. We plan on moving more and more models to renderers, which have been updated to use these new data types, and additionally we could add an opt-in way of templates getting an order-preserved list (e.g., via sibling template vars) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:49:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14257