From 6d838069398115483e82bf6e7fa22b7c4854d101 Mon Sep 17 00:00:00 2001 From: Jason Xu Date: Sat, 17 Oct 2026 02:09:55 +0800 Subject: [PATCH] fix(protocol): skip non-function Responses tools during cross-protocol bridging Closes #95 --- internal/protocol/request.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/protocol/request.go b/internal/protocol/request.go index 4ba8cf2..a51dcba 100644 --- a/internal/protocol/request.go +++ b/internal/protocol/request.go @@ -492,8 +492,15 @@ func decodeBridgeRequest(protocol Protocol, input map[string]any) (bridgeRequest } for i, raw := range jsonutil.SliceAt(input, "tools") { tool, ok := raw.(map[string]any) - if !ok || jsonutil.StringAt(tool, "type") != "function" { - return request, fmt.Errorf("tools[%d] must be a function tool", i) + if !ok { + return request, fmt.Errorf("tools[%d] must be an object", i) + } + // Built-in Responses tools (web_search, file_search, code_interpreter, …) + // have no Chat/Anthropic equivalent; skip them during cross-protocol + // bridging so requests that mix function tools with built-in plugins + // still reach the upstream. + if jsonutil.StringAt(tool, "type") != "function" { + continue } request.Tools = append(request.Tools, bridgeTool{ Name: jsonutil.StringAt(tool, "name"),