mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #22666] Memory tools not registered when model has capabilities.memory but features.memory not sent #19781
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?
Originally created by @Thump604 on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22666
Bug Description
When a model has
capabilities.memory: truein its meta config and the system prompt instructs the model to useadd_memory/search_memories, the model generates tool calls for these functions. However, the tools are not registered for execution becauseget_builtin_tools()inutils/tools.pyrequiresfeatures.get("memory")to be truthy — which depends on the frontend sendingfeatures: {memory: true}in the chat request.This creates a tool loop: the model calls
add_memory, but since the tool isn't registered (tool_function_name not in tools), the result is empty, and the model retries up toCHAT_RESPONSE_MAX_TOOL_CALL_RETRIES(30) times.Steps to Reproduce
capabilities.memory: truein the model editoradd_memoryfor preferencesfunction_calling: nativein model paramsadd_memorybut it loops 30 times because the tool isn't in the execution dictExpected Behavior
When a model has
capabilities.memory: true, memory tools should be registered for execution inget_builtin_tools()regardless of the per-chatfeatures.memoryflag.Root Cause
In
utils/tools.py,get_builtin_tools()line ~468:This requires BOTH the builtin tool category AND the per-chat features flag. But
features.memorydepends on the frontend sending it, which may not happen even when the admin memory setting is enabled and the model declares memory capability.Proposed Fix
Also check model capabilities as a fallback:
This ensures that models with explicit
capabilities.memory: truealways have memory tools available.Environment
@pr-validator-bot commented on GitHub (Mar 14, 2026):
⚠️ Missing Issue Title Prefix
@Thump604, your issue title is missing a prefix (e.g.,
bug:,feat:,docs:).Please update your issue title to include one of the following prefixes:
Example:
bug: Login fails when using special characters in password