Просмотр исходного кода

Merge pull request #4414 from jingx8885/codex/fix-gpt-55-completion-ratio

fix: correct gpt-5.5 completion ratio
Calcium-Ion 2 недель назад
Родитель
Сommit
05b0041de2
2 измененных файлов с 25 добавлено и 0 удалено
  1. 3 0
      setting/ratio_setting/model_ratio.go
  2. 22 0
      setting/ratio_setting/model_ratio_test.go

+ 3 - 0
setting/ratio_setting/model_ratio.go

@@ -515,6 +515,9 @@ func getHardcodedCompletionModelRatio(name string) (float64, bool) {
 		}
 		// gpt-5 匹配
 		if strings.HasPrefix(name, "gpt-5") {
+			if strings.HasPrefix(name, "gpt-5.5") {
+				return 6, true
+			}
 			if strings.HasPrefix(name, "gpt-5.4") {
 				if strings.HasPrefix(name, "gpt-5.4-nano") {
 					return 6.25, true

+ 22 - 0
setting/ratio_setting/model_ratio_test.go

@@ -0,0 +1,22 @@
+package ratio_setting
+
+import "testing"
+
+func TestGetCompletionRatioInfoGPT55UsesOfficialOutputMultiplier(t *testing.T) {
+	info := GetCompletionRatioInfo("gpt-5.5")
+
+	if info.Ratio != 6 {
+		t.Fatalf("gpt-5.5 completion ratio = %v, want 6", info.Ratio)
+	}
+	if !info.Locked {
+		t.Fatal("gpt-5.5 completion ratio should be locked to the official multiplier")
+	}
+}
+
+func TestGetCompletionRatioGPT55DatedVariant(t *testing.T) {
+	got := GetCompletionRatio("gpt-5.5-2026-04-24")
+
+	if got != 6 {
+		t.Fatalf("gpt-5.5 dated variant completion ratio = %v, want 6", got)
+	}
+}