fix(deepseek): preserve empty reasoning content - #690
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for preserving and replaying provider-specific state and reasoning content (such as DeepSeek's reasoning_content) across tool-calling loops. It refactors OpenAILLM into a base OpenAICompatibleLLM class and a derived OpenAILLM subclass, allowing DeepSeekLLM to inherit from the compatible base and implement custom logic for managing reasoning metadata. Additionally, internal metadata keys prefixed with _xagent_ are stripped before sending requests to the LLM providers. Feedback on the changes identifies that the newly added static method _is_thinking_enabled in DeepSeekLLM is unused and should be removed as dead code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
rogercloud
left a comment
There was a problem hiding this comment.
LGTM. The presence-vs-truthiness fix for reasoning_content (preserving an explicit empty string) is correct, and the round-trip of provider-owned state through _xagent_provider_state is traced end-to-end: response → runtime merge → ReAct message metadata → execution-context restore → DeepSeek replay → stripped before the provider call. The OpenAILLM → OpenAICompatibleLLM split keeps OpenAI-specific output_config/env policy isolated cleanly. No output_config regression for DeepSeek (its _normalize_response_format neutralizes json_schema before reaching the base), and passing thinking through is a no-op for DeepSeek since supports_enable_thinking_param is False. Test coverage for the empty-string and provider-state replay paths is solid. The previously flagged dead _is_thinking_enabled helper has been removed.
Depends-On: #689
See anomalyco/opencode#24146 for related context.