open-webui/backend/open_webui
Bugale Bugalit 29f757490e fix: don't drop a tool call whose id an earlier round already used
The tool loop builds `output` once per request but runs many rounds inside it,
and each round skips a function_call whose id appears anywhere in `output` -
including rounds already completed. Results are rebuilt per round and appended
regardless, so an id a later round reuses loses its call and keeps its result.

The turn then holds function_call_output items with no function_call, and the
next request fails at the provider with "tool message tool_call_id '...' does
not match any tool call in the preceding assistant messages". The malformed turn
is persisted, so retrying cannot succeed and every later message in that chat
fails the same way.

Renaming a reused id restores the pairing. Scoped to ids that are already
answered, so the case the dedup exists for - Responses API items already in
`output` and still awaiting a result - is untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 17:55:32 +03:00
..
data
internal refac 2026-07-31 17:41:14 -04:00
migrations perf: index group_member on (user_id, group_id) (#27822) 2026-07-31 19:09:15 -05:00
models refac 2026-08-05 00:47:49 -05:00
retrieval perf: build info log messages lazily so raising the log level actually saves work (#27837) 2026-08-02 15:39:10 -05:00
routers refac 2026-08-05 00:47:49 -05:00
socket perf: build info log messages lazily so raising the log level actually saves work (#27837) 2026-08-02 15:39:10 -05:00
static refac 2026-07-27 19:39:36 -04:00
storage refac 2026-07-31 17:41:14 -04:00
tools refac 2026-08-05 00:47:49 -05:00
utils fix: don't drop a tool call whose id an earlier round already used 2026-08-09 17:55:32 +03:00
__init__.py refac 2026-07-27 19:39:36 -04:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py perf: build info log messages lazily so raising the log level actually saves work (#27837) 2026-08-02 15:39:10 -05:00
constants.py refac 2026-07-27 19:39:36 -04:00
env.py perf: build info log messages lazily so raising the log level actually saves work (#27837) 2026-08-02 15:39:10 -05:00
events.py refac 2026-07-27 19:39:36 -04:00
functions.py perf: build debug log messages lazily so disabled debug logs cost nothing (#27834) 2026-07-31 19:09:01 -05:00
main.py refac 2026-08-05 10:37:38 -05:00
tasks.py refac 2026-07-31 17:41:14 -04:00