[GH-ISSUE #22666] Memory tools not registered when model has capabilities.memory but features.memory not sent #58447

Closed
opened 2026-05-05 23:10:50 -05:00 by GiteaMirror · 1 comment
Owner

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: true in its meta config and the system prompt instructs the model to use add_memory/search_memories, the model generates tool calls for these functions. However, the tools are not registered for execution because get_builtin_tools() in utils/tools.py requires features.get("memory") to be truthy — which depends on the frontend sending features: {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 to CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES (30) times.

Steps to Reproduce

  1. Configure a model with capabilities.memory: true in the model editor
  2. Set a system prompt that tells the model to use add_memory for preferences
  3. Set function_calling: native in model params
  4. Start a new chat with this model
  5. Send: "Remember my favorite color is blue"
  6. The model calls add_memory but it loops 30 times because the tool isn't in the execution dict

Expected Behavior

When a model has capabilities.memory: true, memory tools should be registered for execution in get_builtin_tools() regardless of the per-chat features.memory flag.

Root Cause

In utils/tools.py, get_builtin_tools() line ~468:

if is_builtin_tool_enabled("memory") and features.get("memory"):

This requires BOTH the builtin tool category AND the per-chat features flag. But features.memory depends 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:

if is_builtin_tool_enabled("memory") and (features.get("memory") or get_model_capability("memory", False)):

This ensures that models with explicit capabilities.memory: true always have memory tools available.

Environment

  • Open WebUI v0.8.10
  • Backend: vllm-mlx with Qwen 3.5 models
  • function_calling: native
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: true` in its meta config and the system prompt instructs the model to use `add_memory`/`search_memories`, the model generates tool calls for these functions. However, the tools are not registered for execution because `get_builtin_tools()` in `utils/tools.py` requires `features.get("memory")` to be truthy — which depends on the frontend sending `features: {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 to `CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES` (30) times. ## Steps to Reproduce 1. Configure a model with `capabilities.memory: true` in the model editor 2. Set a system prompt that tells the model to use `add_memory` for preferences 3. Set `function_calling: native` in model params 4. Start a new chat with this model 5. Send: "Remember my favorite color is blue" 6. The model calls `add_memory` but it loops 30 times because the tool isn't in the execution dict ## Expected Behavior When a model has `capabilities.memory: true`, memory tools should be registered for execution in `get_builtin_tools()` regardless of the per-chat `features.memory` flag. ## Root Cause In `utils/tools.py`, `get_builtin_tools()` line ~468: ```python if is_builtin_tool_enabled("memory") and features.get("memory"): ``` This requires BOTH the builtin tool category AND the per-chat features flag. But `features.memory` depends 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: ```python if is_builtin_tool_enabled("memory") and (features.get("memory") or get_model_capability("memory", False)): ``` This ensures that models with explicit `capabilities.memory: true` always have memory tools available. ## Environment - Open WebUI v0.8.10 - Backend: vllm-mlx with Qwen 3.5 models - function_calling: native
GiteaMirror added the bug label 2026-05-05 23:10:50 -05:00
Author
Owner

@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:

  • bug: Bug report or error you've encountered
  • feat: Feature request or enhancement suggestion
  • docs: Documentation issue or improvement request
  • question: Question about usage or functionality
  • help: Request for help or support

Example: bug: Login fails when using special characters in password

<!-- gh-comment-id:4059706735 --> @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: - **bug**: Bug report or error you've encountered - **feat**: Feature request or enhancement suggestion - **docs**: Documentation issue or improvement request - **question**: Question about usage or functionality - **help**: Request for help or support Example: `bug: Login fails when using special characters in password`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58447