mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 06:01:14 +00:00
fix(ai): clean up openai-codex models and token limits
This commit is contained in:
parent
10e651f99b
commit
d893ba7f20
7 changed files with 84 additions and 419 deletions
|
|
@ -44,17 +44,17 @@ export type CacheMetadata = {
|
|||
url: string;
|
||||
};
|
||||
|
||||
export function getModelFamily(normalizedModel: string): ModelFamily {
|
||||
if (normalizedModel.includes("gpt-5.2-codex") || normalizedModel.includes("gpt 5.2 codex")) {
|
||||
export function getModelFamily(model: string): ModelFamily {
|
||||
if (model.includes("gpt-5.2-codex") || model.includes("gpt 5.2 codex")) {
|
||||
return "gpt-5.2-codex";
|
||||
}
|
||||
if (normalizedModel.includes("codex-max")) {
|
||||
if (model.includes("codex-max")) {
|
||||
return "codex-max";
|
||||
}
|
||||
if (normalizedModel.includes("codex") || normalizedModel.startsWith("codex-")) {
|
||||
if (model.includes("codex") || model.startsWith("codex-")) {
|
||||
return "codex";
|
||||
}
|
||||
if (normalizedModel.includes("gpt-5.2")) {
|
||||
if (model.includes("gpt-5.2")) {
|
||||
return "gpt-5.2";
|
||||
}
|
||||
return "gpt-5.1";
|
||||
|
|
@ -96,8 +96,8 @@ async function getLatestReleaseTag(): Promise<string> {
|
|||
throw new Error("Failed to determine latest release tag from GitHub");
|
||||
}
|
||||
|
||||
export async function getCodexInstructions(normalizedModel = "gpt-5.1-codex"): Promise<string> {
|
||||
const modelFamily = getModelFamily(normalizedModel);
|
||||
export async function getCodexInstructions(model = "gpt-5.1-codex"): Promise<string> {
|
||||
const modelFamily = getModelFamily(model);
|
||||
const promptFile = PROMPT_FILES[modelFamily];
|
||||
const cacheDir = getCacheDir();
|
||||
const cacheFile = join(cacheDir, CACHE_FILES[modelFamily]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue