refactor(agents): replace per-version GPT checks with regex pattern

Replace isGpt5_4Model + isGpt5_5Model + OR-composed isGptNativeSisyphusModel
with a single regex matching GPT-5.x where x >= 4. Automatically covers
future versions (5.6, 5.7, 5.10+) without code changes.

Constraint: Must continue to reject gpt-5.3-codex and gpt-5.x where x < 4
Rejected: Per-version functions | not scalable, each new version adds a function + OR clause
Confidence: high
Scope-risk: narrow
This commit is contained in:
acamq
2026-04-23 20:37:06 -06:00
parent 132c860bee
commit 563b6569d3
2 changed files with 27 additions and 58 deletions
+3 -10
View File
@@ -79,18 +79,11 @@ export function isGptModel(model: string): boolean {
return modelName.includes("gpt");
}
export function isGpt5_4Model(model: string): boolean {
const modelName = extractModelName(model).toLowerCase();
return modelName.includes("gpt-5.4") || modelName.includes("gpt-5-4");
}
export function isGpt5_5Model(model: string): boolean {
const modelName = extractModelName(model).toLowerCase();
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
}
const GPT_NATIVE_SISYPHUS_RE = /gpt-5[.-](?:[4-9]|\d{2,})/i;
export function isGptNativeSisyphusModel(model: string): boolean {
return isGpt5_4Model(model) || isGpt5_5Model(model);
const modelName = extractModelName(model).toLowerCase();
return GPT_NATIVE_SISYPHUS_RE.test(modelName);
}
export function isGpt5_3CodexModel(model: string): boolean {