Skip to content

Plumb keep_thinking through renderer factory#1281

Closed
rasdani wants to merge 4 commits into
sami/renderers-keep-thinkingfrom
daniel/renderer-keep-thinking-config
Closed

Plumb keep_thinking through renderer factory#1281
rasdani wants to merge 4 commits into
sami/renderers-keep-thinkingfrom
daniel/renderer-keep-thinking-config

Conversation

@rasdani
Copy link
Copy Markdown
Contributor

@rasdani rasdani commented May 3, 2026

Summary

  • adds a generic tri-state keep_thinking argument to create_renderer and create_renderer_pool
  • preserves renderer constructor defaults when keep_thinking=None, forces enabled with True, and forces disabled with False
  • adds ClientConfig.renderer_keep_thinking and carries it through RendererClient into the shared renderer pool
  • raises a clear error when keep_thinking=True is requested for an unsupported renderer instead of adding per-model registry aliases

Test plan

  • uv run pytest packages/renderers/tests/test_keep_thinking.py -k 'create_renderer'
  • uv run pytest tests/test_renderer_client.py -k 'renderer_client_forwards_keep_thinking or renderer_client_honors_configured_renderer_name or renderer_client_uses_renderer_model_name_override'
  • uv run ruff check packages/renderers/renderers/base.py packages/renderers/tests/test_keep_thinking.py verifiers/types.py verifiers/clients/renderer_client.py tests/test_renderer_client.py
  • uv run ruff format --check packages/renderers/renderers/base.py packages/renderers/tests/test_keep_thinking.py verifiers/types.py verifiers/clients/renderer_client.py tests/test_renderer_client.py
  • git diff --check

Note: uv run pytest packages/renderers/tests/test_keep_thinking.py reaches the new regression and passes 10/11 tests locally, but the existing moonshotai/Kimi-K2.5 tokenizer case fails in this environment because tiktoken is not installed.

Stacked on #1278.

Comment thread packages/renderers/renderers/base.py
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d576926. Configure here.

Comment thread verifiers/types.py Outdated
client_type: ClientType = "openai_chat_completions"
renderer: str = "auto"
renderer_model_name: str | None = None
renderer_keep_thinking: bool = False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ClientConfig docs not updated with new field

Low Severity

The new renderer_keep_thinking field is added to ClientConfig in verifiers/types.py, but ClientConfig is explicitly documented in docs/reference.md (lines 754–767) and that documentation is not updated to include the new field. This violates the rule requiring documentation updates when core user-facing functionality described in docs/ is modified.

Fix in Cursor Fix in Web

Triggered by project rule: BugBot Instructions

Reviewed by Cursor Bugbot for commit d576926. Configure here.

@rasdani rasdani requested review from hallerite and samsja May 3, 2026 19:10
Copy link
Copy Markdown
Member

@hallerite hallerite left a comment

Choose a reason for hiding this comment

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

I think we should disambiguate between keeping thinking between tool-calls and between user-turns and offer both for any model unconditionally, but have sensible defaults and log a warning if a model does not support it (like Qwen3).

Wdyt?

@hallerite
Copy link
Copy Markdown
Member

Superseded by #1298 (and the underlying renderers PRs #5 / #6). Closing!

@hallerite hallerite closed this May 7, 2026
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