Skip to content

DeepSeek requests fail: Missing field (400) #353

@simonrosenberg

Description

@simonrosenberg

Summary

During evaluation runs with DeepSeek, many conversation attempts fail with LLMBadRequestError: Missing \reasoning_content` field in the assistant message ... (400). The model deepseek/deepseek-reasonerrequires areasoning_content` field for thinking/tool-call mode, but current request payloads omit it, causing hard 400s and repeated retries.

Evidence

  • Eval job evaluation-jobs/eval-eval-21233988879-deepseek-v-w57bc logs contain 190+ occurrences of this error (and rising). Examples:
    • Instance sympy__sympy-22080 ... Error code: 400 ... Missing \reasoning_content` field in the assistant message at message index 96`
    • Instance django__django-14315 ... 400 ... Missing \reasoning_content` field in the assistant message at message index 48`
    • Instance matplotlib__matplotlib-25122 ... 400 ... Missing \reasoning_content` field in the assistant message at message index 104`
  • Counts from run output logs: grep -R "Missing \reasoning_content`" logs | wc -l` → 190+ (later 197) occurrences in the run directory.
  • Model group is deepseek/deepseek-reasoner; available fallbacks: None (per error message).

Root cause

The request payload to DeepSeek’s thinking/tool-call endpoint does not include the required reasoning_content in assistant messages. DeepSeek rejects such requests with HTTP 400, halting the conversation. This is a client payload/SDK issue, not a transient service issue.

Impact

  • Many instances fail outright and retry up to max attempts, stalling evaluation progress and leaving statuses null.
  • Wasted tokens/time; downstream metrics and reports incomplete.

Proposed fix

  • Update the OpenHands client/SDK conversation builder for DeepSeek thinking mode to populate reasoning_content for assistant messages/tool calls as per https://api-docs.deepseek.com/guides/thinking_mode#tool-calls.
  • If not feasible immediately, switch to a model configuration that does not require reasoning_content until the payload is fixed.
  • Add a safeguard in the request layer to detect missing reasoning_content and fail fast with a clearer error before hitting the API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions