Open
Conversation
Qwen3 subclass that defaults keep_thinking=True, registered as "qwen3-keep-thinking" so it can be selected from a client config (e.g. for Qwen3-30B-A3B-Thinking-2507) without plumbing the flag through ClientConfig / create_renderer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 160094f. Configure here.
This reverts commit 160094f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
keep_thinking: bool = Falseparameter to renderers that strip historical<think>blocks from assistant turns before the last user query. WhenTrue, prior-turn reasoning is preserved across subsequent user turns.preserve_thinking(Qwen3.6) andclear_thinking(GLM-5) for a single clear path, per AGENTS.md guidance.qwen3,qwen35,qwen36(inherits),glm5/glm51,glm45,minimax_m2,nemotron3,kimi_k25. Renderers where the concept doesn't apply are untouched (qwen3_vl,kimi_k2,deepseek_v3,gpt_oss,default).Test plan
uv run ruff check packages/renderers/— cleanuv run pytest packages/renderers/tests/test_render_ids.py— 216 passed (existing parity tests; no regressions)uv run pytest packages/renderers/tests/test_keep_thinking.py— 7 passed (new test, parameterized over all 8 affected renderers)🤖 Generated with Claude Code
Note
Medium Risk
Modifies prompt/token rendering across multiple model-specific renderers, which can change model behavior and training masks in multi-turn conversations. Risk is mitigated by defaulting to current behavior (
keep_thinking=False) and adding coverage to verify the new mode.Overview
Adds a uniform
keep_thinking: bool = Falseoption to several renderers so callers can preserve prior-turn assistant<think>/reasoning_contentblocks across subsequent user turns instead of stripping them by default.Replaces renderer-specific knobs (
clear_thinkinginGLM5Renderer,preserve_thinkinginQwen36Renderer) with the sharedkeep_thinkingbehavior, and introduces aQwen3KeepThinkingRendererplus a new registry nameqwen3-keep-thinking.Adds a new parametrized test (
test_keep_thinking.py) that asserts prior-turn reasoning is absent in default renders but present whenkeep_thinking=Trueacross the affected model families.Reviewed by Cursor Bugbot for commit 31fae38. Bugbot is set up for automated code reviews on this repo. Configure here.