feat(codex): add gpt-5.2 codex prompt handling

This change introduces specific logic to load and use instructions for the 'gpt-5.2-codex' model variant by recognizing the 'gpt-5.2-codex_prompt.md' filename. This ensures the correct prompts are used when the '5.2-codex' model is identified, complementing the recent addition of its definition.
This commit is contained in:
Luis Pater
2025-12-19 11:39:51 +08:00
parent 718ff7a73f
commit ca09db21ff
2 changed files with 1458 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ func CodexInstructionsForModel(modelName, systemInstructions string) (bool, stri
lastCodexMaxPrompt := ""
last51Prompt := ""
last52Prompt := ""
last52CodexPrompt := ""
// lastReviewPrompt := ""
for _, entry := range entries {
content, _ := codexInstructionsDir.ReadFile("codex_instructions/" + entry.Name())
@@ -36,12 +37,16 @@ func CodexInstructionsForModel(modelName, systemInstructions string) (bool, stri
last51Prompt = string(content)
} else if strings.HasPrefix(entry.Name(), "gpt_5_2_prompt.md") {
last52Prompt = string(content)
} else if strings.HasPrefix(entry.Name(), "gpt-5.2-codex_prompt.md") {
last52CodexPrompt = string(content)
} else if strings.HasPrefix(entry.Name(), "review_prompt.md") {
// lastReviewPrompt = string(content)
}
}
if strings.Contains(modelName, "codex-max") {
return false, lastCodexMaxPrompt
} else if strings.Contains(modelName, "5.2-codex") {
return false, last52CodexPrompt
} else if strings.Contains(modelName, "codex") {
return false, lastCodexPrompt
} else if strings.Contains(modelName, "5.1") {

File diff suppressed because one or more lines are too long