[PR #14932] [CLOSED] Fix streaming timeout during tool call composition #14924

Closed
opened 2026-04-13 01:05:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14932
Author: @joaquinhuigomez
Created: 3/18/2026
Status: Closed

Base: mainHead: fix/streaming-timeout-tool-calls


📝 Commits (2)

  • 1e0d636 Fix streaming timeout during tool call argument composition
  • 1733153 Add logprobs guard to ping condition and trace log for streaming path

📊 Changes

2 files changed (+15 additions, -1 deletions)

View changed files

📝 anthropic/anthropic.go (+11 -0)
📝 server/routes.go (+4 -1)

📄 Description

Summary

Fixes streaming timeouts during tool call argument composition in the Anthropic-compatible API.

When the tool parser is assembling arguments across multiple chunks, ChatHandler drops the empty intermediate events. The Anthropic streaming layer receives nothing and the SSE connection goes silent — clients like Claude Code time out waiting.

This emits a PingEvent whenever a streaming response has no content, thinking, or tool call data but isn't done yet, keeping the connection alive. Also adds a logprobs guard so pings aren't emitted alongside valid logprobs-only chunks.


🔄 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/14932 **Author:** [@joaquinhuigomez](https://github.com/joaquinhuigomez) **Created:** 3/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/streaming-timeout-tool-calls` --- ### 📝 Commits (2) - [`1e0d636`](https://github.com/ollama/ollama/commit/1e0d636bc6049771ca1334930906c739656ee1b9) Fix streaming timeout during tool call argument composition - [`1733153`](https://github.com/ollama/ollama/commit/1733153051fccd8a62fedada35eee071d575502c) Add logprobs guard to ping condition and trace log for streaming path ### 📊 Changes **2 files changed** (+15 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `anthropic/anthropic.go` (+11 -0) 📝 `server/routes.go` (+4 -1) </details> ### 📄 Description ## Summary Fixes streaming timeouts during tool call argument composition in the Anthropic-compatible API. When the tool parser is assembling arguments across multiple chunks, ChatHandler drops the empty intermediate events. The Anthropic streaming layer receives nothing and the SSE connection goes silent — clients like Claude Code time out waiting. This emits a `PingEvent` whenever a streaming response has no content, thinking, or tool call data but isn't done yet, keeping the connection alive. Also adds a logprobs guard so pings aren't emitted alongside valid logprobs-only chunks. --- <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-13 01:05:50 -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#14924