Skip to content

fix(model): hide disabled provider models#1574

Merged
zerob13 merged 1 commit intodevfrom
fix-model-list
Apr 30, 2026
Merged

fix(model): hide disabled provider models#1574
zerob13 merged 1 commit intodevfrom
fix-model-list

Conversation

@zhangmo8
Copy link
Copy Markdown
Collaborator

@zhangmo8 zhangmo8 commented Apr 30, 2026

Summary

  • hide stale enabled models when a provider is disabled or removed
  • purge removed provider model state from the renderer store
  • keep new thread, chat status bar, and MCP sampling model pickers aligned

Testing

  • Not run manually (per request)
  • Git hooks auto-ran staged formatting and typecheck during commit

Summary by CodeRabbit

  • Bug Fixes

    • Models from disabled providers are now properly filtered out from model selection lists and sampling defaults, ensuring only active providers' models appear in the interface.
  • Refactor

    • Optimized model availability tracking to dynamically filter enabled models based on currently-enabled providers, with automatic cleanup of disabled providers' cached data.

Prevent stale enabled models from remaining visible after a\nprovider is disabled or removed.\n\nKeep new-thread, status bar, and MCP sampling selection logic\naligned with the active provider set.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 125b9410-774e-4d78-9850-2010603b27ec

📥 Commits

Reviewing files that changed from the base of the PR and between 41d3f6d and db04593.

📒 Files selected for processing (5)
  • src/renderer/src/components/chat/ChatStatusBar.vue
  • src/renderer/src/pages/NewThreadPage.vue
  • src/renderer/src/stores/mcpSampling.ts
  • src/renderer/src/stores/modelStore.ts
  • test/renderer/stores/modelStore.test.ts

📝 Walkthrough

Walkthrough

A new activeEnabledModels computed property filters enabled models to only include those from currently-enabled providers. Multiple components and stores now consume this filtered set instead of all enabled models, with cleanup logic purging models when providers are disabled.

Changes

Cohort / File(s) Summary
Model Store Core Logic
src/renderer/src/stores/modelStore.ts
Added activeProviderIds and activeEnabledModels computed properties to filter enabled models by active provider status. Introduced cleanup helpers and watcher to purge provider-specific models when providers are disabled. Updated searchModels to operate on filtered set.
Component Consumers
src/renderer/src/components/chat/ChatStatusBar.vue, src/renderer/src/pages/NewThreadPage.vue, src/renderer/src/stores/mcpSampling.ts
Refactored model picker and resolution logic to source from activeEnabledModels computed (falling back to enabledModels when unavailable). Updated helper functions and matching logic to use filtered model groups.
Test Coverage
test/renderer/stores/modelStore.test.ts
Enhanced test harness with reactive providerStore mock. Added unit tests validating activeEnabledModels filtering and provider removal/purge behavior.

Sequence Diagram

sequenceDiagram
    participant User
    participant Component as Component/Page
    participant ModelStore
    participant ProviderStore
    
    User->>ProviderStore: Enable/Disable Provider
    ProviderStore->>ModelStore: Provider state changes
    ModelStore->>ModelStore: Watcher detects provider ID change
    ModelStore->>ModelStore: Update activeProviderIds
    ModelStore->>ModelStore: Recompute activeEnabledModels
    Note over ModelStore: If provider disabled: purge<br/>models & related metadata
    ModelStore->>Component: activeEnabledModels updated
    Component->>Component: Re-render with filtered models
    Component-->>User: Display available models
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Hoppy models now spring forth with grace,
Filtered by providers in their place,
When one hops away, the cleanup runs swift,
Components refresh with each provider shift!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(model): hide disabled provider models' clearly and concisely describes the main change—hiding models from disabled providers—which is the primary objective across all modified files (ChatStatusBar, NewThreadPage, mcpSampling, and modelStore).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-model-list

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@zerob13 zerob13 merged commit a863686 into dev Apr 30, 2026
3 checks passed
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