Skip to content

regression: #15749 breaks reasoning field promotion for DeepSeek/Kimi tool-call messages #15812

@yes999zc

Description

@yes999zc

Summary

PR #15749 (merged) introduced a regression where assistant messages with both
and a valid field get their reasoning content overwritten
with an empty string when using DeepSeek or Kimi thinking mode.

Root Cause

In , #15749 reordered the logic so that the
check (step 2) runs before the field
promotion (step 3). This means:

  1. A message has and
  2. Step 2 sees + DeepSeek provider → injects → returns early
  3. Step 3 (promote to ) is never reached
  4. The valid reasoning content is lost

Expected Behavior

The field should be promoted to before any
empty-string fallback is applied. The empty-string injection should only happen
when there is no explicit AND no field to promote.

Reproduction

Proposed Fix

Reorder the steps in :

  1. Preserve explicit
  2. Promote field → (healthy path)
  3. DeepSeek/Kimi fallback: inject for messages lacking both
  4. Clean up non-string

This fix is already included in #15478 (rebased on latest main).

Related

/cc @alt-glitch @OutThisLife

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt builderprovider/deepseekDeepSeek APIprovider/kimiKimi / Moonshottype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions