Skip to content

Add deepseek-reasoning-fixer plugin - #90

Open
ahoo wants to merge 2 commits into
router-for-me:mainfrom
ahoo:add-deepseek-reasoning-fixer
Open

Add deepseek-reasoning-fixer plugin#90
ahoo wants to merge 2 commits into
router-for-me:mainfrom
ahoo:add-deepseek-reasoning-fixer

Conversation

@ahoo

@ahoo ahoo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Plugin

What it does

DeepSeek's Console upstream enforces thinking mode strictly: when reasoning_effort is set (not none), every assistant message must carry a non-empty reasoning_content back to the API. Codex CLI and other agentic clients sometimes drop the field on individual assistant messages (missing key, JSON null, empty string, or empty array), which makes the upstream reject the whole request with:

400 invalid_request_error: The `reasoning_content` in the thinking mode must be passed back to the API.

The plugin fills missing/empty reasoning_content on assistant messages for DeepSeek models in thinking mode, so long agentic sessions survive. Non-empty reasoning values and unknown shapes (objects/numbers) are passed through verbatim; non-DeepSeek models are untouched.

Release evidence

Latest release v0.1.0 on the plugin repository contains both required assets:

  • deepseek-reasoning-fixer_0.1.0_linux_amd64.zip — zip root contains deepseek-reasoning-fixer.so (verified: unzip -l shows single entry at root)
  • checksums.txt — sha256 of the zip
c6d6829314df1d68c76ade19f0cc95f46d98123e6d6e336ce27f385969922ac5  deepseek-reasoning-fixer_0.1.0_linux_amd64.zip

Testing

  • go vet . && go test ./... — 12 test cases pass (missing/null/empty-string/empty-array variants, existing-value kept, unknown-shape kept, non-DeepSeek untouched)
  • End-to-end: request bytes captured from a real failing session return 200 through the plugin, while the identical bytes still return 400 when sent directly to the upstream — confirming the plugin is what fixes it.

ahoo and others added 2 commits August 21, 2026 01:54
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@ahoo

ahoo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Updated to v0.1.1: the normalizer now also handles DeepSeek requests arriving without reasoning_effort (Claude-format /v1/messages translated to OpenAI). New release assets: deepseek-reasoning-fixer_0.1.1_linux_amd64.zip + checksums.txt (4c38f92a...).

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.

1 participant