Update PR Reviews to 5.2 Codex (#691)
Signed-off-by: Glenn Jocher <[email protected]>
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ inputs:
|
||||
description: "AI Model - defaults to GPT-5.2 or Sonnet 4.5 based on API key"
|
||||
required: false
|
||||
review_model:
|
||||
description: "AI Model for PR reviews (optional, defaults to model)"
|
||||
description: "AI Model for PR reviews (optional, defaults to gpt-5.2-codex)"
|
||||
required: false
|
||||
first_issue_response:
|
||||
description: "Example response to a new issue"
|
||||
|
||||
@@ -192,7 +192,7 @@ def main(*args, **kwargs):
|
||||
else:
|
||||
return
|
||||
|
||||
# Update any year range to current year (handles both - and – dashes)
|
||||
# Update any year range to current year (handles both - and en-dash)
|
||||
header = re.sub(r"(\d{4}[–-])\d{4}", rf"\g<1>{current_year}", header)
|
||||
|
||||
directory = Path.cwd()
|
||||
|
||||
@@ -20,6 +20,7 @@ MAX_PROMPT_CHARS = round(128000 * 3.3 * 0.5) # Max characters for prompt (50% o
|
||||
# Default models (single source of truth)
|
||||
OPENAI_MODEL_DEFAULT = "gpt-5.2-2025-12-11"
|
||||
ANTHROPIC_MODEL_DEFAULT = "claude-sonnet-4-5-20250929"
|
||||
PR_REVIEW_MODEL_DEFAULT = "gpt-5.2-codex"
|
||||
|
||||
MODEL_COSTS = { # (input, output) per 1M tokens
|
||||
# OpenAI models
|
||||
@@ -27,6 +28,7 @@ MODEL_COSTS = { # (input, output) per 1M tokens
|
||||
"gpt-5.1-codex": (1.25, 10.00),
|
||||
"gpt-5.1-2025-11-13": (1.25, 10.00),
|
||||
"gpt-5.2-2025-12-11": (1.75, 14.00),
|
||||
"gpt-5.2-codex": (1.75, 14.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
|
||||
@@ -150,7 +152,7 @@ def _get_default_model() -> str:
|
||||
|
||||
def get_review_model() -> str:
|
||||
"""Get model for PR reviews, using REVIEW_MODEL if set, otherwise default model."""
|
||||
return REVIEW_MODEL or _get_default_model()
|
||||
return REVIEW_MODEL or PR_REVIEW_MODEL_DEFAULT
|
||||
|
||||
|
||||
def get_response(
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from actions.utils.openai_utils import _is_anthropic_model, get_response, get_review_model, remove_outer_codeblocks
|
||||
from actions.utils.openai_utils import (
|
||||
PR_REVIEW_MODEL_DEFAULT,
|
||||
_is_anthropic_model,
|
||||
get_response,
|
||||
get_review_model,
|
||||
remove_outer_codeblocks,
|
||||
)
|
||||
|
||||
|
||||
def test_is_anthropic_model():
|
||||
@@ -41,8 +47,7 @@ def test_get_review_model_override():
|
||||
def test_get_review_model_fallback():
|
||||
"""Test review model fallback to default model."""
|
||||
with patch("actions.utils.openai_utils.REVIEW_MODEL", None):
|
||||
with patch("actions.utils.openai_utils.MODEL", "gpt-5.2-2025-12-11"):
|
||||
assert get_review_model() == "gpt-5.2-2025-12-11"
|
||||
assert get_review_model() == PR_REVIEW_MODEL_DEFAULT
|
||||
|
||||
|
||||
@patch("requests.post")
|
||||
|
||||
Reference in New Issue
Block a user