[PR #13905] [MERGED] parsers/ministral: fix nested tool call parsing by counting brace nesting #76734

Closed
opened 2026-05-05 09:23:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13905
Author: @grwang91
Created: 1/25/2026
Status: Merged
Merged: 1/26/2026
Merged by: @drifkin

Base: mainHead: fix/ministral-parsing-error


📝 Commits (3)

  • 81844bf parsers/ministral: fix nested tool call parsing by counting brace nesting
  • 3181dcb fix lint error
  • 0da691f parsers: refactor ministral parser

📊 Changes

4 files changed (+819 additions, -74 deletions)

View changed files

📝 model/parsers/ministral.go (+243 -43)
model/parsers/ministral_test.go (+545 -0)
📝 model/parsers/parsers.go (+31 -0)
📝 model/parsers/qwen3coder.go (+0 -31)

📄 Description

This PR fixes parsing error in ministral.

  • Implement findJSONEnd to correctly identify the end of tool arguments
  • Add support for nested objects, arrays, and escaped characters in strings
  • Improve buffer management to prevent data loss after tool calls
  • Add tests for various JSON edge cases

Fixes #13705


🔄 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/13905 **Author:** [@grwang91](https://github.com/grwang91) **Created:** 1/25/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `fix/ministral-parsing-error` --- ### 📝 Commits (3) - [`81844bf`](https://github.com/ollama/ollama/commit/81844bfe56a46a7fef899353e6ccc1d9ef9be37f) parsers/ministral: fix nested tool call parsing by counting brace nesting - [`3181dcb`](https://github.com/ollama/ollama/commit/3181dcbbabe568641261cc3a00e721c9f0bd9e5c) fix lint error - [`0da691f`](https://github.com/ollama/ollama/commit/0da691fe81a73ff9aab543bf7b8826f462defc51) parsers: refactor ministral parser ### 📊 Changes **4 files changed** (+819 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `model/parsers/ministral.go` (+243 -43) ➕ `model/parsers/ministral_test.go` (+545 -0) 📝 `model/parsers/parsers.go` (+31 -0) 📝 `model/parsers/qwen3coder.go` (+0 -31) </details> ### 📄 Description This PR fixes parsing error in ministral. - Implement `findJSONEnd` to correctly identify the end of tool arguments - Add support for nested objects, arrays, and escaped characters in strings - Improve buffer management to prevent data loss after tool calls - Add tests for various JSON edge cases Fixes #13705 --- <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-05-05 09:23:32 -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#76734