style: deduplicate template constants and catalog lookups
Address Greptile review feedback: - Remove redundant OPENAI_CODEX_GPT_54_MINI_TEMPLATE_MODEL_IDS constant, reuse OPENAI_CODEX_GPT_54_TEMPLATE_MODEL_IDS directly (same values) - Remove redundant findCatalogTemplate call in both provider plugin and bundled catalog metadata, reuse existing gpt54Template variable - Mini uses the same template resolution path as gpt-5.4, making this explicit rather than hiding it behind identically-valued constants
This commit is contained in:
parent
fa699c157d
commit
37ac0a0ee3
@ -35,7 +35,6 @@ const OPENAI_CODEX_GPT_54_MINI_MODEL_ID = "gpt-5.4-mini";
|
||||
const OPENAI_CODEX_GPT_54_CONTEXT_TOKENS = 1_050_000;
|
||||
const OPENAI_CODEX_GPT_54_MAX_TOKENS = 128_000;
|
||||
const OPENAI_CODEX_GPT_54_TEMPLATE_MODEL_IDS = ["gpt-5.3-codex", "gpt-5.2-codex"] as const;
|
||||
const OPENAI_CODEX_GPT_54_MINI_TEMPLATE_MODEL_IDS = ["gpt-5.3-codex", "gpt-5.2-codex"] as const;
|
||||
const OPENAI_CODEX_GPT_53_MODEL_ID = "gpt-5.3-codex";
|
||||
const OPENAI_CODEX_GPT_53_SPARK_MODEL_ID = "gpt-5.3-codex-spark";
|
||||
const OPENAI_CODEX_GPT_53_SPARK_CONTEXT_TOKENS = 128_000;
|
||||
@ -104,7 +103,7 @@ function resolveCodexForwardCompatModel(
|
||||
maxTokens: OPENAI_CODEX_GPT_54_MAX_TOKENS,
|
||||
};
|
||||
} else if (lower === OPENAI_CODEX_GPT_54_MINI_MODEL_ID) {
|
||||
templateIds = OPENAI_CODEX_GPT_54_MINI_TEMPLATE_MODEL_IDS;
|
||||
templateIds = OPENAI_CODEX_GPT_54_TEMPLATE_MODEL_IDS;
|
||||
} else if (lower === OPENAI_CODEX_GPT_53_SPARK_MODEL_ID) {
|
||||
templateIds = [OPENAI_CODEX_GPT_53_MODEL_ID, ...OPENAI_CODEX_TEMPLATE_MODEL_IDS];
|
||||
patch = {
|
||||
@ -272,11 +271,6 @@ export function buildOpenAICodexProviderPlugin(): ProviderPlugin {
|
||||
providerId: PROVIDER_ID,
|
||||
templateIds: OPENAI_CODEX_GPT_54_TEMPLATE_MODEL_IDS,
|
||||
});
|
||||
const gpt54MiniTemplate = findCatalogTemplate({
|
||||
entries: ctx.entries,
|
||||
providerId: PROVIDER_ID,
|
||||
templateIds: OPENAI_CODEX_GPT_54_MINI_TEMPLATE_MODEL_IDS,
|
||||
});
|
||||
const sparkTemplate = findCatalogTemplate({
|
||||
entries: ctx.entries,
|
||||
providerId: PROVIDER_ID,
|
||||
@ -290,9 +284,9 @@ export function buildOpenAICodexProviderPlugin(): ProviderPlugin {
|
||||
name: OPENAI_CODEX_GPT_54_MODEL_ID,
|
||||
}
|
||||
: undefined,
|
||||
gpt54MiniTemplate
|
||||
gpt54Template
|
||||
? {
|
||||
...gpt54MiniTemplate,
|
||||
...gpt54Template,
|
||||
id: OPENAI_CODEX_GPT_54_MINI_MODEL_ID,
|
||||
name: OPENAI_CODEX_GPT_54_MINI_MODEL_ID,
|
||||
}
|
||||
|
||||
@ -53,11 +53,6 @@ export function augmentBundledProviderCatalog(
|
||||
providerId: OPENAI_CODEX_PROVIDER_ID,
|
||||
templateIds: ["gpt-5.3-codex", "gpt-5.2-codex"],
|
||||
});
|
||||
const openAiCodexGpt54MiniTemplate = findCatalogTemplate({
|
||||
entries: context.entries,
|
||||
providerId: OPENAI_CODEX_PROVIDER_ID,
|
||||
templateIds: ["gpt-5.3-codex", "gpt-5.2-codex"],
|
||||
});
|
||||
const openAiCodexSparkTemplate = findCatalogTemplate({
|
||||
entries: context.entries,
|
||||
providerId: OPENAI_CODEX_PROVIDER_ID,
|
||||
@ -100,9 +95,9 @@ export function augmentBundledProviderCatalog(
|
||||
name: "gpt-5.4",
|
||||
}
|
||||
: undefined,
|
||||
openAiCodexGpt54MiniTemplate
|
||||
openAiCodexGpt54Template
|
||||
? {
|
||||
...openAiCodexGpt54MiniTemplate,
|
||||
...openAiCodexGpt54Template,
|
||||
id: "gpt-5.4-mini",
|
||||
name: "gpt-5.4-mini",
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user