mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:31:24 +00:00
Agents: allow gpt-5.3-codex-spark in fallback and thinking (#14990)
* Agents: allow gpt-5.3-codex-spark in fallback and thinking * Fix: model picker issue for openai-codex/gpt-5.3-codex-spark Fixed an issue in the model picker.
This commit is contained in:
@@ -27,6 +27,35 @@ let hasLoggedModelCatalogError = false;
|
||||
const defaultImportPiSdk = () => import("./pi-model-discovery.js");
|
||||
let importPiSdk = defaultImportPiSdk;
|
||||
|
||||
const CODEX_PROVIDER = "openai-codex";
|
||||
const OPENAI_CODEX_GPT53_MODEL_ID = "gpt-5.3-codex";
|
||||
const OPENAI_CODEX_GPT53_SPARK_MODEL_ID = "gpt-5.3-codex-spark";
|
||||
|
||||
function applyOpenAICodexSparkFallback(models: ModelCatalogEntry[]): void {
|
||||
const hasSpark = models.some(
|
||||
(entry) =>
|
||||
entry.provider === CODEX_PROVIDER &&
|
||||
entry.id.toLowerCase() === OPENAI_CODEX_GPT53_SPARK_MODEL_ID,
|
||||
);
|
||||
if (hasSpark) {
|
||||
return;
|
||||
}
|
||||
|
||||
const baseModel = models.find(
|
||||
(entry) =>
|
||||
entry.provider === CODEX_PROVIDER && entry.id.toLowerCase() === OPENAI_CODEX_GPT53_MODEL_ID,
|
||||
);
|
||||
if (!baseModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
models.push({
|
||||
...baseModel,
|
||||
id: OPENAI_CODEX_GPT53_SPARK_MODEL_ID,
|
||||
name: OPENAI_CODEX_GPT53_SPARK_MODEL_ID,
|
||||
});
|
||||
}
|
||||
|
||||
export function resetModelCatalogCacheForTest() {
|
||||
modelCatalogPromise = null;
|
||||
hasLoggedModelCatalogError = false;
|
||||
@@ -94,6 +123,7 @@ export async function loadModelCatalog(params?: {
|
||||
const input = Array.isArray(entry?.input) ? entry.input : undefined;
|
||||
models.push({ id, name, provider, contextWindow, reasoning, input });
|
||||
}
|
||||
applyOpenAICodexSparkFallback(models);
|
||||
|
||||
if (models.length === 0) {
|
||||
// If we found nothing, don't cache this result so we can try again.
|
||||
|
||||
Reference in New Issue
Block a user