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

fix: correct gpt-5.5 completion ratio
This commit is contained in:
Calcium-Ion
2026-04-24 14:02:23 +08:00
committed by GitHub
2 changed files with 25 additions and 0 deletions
+3
View File
@@ -515,6 +515,9 @@ func getHardcodedCompletionModelRatio(name string) (float64, bool) {
} }
// gpt-5 匹配 // gpt-5 匹配
if strings.HasPrefix(name, "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") {
if strings.HasPrefix(name, "gpt-5.4-nano") { if strings.HasPrefix(name, "gpt-5.4-nano") {
return 6.25, true return 6.25, true
+22
View File
@@ -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)
}
}