Suppress debug logs for model routing and ignore empty tools arrays
Some checks failed
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled

- Comment out verbose routing logs in the API server to reduce noise.
- Remove the `tools` field from Qwen client requests when it is an empty array.
- Add guards in Claude, Codex, Gemini‑CLI, and Gemini translators to skip tool conversion when the `tools` array is empty, preventing unnecessary payload modifications.
This commit is contained in:
Luis Pater
2025-08-27 22:29:08 +08:00
parent 1c4183d943
commit 7a6adfa97e
6 changed files with 11 additions and 6 deletions

View File

@@ -140,10 +140,10 @@ func (s *Server) unifiedModelsHandler(openaiHandler *openai.OpenAIAPIHandler, cl
// Route to Claude handler if User-Agent starts with "claude-cli"
if strings.HasPrefix(userAgent, "claude-cli") {
log.Debugf("Routing /v1/models to Claude handler for User-Agent: %s", userAgent)
// log.Debugf("Routing /v1/models to Claude handler for User-Agent: %s", userAgent)
claudeHandler.ClaudeModels(c)
} else {
log.Debugf("Routing /v1/models to OpenAI handler for User-Agent: %s", userAgent)
// log.Debugf("Routing /v1/models to OpenAI handler for User-Agent: %s", userAgent)
openaiHandler.OpenAIModels(c)
}
}