Skip to content

Select new default when a model is disabled#10085

Merged
danielpeng2 merged 2 commits intomasterfrom
daniel/handle-disabled-models
May 4, 2026
Merged

Select new default when a model is disabled#10085
danielpeng2 merged 2 commits intomasterfrom
daniel/handle-disabled-models

Conversation

@danielpeng2
Copy link
Copy Markdown
Member

@danielpeng2 danielpeng2 commented May 4, 2026

Description

We have some logic for selecting a new default model if the user's current model is no longer available. However, this logic doesn't account when a model is disabled, which is different from when a model is removed.

This fixes our logic to account for model disablement.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Screenshots / Videos

Testing

Tested locally, verified that it works.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

@cla-bot cla-bot Bot added the cla-signed label May 4, 2026
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@danielpeng2 danielpeng2 requested a review from szgupta May 4, 2026 20:47
@danielpeng2 danielpeng2 marked this pull request as ready for review May 4, 2026 20:47
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 4, 2026

@danielpeng2

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds disabled-model preference reconciliation so stored profile model selections are cleared when the selected model is no longer usable.

Concerns

  • RequiresUpgrade usability now depends on the user's current BYOK key state, but reconciliation only runs when model choices are refreshed. Removing/disabling a provider key can leave the stored disabled model selected until another model-list update occurs.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/ai/llms.rs
/// and not effectively disabled for the current user).
fn usable_info_for_id(&self, id: &LLMId, app: &AppContext) -> Option<&LLMInfo> {
self.info_for_id(id).filter(|info| {
let has_byok_key = is_using_api_key_for_provider(&info.provider, app);
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.

⚠️ [IMPORTANT] RequiresUpgrade usability now depends on the current BYOK key state, but this cleanup only runs on model-list updates. If the user removes or disables the provider key after keeping this preference, the stored disabled model remains selected until another model refresh; rerun this reconciliation on ApiKeyManagerEvent::KeysUpdated or apply usable_info_for_id in the active-model fallback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fixed

@danielpeng2 danielpeng2 merged commit 3abc48b into master May 4, 2026
26 checks passed
@danielpeng2 danielpeng2 deleted the daniel/handle-disabled-models branch May 4, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants