@@ -49,6 +49,19 @@ import { CodexProvider } from "../Services/CodexProvider";
4949import { ServerSettingsService } from "../../serverSettings" ;
5050import { ServerSettingsError } from "@t3tools/contracts" ;
5151
52+ const DEFAULT_CODEX_MODEL_CAPABILITIES : ModelCapabilities = {
53+ reasoningEffortLevels : [
54+ { value : "xhigh" , label : "Extra High" } ,
55+ { value : "high" , label : "High" , isDefault : true } ,
56+ { value : "medium" , label : "Medium" } ,
57+ { value : "low" , label : "Low" } ,
58+ ] ,
59+ supportsFastMode : true ,
60+ supportsThinkingToggle : false ,
61+ contextWindowOptions : [ ] ,
62+ promptInjectedEffortLevels : [ ] ,
63+ } ;
64+
5265const PROVIDER = "codex" as const ;
5366const OPENAI_AUTH_PROVIDERS = new Set ( [ "openai" ] ) ;
5467const BUILT_IN_MODELS : ReadonlyArray < ServerProviderModel > = [
@@ -159,13 +172,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
159172export function getCodexModelCapabilities ( model : string | null | undefined ) : ModelCapabilities {
160173 const slug = model ?. trim ( ) ;
161174 return (
162- BUILT_IN_MODELS . find ( ( candidate ) => candidate . slug === slug ) ?. capabilities ?? {
163- reasoningEffortLevels : [ ] ,
164- supportsFastMode : false ,
165- supportsThinkingToggle : false ,
166- contextWindowOptions : [ ] ,
167- promptInjectedEffortLevels : [ ] ,
168- }
175+ BUILT_IN_MODELS . find ( ( candidate ) => candidate . slug === slug ) ?. capabilities ??
176+ DEFAULT_CODEX_MODEL_CAPABILITIES
169177 ) ;
170178}
171179
@@ -339,7 +347,12 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
339347 Effect . map ( ( settings ) => settings . providers . codex ) ,
340348 ) ;
341349 const checkedAt = new Date ( ) . toISOString ( ) ;
342- const models = providerModelsFromSettings ( BUILT_IN_MODELS , PROVIDER , codexSettings . customModels ) ;
350+ const models = providerModelsFromSettings (
351+ BUILT_IN_MODELS ,
352+ PROVIDER ,
353+ codexSettings . customModels ,
354+ DEFAULT_CODEX_MODEL_CAPABILITIES ,
355+ ) ;
343356
344357 if ( ! codexSettings . enabled ) {
345358 return buildServerProvider ( {
0 commit comments