refactor(amp): remove duplicate comments in response rewriter

This commit is contained in:
Luis Pater
2026-01-09 08:21:13 +08:00
parent d47b7dc79a
commit ed28b71e87

View File

@@ -71,8 +71,6 @@ var modelFieldPaths = []string{"model", "modelVersion", "response.modelVersion",
// rewriteModelInResponse replaces all occurrences of the mapped model with the original model in JSON
// It also suppresses "thinking" blocks if "tool_use" is present to ensure Amp client compatibility
func (rw *ResponseRewriter) rewriteModelInResponse(data []byte) []byte {
// 1. Amp Compatibility: Suppress thinking blocks if tool use is detected
// The Amp client struggles when both thinking and tool_use blocks are present
// 1. Amp Compatibility: Suppress thinking blocks if tool use is detected
// The Amp client struggles when both thinking and tool_use blocks are present
if gjson.GetBytes(data, `content.#(type=="tool_use")`).Exists() {