fix(telegram): fix claude client dispatch + strategy creation workflow

- telegram/bot.go: clientForProvider now returns NewClaudeClient() for
  'claude' provider (was incorrectly falling back to DeepSeekClient which
  uses OpenAI wire format, breaking Anthropic API calls)

- api/server.go: fix scan_interval_minutes schema default (3, not 60);
  POST /api/strategies now clearly states config is OPTIONAL with complete
  working defaults; POST /api/traders removes redundant GET workflow note

- telegram/agent/prompt.go: simplify strategy creation — just POST {name}
  without config (backend applies full working defaults automatically);
  only include config when user requests custom settings
This commit is contained in:
tinkle-community
2026-03-08 17:39:14 +08:00
parent ea7b450a7e
commit ca87dbe3bb
3 changed files with 17 additions and 16 deletions

View File

@@ -254,9 +254,12 @@ func clientForProvider(provider string) mcp.AIClient {
return mcp.NewOpenAIClient()
case "deepseek":
return mcp.NewDeepSeekClient()
case "claude":
// Anthropic Messages API — different wire format (x-api-key, input_schema, tool_use blocks).
return mcp.NewClaudeClient()
default:
// Qwen, Kimi, Grok, Gemini, Claude, custom: fall back to DeepSeek-format client.
// These providers use OpenAI-compatible APIs; CustomAPIURL and CustomModelName are required.
// Qwen, Kimi, Grok, Gemini, custom: OpenAI-compatible APIs.
// CustomAPIURL and CustomModelName are required for these providers.
return mcp.NewDeepSeekClient()
}
}