Add renderer chat template kwargs passthrough#60
Open
eligotts wants to merge 5 commits into
Open
Conversation
This was referenced May 23, 2026
ApprovabilityVerdict: Approved Additive feature adding an optional You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7fbf390. Configure here.
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
chat_template_kwargstocreate_rendererandcreate_renderer_pool.enable_thinkingandreasoning_effortfor the renderers that model those template controls.We are extracting renderer template controls from
chat_template_kwargsfor now. Longer term, we should move this toward typed pydantic config models with explicit renderer-specific template args, so users cannot dump arbitrary keys into config. Until then, unsupported kwargs fail at renderer construction.Companion PRs
Validation
uvx ruff check renderers/base.py renderers/qwen3.py renderers/qwen35.py renderers/nemotron3.py renderers/gpt_oss.py renderers/glm5.py renderers/glm45.py renderers/deepseek_v3.py renderers/kimi_k2.py renderers/kimi_k25.py renderers/laguna_xs2.py tests/test_chat_template_kwargs.pyPYTHONPATH=. uvx --with pytest --with transformers --with openai-harmony --with tiktoken --with numpy --with jinja2 --with fastokens --with openai pytest tests/test_chat_template_kwargs.pyNote
Add
chat_template_kwargspassthrough to renderer constructorschat_template_kwargs: dict[str, Any] | Noneparameter tocreate_rendererandcreate_renderer_poolin base.py, forwarding fixed template toggles (e.g.enable_thinking,reasoning_effort) directly to renderer constructors.CHAT_TEMPLATE_KWARGSclass attribute listing its supported keys;create_renderervalidates against this set and raisesValueErrorfor unsupported or reserved constructor kwargs.Qwen3,Qwen35,DeepSeekV3,GLM4.5,GLM5,GptOss,KimiK25,LagunaXS2,Nemotron3.tool_parser) insidechat_template_kwargsnow raisesValueErrorinstead of silently overriding constructor behavior.Macroscope summarized b543277.
Note
Medium Risk
Moderate risk because it changes renderer construction and argument validation, which can break existing integrations that pass unexpected kwargs or rely on permissive behavior.
Overview
Adds a new
chat_template_kwargsparameter tocreate_rendererandcreate_renderer_pool, binding chat-template controls at renderer construction time and forwarding them intoDefaultRenderer/model-specific renderer constructors.Introduces validation that (1) rejects reserved constructor kwargs inside
chat_template_kwargsand (2) enforces per-renderer allowlists via each renderer’s newCHAT_TEMPLATE_KWARGSattribute (e.g.enable_thinkingfor several model renderers,reasoning_effortforgpt-oss), raisingValueErroron unsupported keys; includes new unit tests and README documentation for the behavior.Reviewed by Cursor Bugbot for commit b543277. Bugbot is set up for automated code reviews on this repo. Configure here.