@@ -20,7 +20,10 @@ import {
2020 loadModelCatalogForBrowse ,
2121 type ModelCatalogBrowseView ,
2222} from "../../agents/model-catalog-browse.js" ;
23- import { resolveVisibleModelCatalog } from "../../agents/model-catalog-visibility.js" ;
23+ import {
24+ isCodexRoutableOpenAIPlatformCatalogEntry ,
25+ resolveVisibleModelCatalog ,
26+ } from "../../agents/model-catalog-visibility.js" ;
2427import type { ModelCatalogEntry } from "../../agents/model-catalog.types.js" ;
2528import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js" ;
2629import type { OpenClawConfig } from "../../config/types.openclaw.js" ;
@@ -37,16 +40,7 @@ type ModelsListProviderAuthChecker = (
3740
3841let loggedSlowModelsListCatalog = false ;
3942const OAUTH_REFRESH_MARGIN_MS = 5 * 60 * 1000 ;
40- const OPENAI_PROVIDER_ID = "openai" ;
4143const OPENAI_CODEX_RESPONSES_API = "openai-chatgpt-responses" ;
42- const OPENAI_CODEX_ROUTABLE_MODEL_IDS = new Set ( [
43- "gpt-5.5" ,
44- "gpt-5.5-pro" ,
45- "gpt-5.4" ,
46- "gpt-5.4-codex" ,
47- "gpt-5.4-pro" ,
48- "gpt-5.4-mini" ,
49- ] ) ;
5044
5145// Unknown views are rejected by protocol validation first; this helper keeps the
5246// handler default explicit for older clients that omit the field.
@@ -211,15 +205,6 @@ function createModelsListProviderAuthChecker(params: {
211205 ) ;
212206}
213207
214- function isCodexRoutableOpenAIPlatformCatalogEntry ( entry : ModelCatalogEntry ) : boolean {
215- return (
216- normalizeProviderId ( entry . provider ) === OPENAI_PROVIDER_ID &&
217- entry . api !== undefined &&
218- entry . api !== OPENAI_CODEX_RESPONSES_API &&
219- OPENAI_CODEX_ROUTABLE_MODEL_IDS . has ( entry . id . trim ( ) . toLowerCase ( ) )
220- ) ;
221- }
222-
223208async function resolveModelsListEntryAvailability (
224209 providerAuthChecker : ModelsListProviderAuthChecker ,
225210 entry : ModelCatalogEntry ,
0 commit comments