feat: Properly handle tool calls for the gpt-oss model #5969

Closed
opened 2025-11-11 16:40:49 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @EntropyYue on GitHub (Aug 5, 2025).

Originally assigned to: @tjbck on GitHub.

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

When using the gpt-oss model in ollama, it will call the tool without ending the reasoning, which will cause the reasoning block before the tool call to fail to end correctly:

Image

Desired Solution you'd like

The reasoning block cannot be closed normally

Alternatives Considered

Perhaps the tool call can be placed inside a reasoning block when encountering this situation, like this:

Image

Additional Context

No response

Originally created by @EntropyYue on GitHub (Aug 5, 2025). Originally assigned to: @tjbck on GitHub. ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description When using the gpt-oss model in ollama, it will call the tool without ending the reasoning, which will cause the reasoning block before the tool call to fail to end correctly: <img width="306" height="198" alt="Image" src="https://github.com/user-attachments/assets/db268df9-0e63-4470-a091-af265f58111c" /> ### Desired Solution you'd like The reasoning block cannot be closed normally ### Alternatives Considered Perhaps the tool call can be placed inside a reasoning block when encountering this situation, like this: <img width="874" height="226" alt="Image" src="https://github.com/user-attachments/assets/779b43e2-90f6-4ae4-b07d-77a27231f76e" /> ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Aug 6, 2025):

Addressed with 2e36540023 in dev!

Image
@tjbck commented on GitHub (Aug 6, 2025): Addressed with 2e36540023a3baf4a323d9b9a401a1689b8da012 in dev! <img width="486" height="238" alt="Image" src="https://github.com/user-attachments/assets/6a4299e8-5598-4596-918a-ccab3a1d17be" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5969