mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #21795] bug: Adaptive Memory v3 - extraction fails with openai_compatible provider due to response_format conflict #19572
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 @garnetlyx on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21795
Bug Description
Adaptive Memory v3 plugin has multiple issues in the
openai_compatibleextraction pipeline that cause memory extraction to silently fail or produce incorrect/duplicate entries.Environment
adaptive_memory_v2)openai_compatible(llama-server with Qwen3-1.7B)Bug 1 (High):
response_format: json_objectconflicts with extraction promptThe extraction prompt requires a JSON array
[{...}], but the API request includes"response_format": {"type": "json_object"}which constrains output to a JSON object{...}.Impact:
{...}format[], length 3) → no memories saved at all{...}is returned, it falls to the lossy fallback path (Bug 2/3)Reproduction:
Fix: Remove
"response_format": {"type": "json_object"}from the openai_compatible request body inquery_llm_with_retry(). The prompt already enforces JSON formatting.Bug 2 (Medium):
ignore_keysmissing structural fields → junk entriesIn
_convert_dict_to_operations(), the fallback path'signore_keysis:Missing:
"operation","tags","memory_bank","id". When LLM returns a dict,memory_bank: "Personal"gets saved as an independent memory:Fix:
Bug 3 (Low): Single dict response loses tags and memory_bank
When LLM returns a valid single operation dict (with
operation,content,tags,memory_bankfields), the code doesn't recognize it as a memory operation. It skips the primary list check, then falls to key-value flattening wheretags(list type) is dropped, and the hardcoded defaulttag = "preference"is used.Fix: Add a check between primary list handling and fallback: if dict contains
content(str) +operation, treat as single memory operation directly, preserving original tags/bank.Summary
response_format: json_objectquery_llm_with_retry()ignore_keys_convert_dict_to_operations()_convert_dict_to_operations()Note: Ollama path is not affected by Bug 1 (uses
"format": "json"which allows arrays).@Classic298 commented on GitHub (Feb 23, 2026):
Why do you open bug reports for third party plugins in the Open WebUI repository? Report it to the plugin creator.