mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #12728] [CLOSED] fix: Allow non-zero starting index for tool_calls #61866
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/12728
Author: @dulicon
Created: 4/10/2025
Status: ❌ Closed
Base:
dev← Head:fix/tool_server_error_claude📝 Commits (1)
fefd377fix: Allow non-zero starting index for tool_calls📊 Changes
1 file changed (+10 additions, -10 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+10 -10)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Fixes #12646
when processing streamed responses, the current logic uses the sequential index of a tool_calls item within the stream chunk to determine its corresponding index in the final aggregated tools list. This leads to a tool server error if the indexing of tool_calls in the stream does not begin at 0
Added
Changed
Deprecated
Removed
Fixed
Instead of relying on the stream chunk's index, it verifies that the index field from the incoming tool call object matches the index field of the target tool object already present in the final aggregated list. This ensures correct mapping regardless of the starting index in the streamed tool_calls.
Security
Breaking Changes
Additional Information
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.