Skip to content

fix: fixed issue #1587#1885

Closed
richardz403 wants to merge 0 commit into
langflow-ai:mainfrom
richardz403:main
Closed

fix: fixed issue #1587#1885
richardz403 wants to merge 0 commit into
langflow-ai:mainfrom
richardz403:main

Conversation

@richardz403

@richardz403 richardz403 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes issue #1587, where resetting a flow causes the LLM selection to revert to a stale or default model.

In src/api/settings/langflow_sync.py, the fallback branch of _update_langflow_model_values (called during reapply_all_settings()) was only iterating and refreshing configured embedding providers. It completely bypassed updating the LLM providers, meaning the chat flow never received a force_llm_update=True signal.

Changes

  • Modified the fallback block in src/api/settings/langflow_sync.py inside reapply_all_settings().
  • If everything is blank, it automatically falls back to your system's default agent settings (config.agent) and forces an update (force_llm_update=True) to the chat flow using that default LLM provider and model.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Langflow model synchronization by adding a reliable fallback to the currently configured LLM provider/model when explicit embedding/LLM settings aren’t provided, improving reliability.
  • Infrastructure
    • Updated Docker Compose to expose the backend service on host port 8000 for easier local access.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 860523e4-c758-4160-83fd-b8e6a8ada2d4

📥 Commits

Reviewing files that changed from the base of the PR and between 9077fb0 and a79c8d1.

📒 Files selected for processing (1)
  • src/api/settings/langflow_sync.py
💤 Files with no reviewable changes (1)
  • src/api/settings/langflow_sync.py

Walkthrough

Adds a fallback branch in _update_langflow_model_values that forces an LLM sync with the current config when no model-provider arguments are supplied. Also exposes the backend container port 8000 to the host in Docker Compose for local access.

Changes

LLM Sync Fallback and Local Deployment

Layer / File(s) Summary
Fallback force-update branch
src/api/settings/langflow_sync.py
Adds a conditional block in _update_langflow_model_values: when no model or provider arguments are passed, forces a Langflow model-value sync using the currently configured LLM provider/model (force_llm_update=True) and logs success before proceeding to update embedding providers.
Backend service port exposure
docker-compose.yml
Adds a ports mapping to the openrag-backend service to expose container port 8000 on the host ("8000:8000").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: fixed issue #1587' is vague and generic, referencing only an issue number without describing the actual change or fix implemented. Replace with a more descriptive title that explains the fix, e.g., 'fix: restore LLM selection on flow reset by forcing model update in fallback path' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) label Jun 15, 2026
@richardz403 richardz403 changed the title Fixed issue #1587 fix: fixed issue #1587 Jun 15, 2026
@github-actions github-actions Bot added the bug 🔴 Something isn't working. label Jun 15, 2026

@NishadA05 NishadA05 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked out this PR locally and reviewed the diff. The change is narrow and limited to src/api/settings/langflow_sync.py. It updates the fallback path in _update_langflow_model_values() so that when no explicit model/provider overrides are passed, the configured agent LLM provider/model is forced back into the Langflow chat flow with force_llm_update=True.

That seems to address the main issue where the fallback path refreshed embedding providers but did not force an LLM update after a flow reset/reapply.

One note: the issue prompt mentioned iterating all configured LLM providers similar to the embedding provider loop. This PR instead updates only the active/default config.agent LLM provider/model. That seems sufficient if the goal is to restore the active chat model after reset, but it is narrower than the originally suggested approach.

@github-actions github-actions Bot added bug 🔴 Something isn't working. docker and removed bug 🔴 Something isn't working. labels Jun 16, 2026
@richardz403 richardz403 reopened this Jun 16, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 21, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. community docker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants