style: satisfy Sonnet 5.5 lint checks

This commit is contained in:
haruka
2026-09-29 05:20:04 +08:00
parent 8490a81867
commit 2cc459e24f
2 changed files with 4 additions and 3 deletions
@@ -1830,10 +1830,11 @@ func TestSonnet55RejectsUnsupportedParametersBeforeMimicry(t *testing.T) {
for _, count := range []bool{false, true} {
model := "claude-sonnet-5-5"
account := &Account{ID: 1, Platform: PlatformAnthropic, Type: typ}
if typ == AccountTypeAPIKey {
switch typ {
case AccountTypeAPIKey:
model = "public-sonnet"
account.Credentials = map[string]any{"model_mapping": map[string]any{model: "claude-sonnet-5-5"}}
} else if typ == AccountTypeBedrock {
case AccountTypeBedrock:
account.Credentials = map[string]any{"aws_region": "eu-west-1"}
}
body := []byte(`{"model":"` + model + `","messages":[{"role":"user","content":"hello"}],` + field + `}`)
+1 -1
View File
@@ -736,7 +736,7 @@ func FilterThinkingBlocksForRetry(body []byte, mappedModel string) []byte {
// Disable top-level thinking mode for retry to avoid structural/signature constraints upstream.
thinkingMode := gjson.Get(jsonStr, "thinking.type").String()
deleteTopLevelThinking := gjson.Get(jsonStr, "thinking").Exists() &&
!(claude.IsSonnet55(mappedModel) && thinkingMode == "between_tools")
(!claude.IsSonnet55(mappedModel) || thinkingMode != "between_tools")
for i := 0; i < len(messages); i++ {
msgMap, ok := messages[i].(map[string]any)