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 | 440 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) |
| 441 | 441 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| 442 | 442 | } |
| 443 | − case "auto": | |
| 444 | − // Amp sends thinking.type="auto" — use max budget from model config | |
| 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 | |
| 443 | + case "adaptive", "auto": | |
| 444 | + // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it | |
| 451 | 445 | // to model-specific max capability. |
| 452 | 446 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") |
| 453 | 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 | 230 | reasoningEffort = effort |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | − case "adaptive": | |
| 234 | − // Claude adaptive means "enable with max capacity"; keep it as highest level | |
| 233 | + case "adaptive", "auto": | |
| 234 | + // Claude adaptive/auto means "enable with max capacity"; keep it as highest level | |
| 235 | 235 | // and let ApplyThinking normalize per target model capability. |
| 236 | 236 | reasoningEffort = string(thinking.LevelXHigh) |
| 237 | 237 | case "disabled": |
| @@ -180,8 +180,8 @@ func ConvertClaudeRequestToCLI(modelName string, inputRawJSON []byte, _ bool) [] · 179 unmodified lines | ||
| 180 | 180 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingBudget", budget) |
| 181 | 181 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true) |
| 182 | 182 | } |
| 183 | − case "adaptive": | |
| 184 | − // Keep adaptive as a high level sentinel; ApplyThinking resolves it | |
| 183 | + case "adaptive", "auto": | |
| 184 | + // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it | |
| 185 | 185 | // to model-specific max capability. |
| 186 | 186 | out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high") |
| 187 | 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 | 161 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingBudget", budget) |
| 162 | 162 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) |
| 163 | 163 | } |
| 164 | − case "adaptive": | |
| 165 | − // Keep adaptive as a high level sentinel; ApplyThinking resolves it | |
| 164 | + case "adaptive", "auto": | |
| 165 | + // Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it | |
| 166 | 166 | // to model-specific max capability. |
| 167 | 167 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.thinkingLevel", "high") |
| 168 | 168 | out, _ = sjson.Set(out, "generationConfig.thinkingConfig.includeThoughts", true) |
| @@ -75,8 +75,8 @@ func ConvertClaudeRequestToOpenAI(modelName string, inputRawJSON []byte, stream · 74 unmodified lines | ||
| 75 | 75 | out, _ = sjson.Set(out, "reasoning_effort", effort) |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | − case "adaptive": | |
| 79 | − // Claude adaptive means "enable with max capacity"; keep it as highest level | |
| 78 | + case "adaptive", "auto": | |
| 79 | + // Claude adaptive/auto means "enable with max capacity"; keep it as highest level | |
| 80 | 80 | // and let ApplyThinking normalize per target model capability. |
| 81 | 81 | out, _ = sjson.Set(out, "reasoning_effort", string(thinking.LevelXHigh)) |
| 82 | 82 | case "disabled": |