@@ -20,7 +20,10 @@ import * as DateTime from "effect/DateTime";
2020import * as Effect from "effect/Effect" ;
2121import * as Layer from "effect/Layer" ;
2222
23- import { getModelSelectionStringOptionValue } from "@t3tools/shared/model" ;
23+ import {
24+ getModelSelectionBooleanOptionValue ,
25+ getModelSelectionStringOptionValue ,
26+ } from "@t3tools/shared/model" ;
2427import * as ProviderRegistry from "../provider/ProviderRegistry.ts" ;
2528import * as AnalyticsService from "./AnalyticsService.ts" ;
2629import { catalogModelLabel } from "./ProviderDimensions.ts" ;
@@ -106,6 +109,22 @@ function selectedEffort(selection: ModelSelection): string | undefined {
106109 return effort !== undefined && REPORTED_EFFORTS . has ( effort ) ? effort : undefined ;
107110}
108111
112+ // Codex sends a tier id (its "fast" config shows up as "priority"); Claude has a fastMode toggle.
113+ const REPORTED_SERVICE_TIERS : ReadonlyMap < string , string > = new Map ( [
114+ [ "default" , "standard" ] ,
115+ [ "flex" , "flex" ] ,
116+ [ "fast" , "fast" ] ,
117+ [ "priority" , "fast" ] ,
118+ [ "ultrafast" , "ultrafast" ] ,
119+ ] ) ;
120+
121+ function selectedServiceTier ( selection : ModelSelection ) : string | undefined {
122+ const tier = getModelSelectionStringOptionValue ( selection , "serviceTier" ) ;
123+ if ( tier !== undefined ) return REPORTED_SERVICE_TIERS . get ( tier ) ;
124+ const fastMode = getModelSelectionBooleanOptionValue ( selection , "fastMode" ) ;
125+ return fastMode === undefined ? undefined : fastMode ? "fast" : "standard" ;
126+ }
127+
109128/**
110129 * Confirmed models across counted work. Unknown when any piece of work has no
111130 * reported model, unless two distinct models were already seen.
@@ -130,6 +149,7 @@ function selectionProperties(
130149 return defined ( {
131150 model : selection === undefined ? undefined : label ( selection . model ) ,
132151 effort : selection === undefined ? undefined : selectedEffort ( selection ) ,
152+ serviceTier : selection === undefined ? undefined : selectedServiceTier ( selection ) ,
133153 runtimeMode : context ?. runtimeMode ,
134154 interactionMode : context ?. interactionMode ,
135155 ...context ?. origin ,
0 commit comments