From d5d30fc7cea579859bd2d6b667a4ec47c98cd31c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 1 May 2026 17:04:18 +0200 Subject: [PATCH] Update default model to GPT-5.5 (#746) --- README.md | 6 +++--- actions/utils/openai_utils.py | 4 +++- tests/test_openai_utils.py | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1c76af3..0aa9431 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Choose between [OpenAI](https://openai.com/) or [Anthropic](https://www.anthropi | OpenAI | `gpt-5.4` | `openai_api_key` | | Anthropic | `claude-sonnet-4-6` | `anthropic_api_key` | -The model is auto-detected based on which API key you provide. Override with the `model` input, or use `review_model` to override PR review only. +The model is auto-detected based on which API key you provide. Override with the `model` input, for example `gpt-5.5`, or use `review_model` to override PR review only. ### 🛠️ How It Works @@ -104,8 +104,8 @@ jobs: # AI API keys - provide OpenAI OR Anthropic (model auto-detected from key) openai_api_key: ${{ secrets.OPENAI_API_KEY }} # anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - # model: claude-haiku-4-5-20251001 # Optional: override default model - # review_model: claude-opus-4-5-20251101 # Optional: override PR review model + # model: gpt-5.5 # Optional: override default model + # review_model: claude-opus-4-7 # Optional: override PR review model brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution ``` diff --git a/actions/utils/openai_utils.py b/actions/utils/openai_utils.py index 113e6e1..971f021 100644 --- a/actions/utils/openai_utils.py +++ b/actions/utils/openai_utils.py @@ -30,15 +30,17 @@ MODEL_COSTS = { # (input, output) per 1M tokens "gpt-5.2-2025-12-11": (1.75, 14.00), "gpt-5.2-codex": (1.75, 14.00), "gpt-5.3-codex": (1.75, 14.00), + "gpt-5.5": (5.00, 30.00), "gpt-5.4": (2.50, 15.00), "gpt-5-nano-2025-08-07": (0.05, 0.40), "gpt-5-mini-2025-08-07": (0.25, 2.00), - # Anthropic Claude 4.5 models + # Anthropic Claude models "claude-sonnet-4-5-20250929": (3.00, 15.00), "claude-sonnet-4-6": (3.00, 15.00), "claude-haiku-4-5-20251001": (1.00, 5.00), "claude-opus-4-5-20251101": (5.00, 25.00), "claude-opus-4-6": (5.00, 25.00), + "claude-opus-4-7": (5.00, 25.00), } SYSTEM_PROMPT_ADDITION = """Guidance: - Ultralytics Branding: Use YOLO11, YOLO26, etc., not YOLOv11, YOLOv26 (only older versions like YOLOv10 have a v). diff --git a/tests/test_openai_utils.py b/tests/test_openai_utils.py index 9493659..d99c5de 100644 --- a/tests/test_openai_utils.py +++ b/tests/test_openai_utils.py @@ -3,6 +3,7 @@ from unittest.mock import MagicMock, patch from actions.utils.openai_utils import ( + OPENAI_MODEL_DEFAULT, PR_REVIEW_MODEL_DEFAULT, _is_anthropic_model, get_response, @@ -11,12 +12,18 @@ from actions.utils.openai_utils import ( ) +def test_default_models(): + """Test canonical default models.""" + assert OPENAI_MODEL_DEFAULT == "gpt-5.4" + assert PR_REVIEW_MODEL_DEFAULT == "gpt-5.4" + + def test_is_anthropic_model(): """Test model provider detection.""" assert _is_anthropic_model("claude-sonnet-4-6") is True assert _is_anthropic_model("claude-haiku-4-5-20251001") is True - assert _is_anthropic_model("claude-opus-4-5-20251101") is True - assert _is_anthropic_model("gpt-5.4") is False + assert _is_anthropic_model("claude-opus-4-7") is True + assert _is_anthropic_model("gpt-5.5") is False assert _is_anthropic_model("gpt-5-mini-2025-08-07") is False @@ -39,9 +46,9 @@ def test_remove_outer_codeblocks(): def test_get_review_model_override(): """Test review model override logic.""" - with patch("actions.utils.openai_utils.REVIEW_MODEL", "claude-opus-4-5-20251101"): - with patch("actions.utils.openai_utils.MODEL", "gpt-5.4"): - assert get_review_model() == "claude-opus-4-5-20251101" + with patch("actions.utils.openai_utils.REVIEW_MODEL", "claude-opus-4-7"): + with patch("actions.utils.openai_utils.MODEL", "gpt-5.5"): + assert get_review_model() == "claude-opus-4-7" def test_get_review_model_fallback():