added questions before deep search, changed the router model gpt-5 ad..#6
added questions before deep search, changed the router model gpt-5 ad..#6zdehasek wants to merge 3 commits intoFPOscar:mainfrom
Conversation
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 8eceab9..1d9cc71
| Severity | Location | Issue | Delete |
|---|---|---|---|
| OpenWebUi Function v1.py:688 | AttributeError on non-dict list items |
OpenWebUi Function v1.py
Outdated
| continue | ||
| content = m.get("content", "") | ||
| if isinstance(content, list): | ||
| content = "".join(p.get("text", "") for p in content) |
There was a problem hiding this comment.
This line will cause an AttributeError crash when message content is a list containing non-dictionary elements. The code checks if content is a list (line 687) but doesn't verify that each element p in that list is a dictionary before calling p.get("text", ""). If the list contains strings or other non-dict types, the .get() method call will fail with: AttributeError: '' object has no attribute 'get'.
For example, if content = ["hello", "world"], then p would be "hello" (a string), and calling p.get() would crash.
The correct pattern (used elsewhere in this same PR at lines 248-254) is to check isinstance(p, dict) before calling .get() on it:
content = "".join(p.get("text", "") for p in content if isinstance(p, dict))This bug will crash the clarification detection logic whenever the assistant's previous message has list content with non-dict items.
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
There was a problem hiding this comment.
Thanks for the quick fix and the 👍! I've checked the updated code and confirm that the issue is now resolved. The isinstance(p, dict) check will properly filter out any non-dictionary elements before attempting to call .get() on them, preventing the AttributeError crash.
The fix correctly follows the same pattern used elsewhere in the codebase (lines 248-254), which makes the code more consistent and maintainable. Good job! 🎉
...and few fixes
High-level PR Summary
This PR adds a clarifying questions feature that prompts users with 3-5 questions before initiating deep research, upgrades the router model from
gpt-4.1togpt-5-chat-latest, and includes several bug fixes. The clarification system generates contextual questions using the LLM, detects when users have already been prompted to avoid re-asking, and integrates user answers into the research prompt. New configuration options includeDEBUG_CLARIFICATIONfor troubleshooting andCLARIFICATION_QUESTION_COUNTto control the number of questions asked.⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
OpenWebUi Function v1.py