From ca09db21ff56982674482788cc39858a984e3fb7 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Fri, 19 Dec 2025 11:39:51 +0800 Subject: [PATCH] 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. --- internal/misc/codex_instructions.go | 5 + ...1-f084e5264b1b0ae9eb8c63c950c0953f40966fed | 1453 +++++++++++++++++ 2 files changed, 1458 insertions(+) create mode 100644 internal/misc/codex_instructions/gpt-5.2-codex_prompt.md-001-f084e5264b1b0ae9eb8c63c950c0953f40966fed diff --git a/internal/misc/codex_instructions.go b/internal/misc/codex_instructions.go index b47ebf27..17130cbe 100644 --- a/internal/misc/codex_instructions.go +++ b/internal/misc/codex_instructions.go @@ -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") { diff --git a/internal/misc/codex_instructions/gpt-5.2-codex_prompt.md-001-f084e5264b1b0ae9eb8c63c950c0953f40966fed b/internal/misc/codex_instructions/gpt-5.2-codex_prompt.md-001-f084e5264b1b0ae9eb8c63c950c0953f40966fed new file mode 100644 index 00000000..8a1dd912 --- /dev/null +++ b/internal/misc/codex_instructions/gpt-5.2-codex_prompt.md-001-f084e5264b1b0ae9eb8c63c950c0953f40966fed @@ -0,0 +1,1453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + codex/codex-rs/core/gpt-5.2-codex_prompt.md at f084e5264b1b0ae9eb8c63c950c0953f40966fed · openai/codex · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ Skip to content + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ +
+
+ +
+ +
+

Footer

+ + + + +
+
+ + + + + © 2025 GitHub, Inc. + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + +