[PR #11761] [MERGED] openai: when converting role=tool messages, propagate the tool name #39493

Closed
opened 2026-04-23 00:20:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11761
Author: @drifkin
Created: 8/7/2025
Status: Merged
Merged: 8/7/2025
Merged by: @drifkin

Base: mainHead: drifkin/openai-tool-names


📝 Commits (1)

  • 759dd78 openai: when converting role=tool messages, propagate the tool name

📊 Changes

2 files changed (+119 additions, -5 deletions)

View changed files

📝 openai/openai.go (+31 -5)
📝 openai/openai_test.go (+88 -0)

📄 Description

Added support for converting both name and tool_call_id fields, which different clients might provide. name is a legacy field from the OpenAI completions API. For tool_call_id we inspect previous messages and look for a matching tool call ID and grab its name

Issue: https://github.com/ollama/ollama/issues/11704


🔄 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/11761 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 8/7/2025 **Status:** ✅ Merged **Merged:** 8/7/2025 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/openai-tool-names` --- ### 📝 Commits (1) - [`759dd78`](https://github.com/ollama/ollama/commit/759dd78dd600ebf751ff922939256d4f1ec2394d) openai: when converting role=tool messages, propagate the tool name ### 📊 Changes **2 files changed** (+119 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `openai/openai.go` (+31 -5) 📝 `openai/openai_test.go` (+88 -0) </details> ### 📄 Description Added support for converting both `name` and `tool_call_id` fields, which different clients might provide. `name` is a legacy field from the OpenAI completions API. For `tool_call_id` we inspect previous messages and look for a matching tool call ID and grab its name Issue: https://github.com/ollama/ollama/issues/11704 --- <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-23 00:20:58 -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#39493