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:
+3
-10
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user