Skip to content

fix: adjust DeepSeek reasoning mode check condition#3560

Merged
Re-bin merged 3 commits into
HKUDS:mainfrom
JiajunBernoulli:fix-issue-3554
May 1, 2026
Merged

fix: adjust DeepSeek reasoning mode check condition#3560
Re-bin merged 3 commits into
HKUDS:mainfrom
JiajunBernoulli:fix-issue-3554

Conversation

@JiajunBernoulli
Copy link
Copy Markdown
Contributor

- Modified _drop_deepseek_incomplete_reasoning_history to properly handle reasoning mode detection
- Fixes issue HKUDS#3554
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the follow-up fixes.

The DeepSeek history cleanup is now scoped narrowly:

  • Explicit thinking mode still cleans up incomplete reasoning history.
  • Implicit cleanup only applies to known thinking-capable DeepSeek models such as deepseek-v4 / deepseek-reasoner.
  • Non-thinking deepseek-chat keeps normal tool-call history intact.

Regression coverage was added for both the implicit deepseek-v4-pro case and the deepseek-chat non-trimming case.

Verified locally:

  • uv run pytest tests/providers/test_litellm_kwargs.py -k 'deepseek' -q
  • uv run ruff check nanobot/providers/openai_compat_provider.py
  • git diff --check

Ready to merge once CI is green.

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.

2 participants