| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
PR #24146 unconditionally sets reasoning_content to the extracted value. On the second pass through transform (after DB storage), content parts no longer have reasoning (already extracted in first pass), so the extracted value is empty. This overwrites the previously correct providerOptions.reasoning_content, causing DeepSeek 400: The 'reasoning_content' in the thinking mode must be passed back to the API. Fix: when reasoningText is empty, fall back to the existing providerOptions[sdk][field] value before defaulting to empty string. This preserves non-empty reasoning from the first pass while still sending empty reasoning_content when DeepSeek requires it (the case PR #24146 was fixing). Also use dynamic SDK key ([sdk]) instead of hardcoded openaiCompatible for provider flexibility.
Models.dev may have reasoning:true but no explicit interleaved config.
Default interleaved to {field: 'reasoning_content'} so the transform
pipeline correctly extracts reasoning parts into providerOptions.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found:
These PRs are addressing overlapping concerns around reasoning_content preservation and interleaved transform handling. Consider checking if PR #24250 duplicates or supersedes the work in this PR, or vice versa. |
Sorry, something went wrong.
|
Issue is closed, so unless there is a secondary issue with repro steps im going to close this |
Sorry, something went wrong.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Problem
PR #24146 fixed empty reasoning_content preservation for DeepSeek V4 by unconditionally setting [field]: reasoningText in providerOptions. However, this introduced a regression: on the second pass through the interleaved transform (after DB storage), content parts no longer have reasoning (already extracted in first pass), so reasoningText is empty. This overwrites the previously correct providerOptions.reasoning_content, causing DeepSeek 400:
Root Cause
The interleaved transform runs on every request. The first pass correctly extracts reasoning from content parts → stores in providerOptions → removes from content. On the second pass, content has no reasoning parts → reasoningText = "" → unconditionally overwrites providerOptions → reasoning_content lost.
Fix
When reasoningText is empty, fall back to the existing providerOptions[sdk][field] value before defaulting to empty string:
This preserves non-empty reasoning from the first pass while still sending empty reasoning_content when DeepSeek requires it (the case #24146 was fixing).
Additional changes
Verification