fix(translator): handle Claude thinking type "auto" like adaptive
Unified · Split
| @@ -440,14 +440,8 @@ func ConvertClaudeRequestToAntigravity(modelName string, inputRawJSON []byte, _ · 439 unmodified lines | |||
| 440 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) | 440 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) |
| 441 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) | 441 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| 442 | } | 442 | } |
| 443 | case "auto": | 443 | case "adaptive", "auto": |
| 444 | // Amp sends thinking.type="auto" — use max budget from model config | 444 | // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it |
| 445 | // Antigravity API for Claude models requires a concrete positive budget, | ||
| 446 | // not -1. Use a high default that ApplyThinking will cap to model max. | ||
| 447 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", 64000) | ||
| 448 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) | ||
| 449 | case "adaptive": | ||
| 450 | // Keep adaptive as a high level sentinel; ApplyThinking resolves it | ||
| 451 | // to model-specific max capability. | 445 | // to model-specific max capability. |
| 452 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") | 446 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") |
| 453 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) | 447 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| @@ -230,8 +230,8 @@ func ConvertClaudeRequestToCodex(modelName string, inputRawJSON []byte, _ bool) · 229 unmodified lines | |||
| 230 | reasoningEffort = effort | 230 | reasoningEffort = effort |
| 231 | } | 231 | } |
| 232 | } | 232 | } |
| 233 | case "adaptive": | 233 | case "adaptive", "auto": |
| 234 | // Claude adaptive means "enable with max capacity"; keep it as highest level | 234 | // Claude adaptive/auto means "enable with max capacity"; keep it as highest level |
| 235 | // and let ApplyThinking normalize per target model capability. | 235 | // and let ApplyThinking normalize per target model capability. |
| 236 | reasoningEffort = string(thinking.LevelXHigh) | 236 | reasoningEffort = string(thinking.LevelXHigh) |
| 237 | case "disabled": | 237 | case "disabled": |
| @@ -180,8 +180,8 @@ func ConvertClaudeRequestToCLI(modelName string, inputRawJSON []byte, _ bool) [] · 179 unmodified lines | |||
| 180 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) | 180 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) |
| 181 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) | 181 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| 182 | } | 182 | } |
| 183 | case "adaptive": | 183 | case "adaptive", "auto": |
| 184 | // Keep adaptive as a high level sentinel; ApplyThinking resolves it | 184 | // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it |
| 185 | // to model-specific max capability. | 185 | // to model-specific max capability. |
| 186 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") | 186 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") |
| 187 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) | 187 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| @@ -161,8 +161,8 @@ func ConvertClaudeRequestToGemini(modelName string, inputRawJSON []byte, _ bool) · 160 unmodified lines | |||
| 161 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingBudget", budget) | 161 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingBudget", budget) |
| 162 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) | 162 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) |
| 163 | } | 163 | } |
| 164 | case "adaptive": | 164 | case "adaptive", "auto": |
| 165 | // Keep adaptive as a high level sentinel; ApplyThinking resolves it | 165 | // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it |
| 166 | // to model-specific max capability. | 166 | // to model-specific max capability. |
| 167 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingLevel", "high") | 167 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingLevel", "high") |
| 168 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) | 168 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) |
| @@ -75,8 +75,8 @@ func ConvertClaudeRequestToOpenAI(modelName string, inputRawJSON []byte, stream · 74 unmodified lines | |||
| 75 | out, _ = sjson.Set(out, "reasoning_effort", effort) | 75 | out, _ = sjson.Set(out, "reasoning_effort", effort) |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | case "adaptive": | 78 | case "adaptive", "auto": |
| 79 | // Claude adaptive means "enable with max capacity"; keep it as highest level | 79 | // Claude adaptive/auto means "enable with max capacity"; keep it as highest level |
| 80 | // and let ApplyThinking normalize per target model capability. | 80 | // and let ApplyThinking normalize per target model capability. |
| 81 | out, _ = sjson.Set(out, "reasoning_effort", string(thinking.LevelXHigh)) | 81 | out, _ = sjson.Set(out, "reasoning_effort", string(thinking.LevelXHigh)) |
| 82 | case "disabled": | 82 | case "disabled": |