feat(web): sticky provider options and Grok composer affordances #5426
ClosedEnzoTironi(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/5426/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/composerDraftStore.ts lines 1042 to 1042OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1022,5 +1035,8 @@10221035 activeSelection.model,10231036 ))10241037 : baseModel;1038+ // Prefer draft options, then sticky (user's last picker choice), then1039+ // thread/project so changing effort on an existing thread reaches sendTurn.10251040 const modelOptions =10261041 modelSelectionByProviderToOptions(input.draft?.modelSelectionByProvider) ??1042+ providerSelectionsFromModelSelection(stickySelection) ??apps/web/src/composerDraftStore.ts line 1018OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1004,4 +1010,9 @@10041010 : undefined;10051011 const legacySelection =10061012 input.draft?.modelSelectionByProvider?.[ProviderInstanceId.make(input.selectedProvider)];1007- const activeSelection = instanceSelection ?? legacySelection;1013+ const stickyInstanceKey =1014+ input.selectedInstanceId ?? ProviderInstanceId.make(input.selectedProvider);1015+ const stickySelection =1016+ input.stickyModelSelectionByProvider?.[stickyInstanceKey] ??1017+ input.stickyModelSelectionByProvider?.[ProviderInstanceId.make(input.selectedProvider)];1018+ const activeSelection = instanceSelection ?? legacySelection ?? stickySelection;
- apps/web/src/composerDraftStore.ts line 1023OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1004,7 +1010,14 @@10041010 : undefined;10051011 const legacySelection =10061012 input.draft?.modelSelectionByProvider?.[ProviderInstanceId.make(input.selectedProvider)];1007- const activeSelection = instanceSelection ?? legacySelection;1013+ const stickyInstanceKey =1014+ input.selectedInstanceId ?? ProviderInstanceId.make(input.selectedProvider);1015+ const stickySelection =1016+ input.stickyModelSelectionByProvider?.[stickyInstanceKey] ??1017+ input.stickyModelSelectionByProvider?.[ProviderInstanceId.make(input.selectedProvider)];1018+ const activeSelection = instanceSelection ?? legacySelection ?? stickySelection;10081019 const activeSelectionInstanceId = instanceSelection10091020 ? (input.selectedInstanceId ?? ProviderInstanceId.make(input.selectedProvider))1010- : ProviderInstanceId.make(input.selectedProvider);1021+ : legacySelection1022+ ? ProviderInstanceId.make(input.selectedProvider)1023+ : stickyInstanceKey;
EnzoTironi(GitHub profile, opens in a new tab) changed the title
- apps/web/src/composerDraftStore.ts line 1073Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1016,11 +1028,19 @@1016- activeSelection.model,1028+ draftSelection.model,10171029 ) ??10181030 resolveAppModelSelection(10191031 input.selectedProvider,10201032 input.settings,10211033 input.providers,1022- activeSelection.model,1034+ draftSelection.model,10231035 ))10241036 : baseModel;1037+ // Prefer draft options, then sticky (user's last picker choice) re-keyed1038+ // under the selected instance so custom instances resolve options, then1039+ // thread/project so changing effort on an existing thread reaches sendTurn.1040+ const stickyOptions =1041+ stickySelection?.options && stickySelection.options.length > 01042+ ? { [stickyInstanceKey]: stickySelection.options }1043+ : null;10251044 const modelOptions =10261045 modelSelectionByProviderToOptions(input.draft?.modelSelectionByProvider) ??1046+ stickyOptions ??
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/web/src/composerDraftStore.ts line 1066Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1024,0 +1040,21 @@1040+ // Prefer draft options for the *selected* instance only. Options for1041+ // another instance (e.g. codex effort on a draft while Grok is selected)1042+ // must not short-circuit sticky/thread/project for the current selection.1043+ // Sticky (and legacy kind-keyed draft hits) are re-keyed under1044+ // stickyInstanceKey so custom instances resolve options.1045+ const legacyProviderKey = ProviderInstanceId.make(input.selectedProvider);1046+ const draftOptionsAtInstance = optionsForInstance(1047+ input.draft?.modelSelectionByProvider,1048+ stickyInstanceKey,1049+ );1050+ const legacyDraftOptions =1051+ String(stickyInstanceKey) !== String(legacyProviderKey)1052+ ? optionsForInstance(input.draft?.modelSelectionByProvider, legacyProviderKey)?.[1053+ String(legacyProviderKey)1054+ ]1055+ : undefined;1056+ const draftOptionsForSelected =1057+ draftOptionsAtInstance ??1058+ (legacyDraftOptions && legacyDraftOptions.length > 01059+ ? { [stickyInstanceKey]: legacyDraftOptions }1060+ : null);
EnzoTironi(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.





Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
3d1ee52c-3742-43a8-b678-ff97d59e5982You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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