mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
DeepSeek's OpenAI-compatible chat schema accepts text content rather than OpenAI vision content parts, so forwarding Anthropic image blocks as image_url makes the upstream reject the request before the model can answer. Keep normal OpenAI Chat vision behavior as the default, but switch known DeepSeek-compatible chat proxy requests to a text-only conversion that preserves prompt text and replaces image payloads with a small omission marker. Constraint: DeepSeek official Chat Completions docs list user message content as string text, while its Anthropic compatibility table marks image blocks as not supported. Rejected: Expand unsupported-image error string matching only | it still surfaces the first turn as an API error and depends on provider wording. Confidence: high Scope-risk: narrow Tested: bun test src/server/__tests__/proxy-transform.test.ts Tested: bun test src/server/__tests__/providers.test.ts --test-name-pattern "handleProxyRequest|omits image_url" Tested: bun test src/services/api/errors.test.ts tests/mediaRecoveryAndEstimation.test.ts Tested: bun run check:server