test: update regression tests for latest model versions

This commit is contained in:
Finessse
2025-12-25 05:47:41 +07:00
parent 53918b4c92
commit f97ef1f2a3
2 changed files with 38 additions and 16 deletions
+34 -12
View File
@@ -524,8 +524,30 @@ func TestThinkingConversionsAcrossProtocolsAndModels(t *testing.T) {
}
func TestOpenAIThinkingBudgetToEffortRanges(t *testing.T) {
cleanup := registerCoreModels(t)
defer cleanup()
reg := registry.GetGlobalRegistry()
uid := fmt.Sprintf("thinking-test-%d", time.Now().UnixNano())
// Register mock models with specific level support
mockHigh := []*registry.ModelInfo{{
ID: "mock-high",
OwnedBy: "openai",
Type: "openai",
Thinking: &registry.ThinkingSupport{Levels: []string{"none", "low", "medium", "high"}},
}}
mockXHigh := []*registry.ModelInfo{{
ID: "mock-xhigh",
OwnedBy: "openai",
Type: "openai",
Thinking: &registry.ThinkingSupport{Levels: []string{"none", "low", "medium", "high", "xhigh"}},
}}
reg.RegisterClient(uid+"-high", "openai", mockHigh)
reg.RegisterClient(uid+"-xhigh", "openai", mockXHigh)
defer func() {
reg.UnregisterClient(uid + "-high")
reg.UnregisterClient(uid + "-xhigh")
}()
cases := []struct {
name string
@@ -534,16 +556,16 @@ func TestOpenAIThinkingBudgetToEffortRanges(t *testing.T) {
want string
ok bool
}{
{name: "zero-none", model: "gpt-5", budget: 0, want: "none", ok: true},
{name: "low-min", model: "gpt-5", budget: 1, want: "low", ok: true},
{name: "low-max", model: "gpt-5", budget: 1024, want: "low", ok: true},
{name: "medium-min", model: "gpt-5", budget: 1025, want: "medium", ok: true},
{name: "medium-max", model: "gpt-5", budget: 8192, want: "medium", ok: true},
{name: "high-min", model: "gpt-5", budget: 8193, want: "high", ok: true},
{name: "high-max", model: "gpt-5", budget: 24576, want: "high", ok: true},
{name: "over-max-clamps-to-highest", model: "gpt-5", budget: 24577, want: "high", ok: true},
{name: "over-max-xhigh-model", model: "gpt-5.2", budget: 50000, want: "xhigh", ok: true},
{name: "negative-unsupported", model: "gpt-5", budget: -5, want: "", ok: false},
{name: "zero-none", model: "mock-high", budget: 0, want: "none", ok: true},
{name: "low-min", model: "mock-high", budget: 1, want: "low", ok: true},
{name: "low-max", model: "mock-high", budget: 1024, want: "low", ok: true},
{name: "medium-min", model: "mock-high", budget: 1025, want: "medium", ok: true},
{name: "medium-max", model: "mock-high", budget: 8192, want: "medium", ok: true},
{name: "high-min", model: "mock-high", budget: 8193, want: "high", ok: true},
{name: "high-max", model: "mock-high", budget: 24576, want: "high", ok: true},
{name: "over-max-clamps-to-highest", model: "mock-high", budget: 24577, want: "high", ok: true},
{name: "over-max-xhigh-model", model: "mock-xhigh", budget: 50000, want: "xhigh", ok: true},
{name: "negative-unsupported", model: "mock-high", budget: -5, want: "", ok: false},
}
for _, cs := range cases {
+4 -4
View File
@@ -11,7 +11,7 @@ import (
func TestOpenAIToClaude_GroupsToolResultsInSingleMessage(t *testing.T) {
raw := []byte(`{
"model":"gpt-5",
"model":"gpt-5.2",
"messages":[
{"role":"user","content":"hi"},
{"role":"assistant","tool_calls":[
@@ -27,7 +27,7 @@ func TestOpenAIToClaude_GroupsToolResultsInSingleMessage(t *testing.T) {
out := sdktranslator.TranslateRequest(
sdktranslator.FromString("openai"),
sdktranslator.FromString("claude"),
"claude-3-7-sonnet-20250219",
"claude-sonnet-4-5-20250929",
raw,
false,
)
@@ -57,7 +57,7 @@ func TestOpenAIToClaude_GroupsToolResultsInSingleMessage(t *testing.T) {
func TestOpenAIResponsesToClaude_GroupsCallOutputsInSingleMessage(t *testing.T) {
raw := []byte(`{
"model":"gpt-5",
"model":"gpt-5.2",
"input":[
{"type":"message","role":"user","content":[{"type":"input_text","text":"hi"}]},
{"type":"function_call","call_id":"call_a","name":"a","arguments":"{}"},
@@ -71,7 +71,7 @@ func TestOpenAIResponsesToClaude_GroupsCallOutputsInSingleMessage(t *testing.T)
out := sdktranslator.TranslateRequest(
sdktranslator.FromString("openai-response"),
sdktranslator.FromString("claude"),
"claude-3-7-sonnet-20250219",
"claude-sonnet-4-5-20250929",
raw,
false,
)