Skip to content

fix: correct deprecated model settings behavior#14047

Merged
erichare merged 3 commits into
release-1.10.3from
fix/deprecated-model-settings
Jul 14, 2026
Merged

fix: correct deprecated model settings behavior#14047
erichare merged 3 commits into
release-1.10.3from
fix/deprecated-model-settings

Conversation

@erichare

@erichare erichare commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • disable model-provider switches for deprecated and unsupported models
  • reject API attempts to persist those models as explicitly enabled
  • limit age-based auto-deprecation to language models so embeddings do not become deprecated solely because they cross the 900-day threshold

Root cause

The settings UI allowed deprecated models to enter its optimistic toggle queue, and the update endpoint accepted and persisted that state. A later GET /enabled_models always returned deprecated models as disabled, so the next refetch appeared to undo the user's toggle.

Separately, the models.dev fallback marks catalog entries older than 900 days as deprecated. That heuristic also applied to embeddings. The OpenAI text-embedding-3-* models reached that threshold in July 2026 even though age alone is not a reliable deprecation signal for embedding models.

Explicit catalog deprecations remain unchanged, including provider-specific embedding models that are known to be unavailable.

Validation

  • uv run pytest tests/unit/base/models/test_models_dev_catalog.py -q (23 passed)
  • uv run pytest src/backend/tests/unit/api/v1/test_models_enabled_providers.py -k cannot_enable_deprecated_model -q (1 passed)
  • npm test -- src/modals/modelProviderModal/__tests__/ModelSelection.test.tsx --runInBand (26 passed)
  • focused Ruff and Biome checks
  • pre-commit hooks
  • live models.dev smoke test confirms all three OpenAI embedding models remain non-deprecated

Summary by CodeRabbit

  • New Features

    • Deprecated and unsupported models can no longer be enabled.
    • Model selection controls are disabled for unavailable models.
    • Clear error messages are shown when attempting to enable deprecated models.
  • Bug Fixes

    • Age-based deprecation now applies only to language models; embeddings remain available unless explicitly deprecated.
  • Tests

    • Added coverage for unavailable-model restrictions and credential cleanup behavior.

@erichare erichare added the bug Something isn't working label Jul 13, 2026
@erichare

Copy link
Copy Markdown
Collaborator Author

Replaces #14046 with the same commit on an upstream-owned branch.

@coderabbitai

coderabbitai Bot commented Jul 13, 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: d764af4d-d472-4498-9335-f099a84bced5

📥 Commits

Reviewing files that changed from the base of the PR and between 61d6490 and 860e8db.

📒 Files selected for processing (7)
  • src/backend/base/langflow/api/v1/models.py
  • src/backend/tests/unit/api/v1/test_models_enabled_providers.py
  • src/backend/tests/unit/api/v1/test_variable.py
  • src/frontend/src/modals/modelProviderModal/__tests__/ModelSelection.test.tsx
  • src/frontend/src/modals/modelProviderModal/components/ModelSelection.tsx
  • src/lfx/src/lfx/base/models/models_dev_catalog.py
  • src/lfx/tests/unit/base/models/test_models_dev_catalog.py

Walkthrough

Model enablement now reuses the model catalog, rejects deprecated or unsupported models in the backend, disables their frontend toggles, and clarifies language-model-only age-based deprecation behavior.

Changes

Model enablement safeguards

Layer / File(s) Summary
Catalog deprecation semantics
src/lfx/src/lfx/base/models/models_dev_catalog.py, src/lfx/tests/unit/base/models/test_models_dev_catalog.py
Documentation and tests clarify that age-based auto-deprecation applies only to language models while static embedding deprecation flags are preserved.
Backend unavailable-model validation
src/backend/base/langflow/api/v1/models.py, src/backend/tests/unit/api/v1/test_models_enabled_providers.py, src/backend/tests/unit/api/v1/test_variable.py
The enabled-model endpoint reuses the fetched catalog, rejects deprecated or unsupported models, removes per-update credential validation, and updates related cleanup tests.
Frontend unavailable-model controls
src/frontend/src/modals/modelProviderModal/components/ModelSelection.tsx, src/frontend/src/modals/modelProviderModal/__tests__/ModelSelection.test.tsx
Deprecated and unsupported model toggles are disabled and covered by a UI test.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ModelSelection
  participant update_enabled_models
  participant ModelCatalog
  Client->>ModelSelection: View model metadata
  ModelSelection->>ModelSelection: Disable deprecated or unsupported toggles
  Client->>update_enabled_models: Submit enabled model IDs
  update_enabled_models->>ModelCatalog: Fetch model catalog
  ModelCatalog-->>update_enabled_models: Return availability metadata
  update_enabled_models-->>Client: Reject unavailable model or update settings
Loading

Possibly related PRs

Suggested labels: lgtm

Suggested reviewers: himavarshavs, edwinjosechittilappilly, lucaseduoli, ramgopalsrikar, cristhianzl

🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly matches the main change: fixing deprecated model settings behavior.
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.
Test Coverage For New Implementations ✅ Passed PASS: Added real regression tests for backend API, frontend toggle disabling, and LFX auto-deprecation; existing cleanup test updated, and filenames match project conventions.
Test Quality And Coverage ✅ Passed Tests cover the new backend 400 path, supported-model 200 flow, frontend disabled-toggle behavior, and LFX age-based deprecation, using the repo’s async pytest/Jest patterns.
Test File Naming And Structure ✅ Passed Changed tests match repo conventions: backend pytest unit files, a frontend .test.tsx Jest/RTL test with grouped describe/beforeEach blocks, and descriptive positive/negative cases.
Excessive Mock Usage Warning ✅ Passed Mocking is scoped to external deps (API key/network/hook isolation); the new deprecated-model tests are integration-style and don’t add extra mocks.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deprecated-model-settings

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.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Advisor

No source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉

Advisory check only — never blocks merge.

@erichare

Copy link
Copy Markdown
Collaborator Author

Release-1.11.0 companion: #14048

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.57143% with 20 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-1.10.3@61d6490). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/backend/base/langflow/api/v1/models.py 9.09% 20 Missing ⚠️

❌ Your patch status has failed because the patch coverage (28.57%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-1.10.3   #14047   +/-   ##
=================================================
  Coverage                  ?   58.58%           
=================================================
  Files                     ?     2307           
  Lines                     ?   220276           
  Branches                  ?    32985           
=================================================
  Hits                      ?   129053           
  Misses                    ?    89737           
  Partials                  ?     1486           
Flag Coverage Δ
backend 65.88% <9.09%> (?)
frontend 57.69% <100.00%> (?)
lfx 54.65% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/modelProviderModal/components/ModelSelection.tsx 99.26% <100.00%> (ø)
src/lfx/src/lfx/base/models/models_dev_catalog.py 86.59% <100.00%> (ø)
src/backend/base/langflow/api/v1/models.py 39.79% <9.09%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 43%
43.54% (58076/133366) 69.19% (7885/11395) 41.56% (1298/3123)

Unit Test Results

Tests Skipped Failures Errors Time
4979 0 💤 0 ❌ 0 🔥 12m 48s ⏱️

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 13, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 13, 2026

@lucaseduoli lucaseduoli 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.

LGTM!

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Jul 14, 2026
@erichare erichare merged commit 39e3234 into release-1.10.3 Jul 14, 2026
125 of 126 checks passed
@erichare erichare deleted the fix/deprecated-model-settings branch July 14, 2026 17:56
erichare added a commit that referenced this pull request Jul 14, 2026
* fix(kb): enforce per-user path containment

* fix(security): protect Docling Serve outbound requests (#14033)

* fix(security): protect Docling Serve requests

* fix(docling): support Self on Python 3.10

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* fix(auth): verify current password on password changes (#14034)

* fix(security): harden MCP stdio configuration (#14036)

* fix(security): restrict MCP stdio package sources

* fix(security): block MCP Docker host access

* fix(security): validate embedded MCP stdio configs

* fix: require executable-only MCP commands

* test: use allowed MCP commands in timeout tests

* fix(security): harden component code module access (#14032)

* fix(security): harden component code module access

* fix(security): block native FFI imports in generated code

* fix: track module assignment aliases in code scanner

* fix(security): address alias review findings

* fix: correct deprecated model settings behavior (#14047)

* fix: prevent deprecated model enablement

* test: use supported model in credential cleanup

* fix(voice): enforce flow authorization on websocket (#14043)

* fix(security): block native FFI imports in generated code (#14040)

* fix(security): block native FFI imports in generated code

* fix: track module assignment aliases in code scanner

* chore: resolve code security conflicts

* fix(security): confine AssemblyAI audio file access (#14037)

* fix(security): confine AssemblyAI audio file access

* [autofix.ci] apply automated fixes

* test: stub optional AssemblyAI dependency

* fix(security): harden AssemblyAI file submission

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: track assignment aliases in component code scanner (#14041)

fix: bind loop and comprehension aliases

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants