Agent Model Selection Bug
Bug Description
Bug Description
After updating to the latest Langflow version (automatic update 2025-05-18), all Agent components automatically fallback from Claude 3.5 Sonnet to Claude 3.7 Sonnet, regardless of user selection.
Expected: Claude 3.5 Sonnet remains selected Actual: Component reverts to Claude 3.7 Sonnet
Reproduction
Steps to Reproduce
- Create new Agent component
- Set Model Provider to "Anthropic"
- Select "Claude 3.5 Sonnet" from model dropdown
- Save the configuration
- Refresh/reopen the component settings
Expected behavior
Environment
- Langflow version: Latest (auto-updated 2025-05-18 01:00:50Z 1.4.1 (latest))
- Docker deployment via Elestio
- Issue confirmed on both self-hosted and DataStax hosted versions
- All browsers affected (including incognito)
Additional Context
- Regular Anthropic/LLM components work correctly with Claude 3.5
- Only affects Agent component specifically
- Started immediately after automatic update
- Impact: Claude 3.5 has larger context window needed for complex prompts
Impact
Mission-critical for production flows requiring Claude 3.5's larger context window.
Who can help?
No response
Operating System
Ubuntu 24.04 LTS (kernel 6.8.0-60-generic)
Langflow Version
1.4.1 (latest)
Python Version
3.12
Screenshot
No response
Flow File
No response
The issue you're experiencing seems to be related to a change in the latest Langflow update (version 1.4.1), which might be affecting the model selection logic for Agent components. The update introduced a DropdownInput for selecting the "Model Provider" and dynamically populates options from MODEL_PROVIDERS_DICT. This change could be causing the automatic fallback to Claude 3.7 Sonnet when the component is refreshed or reopened [1].
To address this, you might want to check if there are any specific conditions or default settings in the code that could be causing the fallback to the latest model version. It could be helpful to review the logic in the get_llm method or related functions that handle model selection and ensure that the selected model version is being correctly saved and loaded from the configuration settings [1].
If the issue persists, consider looking into the configuration saving and loading mechanism to ensure that the selected model version is being correctly stored and retrieved. The use of YAML files for configuration might be a point to investigate [2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@dosu I am also having this issue, for an agent using a Google Generative AI model.
I simply add an agent, configure the API Key, and then it auto-refreshes the model list. It doesn't auto-refresh until I add the key, which is understandable.
I configure the model I want, and then save the flow. Suppose I go back to the home page, and then re-open the flow. This auto-selects the first model in each agent's model list, which often tends to be a Gemma model with no support for function calling. I have to go there and re-configure every single agent.
Also having this issue, very annoying for complex agent set ups
Wish there was a workaround to just set a default model for a specific flow or just save the last state of an entire flow per flow
@Logrui Did you upgrade to the newest 1.15 version?
Fixed by: https://github.com/langflow-ai/langflow/pull/9495