v0.20.1-rc2: model/parsers: rework gemma4 tool call handling (#15306)

Ollama Releases / 4/4/2026

📰 NewsDeveloper Stack & InfrastructureTools & Practical UsageModels & Research

Key Points

  • v0.20.1-rc2で、Gemma4のツール呼び出し引数処理に使っていた独自の引数ノーマライザを置き換え、より厳格な参照(reference)スタイルの変換へ変更した。
  • 変換では、Gemma-quotedの文字列をそのまま保持し、裸のキーはクォートし、最終的にJSONとしてアンマーシャルする方針にした。
  • これにより「クォートされたスカラーは文字列として保持」しつつ、「クォートされていない型付きの値は保持」できるようになる。
  • さらに、参照実装が拒否するタイプの不正なraw-quoted入力に対するテストカバレッジが追加され、挙動の安全性と互換性の確認が強化された。

Replace the custom Gemma4 argument normalizer with a stricter
reference-style conversion: preserve Gemma-quoted strings, quote bare
keys, and then unmarshal the result as JSON.

This keeps quoted scalars as strings, preserves typed unquoted values,
and adds test coverage for malformed raw-quoted inputs that the
reference implementation rejects.