Auto-apply paid defaults (model + web search) for pro/max/team users#470
Merged
AnthonyRonning merged 1 commit intomasterfrom Apr 14, 2026
Merged
Conversation
- Add one-time paid defaults flip: when billing confirms pro/max/team and paidDefaultsApplied is not set, auto-select 'Powerful' model (kimi-k2-5) and enable web search - Store paidDefaultsApplied as ISO date string for future extensibility - Add getInitialWebSearchEnabled() for billing-aware fast initial load - Add setModelInternal() to distinguish system vs user model changes - Respect manual user choices: once defaults are applied, never override - Handle downgrade: clear paid defaults when switching to free/starter - Remove WebSearchInfoDialog entirely (no longer needed with auto-enable) - Simplify web search toggle handlers (remove first-time dialog logic) Co-Authored-By: tony@opensecret.cloud <TonyGiorgio@protonmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
Contributor
|
Worked for me
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user upgrades to a pro/max/team plan, we now automatically select the "Powerful" model (kimi-k2-5) and enable web search as a one-time flip. This addresses the problem of paid users staying on the default free model with no web search, leading to a degraded experience and refund requests.
Key changes:
LocalStateContext.tsx): WhensetBillingStatusdetects a pro/max/team plan andpaidDefaultsAppliedis not set in localStorage, auto-set model tokimi-k2-5and enable web search. ThepaidDefaultsAppliedkey stores an ISO date string for future extensibility.setModelInternalvssetModelsplit: New internal setter for system-initiated model changes (billing logic). The publicsetModelcontinues to be used for user-initiated changes. Both write toselectedModelin localStorage.getInitialWebSearchEnabled(): New exported function that checks localStorage →paidDefaultsApplied→ cached billing status, so returning paid users see correct defaults instantly on load (no flicker).paidDefaultsAppliedandselectedModelso defaults re-apply if they upgrade again.WebSearchInfoDialog: The first-time web search explainer dialog is deleted entirely. Toggle handlers simplified to just flip the boolean.UnifiedChat.tsx: A newuseEffectpicks up the localStoragewebSearchEnabledvalue whenlocalState.billingStatuschanges, so the UI reflects the one-time flip without a full remount.Review & Testing Checklist for Human
paidDefaultsAppliedwas already set. The one-time flip should NOT override existing preferences.paidDefaultsAppliedandselectedModelare cleared. On re-upgrade, defaults should re-apply. Confirm this doesn't surprise users who had a model preference before downgrading.getInitialModel()andgetInitialWebSearchEnabled()read cached billing synchronously. Verify there's no visible flicker — model and web search should be correct from the first render.useEffectsync in UnifiedChat (lines 965-972): This reads localStorage whenlocalState.billingStatuschanges. Confirm it doesn't cause a write-loop with theuseEffectthat persistsisWebSearchEnabledto localStorage (lines 960-962). They should converge since the value is the same, but worth confirming in practice.Notes
paidDefaultsAppliedstores an ISO date string (not a boolean) so future features can check when defaults were applied and decide whether to apply newer defaults.setModelInternalandsetModelwrite toselectedModelin localStorage — the system vs user distinction is conceptual and gated bypaidDefaultsApplied, not by a separate storage key.returninsetBillingStatusafter applying paid defaults (around line 253) means the subsequentbillingChangedmodel-update logic is skipped on first application. This is intentional since defaults are set right there.Link to Devin session: https://app.devin.ai/sessions/b7ad265f32ad4e3e81f69a4555f1ac50