Skip to content

[codex] fix DeepSeek image attachments#590

Merged
jahooma merged 3 commits intomainfrom
jahooma/fix-deepseek-images
May 5, 2026
Merged

[codex] fix DeepSeek image attachments#590
jahooma merged 3 commits intomainfrom
jahooma/fix-deepseek-images

Conversation

@brandonkachen
Copy link
Copy Markdown
Collaborator

What changed

  • Normalize DeepSeek chat request messages before sending them to the direct DeepSeek API.
  • Convert OpenRouter-style multimodal content arrays into text-only content for DeepSeek, preserving text and adding an explicit notice when image/file parts are omitted.
  • Widen the server chat message type to represent text/image/file content parts.
  • Add integration coverage for DeepSeek image attachment request serialization.

Why

Freebuff DeepSeek requests with image attachments were forwarding image_url content parts to the direct DeepSeek backend. The current DeepSeek chat completion API accepts text content for user messages, so those image parts caused provider-format failures.

Validation

  • CI=true bun test web/src/llm-api/__tests__/deepseek-image-compat.integration.test.ts
  • CI=true bun run --cwd=web typecheck
  • bunx prettier --check web/src/llm-api/deepseek.ts web/src/llm-api/types.ts web/src/llm-api/__tests__/deepseek-image-compat.integration.test.ts

@jahooma jahooma marked this pull request as ready for review May 5, 2026 06:05
@jahooma jahooma merged commit 560b7ad into main May 5, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/fix-deepseek-images branch May 5, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants