@@ -19,10 +19,11 @@ export interface FreebuffModelOption {
1919
2020export const FREEBUFF_DEPLOYMENT_HOURS_LABEL = '9am ET-5pm PT'
2121export const FREEBUFF_GLM_MODEL_ID = 'z-ai/glm-5.1'
22+ export const FREEBUFF_MINIMAX_MODEL_ID = 'minimax/minimax-m2.7'
2223
2324export const FREEBUFF_MODELS = [
2425 {
25- id : 'minimax/minimax-m2.7' ,
26+ id : FREEBUFF_MINIMAX_MODEL_ID ,
2627 displayName : 'MiniMax M2.7' ,
2728 tagline : 'Fastest' ,
2829 availability : 'always' ,
@@ -37,7 +38,18 @@ export const FREEBUFF_MODELS = [
3738
3839export type FreebuffModelId = ( typeof FREEBUFF_MODELS ) [ number ] [ 'id' ]
3940
40- export const DEFAULT_FREEBUFF_MODEL_ID : FreebuffModelId = FREEBUFF_MODELS [ 0 ] . id
41+ /** What new freebuff users see selected in the picker. May not be currently
42+ * available (GLM is closed outside deployment hours); callers that need an
43+ * always-available id for resolution / auto-fallbacks should use
44+ * FALLBACK_FREEBUFF_MODEL_ID instead. */
45+ export const DEFAULT_FREEBUFF_MODEL_ID : FreebuffModelId = FREEBUFF_GLM_MODEL_ID
46+
47+ /** Always-available fallback used when the requested model can't be served
48+ * right now (unknown id, deployment hours closed, etc.). Kept distinct from
49+ * DEFAULT_FREEBUFF_MODEL_ID so a new user's "preferred default" can be the
50+ * smartest model without auto-flipping anyone to a closed deployment. */
51+ export const FALLBACK_FREEBUFF_MODEL_ID : FreebuffModelId =
52+ FREEBUFF_MINIMAX_MODEL_ID
4153
4254export function isFreebuffModelId (
4355 id : string | null | undefined ,
@@ -49,13 +61,13 @@ export function isFreebuffModelId(
4961export function resolveFreebuffModel (
5062 id : string | null | undefined ,
5163) : FreebuffModelId {
52- return isFreebuffModelId ( id ) ? id : DEFAULT_FREEBUFF_MODEL_ID
64+ return isFreebuffModelId ( id ) ? id : FALLBACK_FREEBUFF_MODEL_ID
5365}
5466
5567export function getFreebuffModel ( id : string ) : FreebuffModelOption {
5668 return (
5769 FREEBUFF_MODELS . find ( ( m ) => m . id === id ) ??
58- FREEBUFF_MODELS . find ( ( m ) => m . id === DEFAULT_FREEBUFF_MODEL_ID ) !
70+ FREEBUFF_MODELS . find ( ( m ) => m . id === FALLBACK_FREEBUFF_MODEL_ID ) !
5971 )
6072}
6173
@@ -102,5 +114,5 @@ export function resolveAvailableFreebuffModel(
102114 const resolved = resolveFreebuffModel ( id )
103115 return isFreebuffModelAvailable ( resolved , now )
104116 ? resolved
105- : DEFAULT_FREEBUFF_MODEL_ID
117+ : FALLBACK_FREEBUFF_MODEL_ID
106118}
0 commit comments