Skip to content

fix: safely disable mem0 for non-OpenAI models#739

Open
RainCongeals wants to merge 2 commits into
browser-use:mainfrom
RainCongeals:master
Open

fix: safely disable mem0 for non-OpenAI models#739
RainCongeals wants to merge 2 commits into
browser-use:mainfrom
RainCongeals:master

Conversation

@RainCongeals

@RainCongeals RainCongeals commented Jul 19, 2026

Copy link
Copy Markdown
  • Use getattr to safely check for model_name attribute, resolving Pylance type warnings.
  • Automatically disable vector memory for non-OpenAI LLMs to prevent API key errors.
  • Add assertion to ensure main_llm is initialized before agent creation.

Summary by cubic

Safely disables mem0 vector memory for non-OpenAI models and ensures the LLM is initialized before creating the agent. Prevents OpenAI API key errors and resolves type-check warnings.

  • Bug Fixes
    • Use getattr to read model_name safely, avoiding Pylance warnings.
    • Detect non-OpenAI models using llm_provider_name when available; disable vector memory and log a clear warning.
    • Assert main_llm is set before agent creation and pass the enable_memory flag to the agent.

Written for commit 8460bd2. Summary will update on new commits.

Review in cubic

- Use getattr to safely check for model_name attribute, resolving Pylance type warnings.
- Automatically disable vector memory for non-OpenAI LLMs to prevent API key errors.
- Add assertion to ensure main_llm is initialized before agent creation.
@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/webui/components/browser_use_agent_tab.py Outdated
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.

2 participants