[PR #15100] [MERGED] anthropic: fix KV cache reuse degraded by tool call argument reordering #25562

Closed
opened 2026-04-19 18:16:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15100
Author: @jessegross
Created: 3/27/2026
Status: Merged
Merged: 3/27/2026
Merged by: @jessegross

Base: mainHead: jessegross/toolcalls


📝 Commits (1)

  • 95311f6 anthropic: fix KV cache reuse degraded by tool call argument reordering

📊 Changes

5 files changed (+275 additions, -308 deletions)

View changed files

📝 anthropic/anthropic.go (+170 -203)
📝 anthropic/anthropic_test.go (+87 -82)
📝 middleware/anthropic.go (+10 -3)
📝 middleware/anthropic_test.go (+5 -13)
📝 model/parsers/qwen3.go (+3 -7)

📄 Description

Use typed structs for tool call arguments instead of map[string]any to preserve JSON key order, which Go maps do not guarantee.


🔄 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/15100 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 3/27/2026 **Status:** ✅ Merged **Merged:** 3/27/2026 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/toolcalls` --- ### 📝 Commits (1) - [`95311f6`](https://github.com/ollama/ollama/commit/95311f607e180f5781a608343db6d94816ce989a) anthropic: fix KV cache reuse degraded by tool call argument reordering ### 📊 Changes **5 files changed** (+275 additions, -308 deletions) <details> <summary>View changed files</summary> 📝 `anthropic/anthropic.go` (+170 -203) 📝 `anthropic/anthropic_test.go` (+87 -82) 📝 `middleware/anthropic.go` (+10 -3) 📝 `middleware/anthropic_test.go` (+5 -13) 📝 `model/parsers/qwen3.go` (+3 -7) </details> ### 📄 Description Use typed structs for tool call arguments instead of map[string]any to preserve JSON key order, which Go maps do not guarantee. --- <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-19 18:16:51 -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#25562