From cf9b9be7ea889825d76e1a6944d2098a476b0b17 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Fri, 14 Nov 2025 08:08:25 +0800 Subject: [PATCH] **feat(runtime): extend executor support for GPT-5.1 Codex and variants** Expand executor logic to handle GPT-5.1 Codex family and its variants, including reasoning effort configurations for minimal, low, medium, and high levels. Ensure proper mapping of models to payload parameters. --- internal/runtime/executor/codex_executor.go | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/internal/runtime/executor/codex_executor.go b/internal/runtime/executor/codex_executor.go index 59961c03..36e8359a 100644 --- a/internal/runtime/executor/codex_executor.go +++ b/internal/runtime/executor/codex_executor.go @@ -239,6 +239,38 @@ func (e *CodexExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Au case "gpt-5-codex-mini-high": body, _ = sjson.SetBytes(body, "reasoning.effort", "high") } + } else if util.InArray([]string{"gpt-5.1", "gpt-5.1-minimal", "gpt-5.1-low", "gpt-5.1-medium", "gpt-5.1-high"}, req.Model) { + body, _ = sjson.SetBytes(body, "model", "gpt-5.1") + switch req.Model { + case "gpt-5.1-minimal": + body, _ = sjson.SetBytes(body, "reasoning.effort", "minimal") + case "gpt-5.1-low": + body, _ = sjson.SetBytes(body, "reasoning.effort", "low") + case "gpt-5.1-medium": + body, _ = sjson.SetBytes(body, "reasoning.effort", "medium") + case "gpt-5.1-high": + body, _ = sjson.SetBytes(body, "reasoning.effort", "high") + } + } else if util.InArray([]string{"gpt-5.1-codex", "gpt-5.1-codex-low", "gpt-5.1-codex-medium", "gpt-5.1-codex-high"}, req.Model) { + body, _ = sjson.SetBytes(body, "model", "gpt-5.1-codex") + switch req.Model { + case "gpt-5.1-codex-low": + body, _ = sjson.SetBytes(body, "reasoning.effort", "low") + case "gpt-5.1-codex-medium": + body, _ = sjson.SetBytes(body, "reasoning.effort", "medium") + case "gpt-5.1-codex-high": + body, _ = sjson.SetBytes(body, "reasoning.effort", "high") + } + } else if util.InArray([]string{"gpt-5.1-codex-mini", "gpt-5.1-codex-mini-medium", "gpt-5.1-codex-mini-high"}, req.Model) { + body, _ = sjson.SetBytes(body, "model", "gpt-5.1-codex-mini") + switch req.Model { + case "gpt-5.1-codex-mini-medium": + body, _ = sjson.SetBytes(body, "reasoning.effort", "medium") + case "gpt-5.1-codex-mini-high": + body, _ = sjson.SetBytes(body, "reasoning.effort", "high") + default: + body, _ = sjson.SetBytes(body, "reasoning.effort", "medium") + } } body = applyPayloadConfig(e.cfg, req.Model, body) body, _ = sjson.DeleteBytes(body, "previous_response_id")