From 37564b708c872f413ae3610156b359bd9075534a Mon Sep 17 00:00:00 2001 From: Alexey Yanchenko Date: Tue, 24 Feb 2026 13:41:50 +0700 Subject: [PATCH 1/2] Strip empty messages on translation from openai to claude --- .../openai/chat-completions/claude_openai_request.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/translator/claude/openai/chat-completions/claude_openai_request.go b/internal/translator/claude/openai/chat-completions/claude_openai_request.go index f94825b2a0..1cde776629 100644 --- a/internal/translator/claude/openai/chat-completions/claude_openai_request.go +++ b/internal/translator/claude/openai/chat-completions/claude_openai_request.go @@ -156,8 +156,12 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream } else if contentResult.Exists() && contentResult.IsArray() { contentResult.ForEach(func(_, part gjson.Result) bool { if part.Get("type").String() == "text" { + textContent := part.Get("text").String() + if textContent == "" { + return true + } textPart := `{"type":"text","text":""}` - textPart, _ = sjson.Set(textPart, "text", part.Get("text").String()) + textPart, _ = sjson.Set(textPart, "text", textContent) out, _ = sjson.SetRaw(out, fmt.Sprintf("messages.%d.content.-1", systemMessageIndex), textPart) } return true @@ -178,8 +182,12 @@ func ConvertOpenAIRequestToClaude(modelName string, inputRawJSON []byte, stream switch partType { case "text": + textContent := part.Get("text").String() + if textContent == "" { + return true + } textPart := `{"type":"text","text":""}` - textPart, _ = sjson.Set(textPart, "text", part.Get("text").String()) + textPart, _ = sjson.Set(textPart, "text", textContent) msg, _ = sjson.SetRaw(msg, "content.-1", textPart) case "image_url": From 1b95c599d136310b9db6f077f8add54fd3f82527 Mon Sep 17 00:00:00 2001 From: Koosha Paridehpour Date: Thu, 26 Feb 2026 15:12:34 -0700 Subject: [PATCH 2/2] fix(cliproxyctl): point CLI command wiring to internal config Co-authored-by: Codex --- cmd/cliproxyctl/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cliproxyctl/main.go b/cmd/cliproxyctl/main.go index 93e187cb50..c569f35c57 100644 --- a/cmd/cliproxyctl/main.go +++ b/cmd/cliproxyctl/main.go @@ -16,7 +16,7 @@ import ( "time" cliproxycmd "github.com/router-for-me/CLIProxyAPI/v6/pkg/llmproxy/cmd" - "github.com/router-for-me/CLIProxyAPI/v6/pkg/llmproxy/config" + "github.com/router-for-me/CLIProxyAPI/v6/internal/config" ) const responseSchemaVersion = "cliproxyctl.response.v1"