Skip to content

Comments

added questions before deep search, changed the router model gpt-5 ad..#6

Open
zdehasek wants to merge 3 commits intoFPOscar:mainfrom
zdehasek:main
Open

added questions before deep search, changed the router model gpt-5 ad..#6
zdehasek wants to merge 3 commits intoFPOscar:mainfrom
zdehasek:main

Conversation

@zdehasek
Copy link

@zdehasek zdehasek commented Dec 17, 2025

...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.1 to gpt-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 include DEBUG_CLARIFICATION for troubleshooting and CLARIFICATION_QUESTION_COUNT to control the number of questions asked.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 OpenWebUi Function v1.py

Need help? Join our Discord

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 8eceab9..1d9cc71

  Severity     Location     Issue     Delete  
High OpenWebUi Function v1.py:688 AttributeError on non-dict list items

continue
content = m.get("content", "")
if isinstance(content, list):
content = "".join(p.get("text", "") for p in content)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 fixed, you can double check

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant