Skip to content

refactor(renderer): migrate to renderers thinking_retention#1743

Open
hallerite wants to merge 1 commit into
mainfrom
refactor/renderer-thinking-retention
Open

refactor(renderer): migrate to renderers thinking_retention#1743
hallerite wants to merge 1 commit into
mainfrom
refactor/renderer-thinking-retention

Conversation

@hallerite

@hallerite hallerite commented Jun 18, 2026

Copy link
Copy Markdown
Member

What

The renderers package replaced the two boolean flags preserve_all_thinking and preserve_thinking_between_tool_calls with a single ordinal field:

thinking_retention: Literal["template", "tool_cycle", "all"] = "template"

(See renderers PR: PrimeIntellect-ai/renderers#88.)

Changes

  • verifiers/clients/renderer_client.py_resolve_renderer_config carried the old booleans from AutoRendererConfig onto the resolved concrete config by name. Now carries the single thinking_retention field (mirrors renderers' own auto carry-over):
    concrete = concrete.model_copy(update={"thinking_retention": base.thinking_retention})
  • tests/test_renderer_client.pyAutoRendererConfig(thinking_retention="all") and the corresponding expectation.
  • docs/reference.md — the ClientConfig snippet still listed preserve_* as top-level fields, but the real config exposes the renderer settings via the typed renderer_config. Fixed the snippet + the explanatory paragraph to describe thinking_retention.

ClientConfig itself does not re-declare these fields — it holds a typed renderer_config: RendererConfig, so the field flows through pydantic; this PR only updates the by-name access in _resolve_renderer_config.

⚠️ Gating / dependency

Requires a renderers release that includes thinking_retention. The current floor renderers>=0.1.8.dev28 is >=, so it auto-picks up the new release — but CI will fail until renderers publishes a version with thinking_retention, and the floor should be raised to that version once it's out. Verified locally against the renderers branch (refactor/thinking-retention): the affected test_renderer_client cases pass.

Test plan

  • ruff check clean on changed files
  • tests/test_renderer_client.py -k "threads_chat_template_kwargs or auto_resolves" pass against the local renderers branch
  • CI (blocked on renderers release)

🤖 Generated with Claude Code


Note

Low Risk
Narrow adapter/docs/test updates for a renderers API rename; behavior is intended to match the old booleans once the matching renderers release is installed.

Overview
Aligns verifiers with the renderers package replacing preserve_all_thinking / preserve_thinking_between_tool_calls with a single thinking_retention field ("template" | "tool_cycle" | "all").

RendererClient._resolve_renderer_config now copies only thinking_retention from AutoRendererConfig onto the resolved concrete config when merging chat_template_kwargs (instead of the two booleans).

Tests use AutoRendererConfig(thinking_retention="all") and expect "template" for non-auto bases.

docs/reference.md documents renderer thinking via typed renderer_config and thinking_retention, not obsolete top-level preserve_* flags on ClientConfig.

Reviewed by Cursor Bugbot for commit c4e5c19. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Migrate renderer client to unified thinking_retention field in RendererConfig

Replaces the two boolean fields preserve_all_thinking and preserve_thinking_between_tool_calls with a single thinking_retention field accepting 'template' (default), 'tool_cycle', or 'all'.

  • _resolve_renderer_config now propagates thinking_retention instead of the prior boolean flags when resolving AutoRendererConfig into a concrete RendererConfig
  • ClientConfig replaces the two preserve booleans with a renderer_config: RendererConfig | None field, where None is treated as AutoRendererConfig()
  • Behavioral Change: any code passing preserve_all_thinking=True must switch to thinking_retention='all'; preserve_thinking_between_tool_calls maps to thinking_retention='tool_cycle'

Macroscope summarized c4e5c19.

The renderers package replaced the two boolean flags `preserve_all_thinking`
and `preserve_thinking_between_tool_calls` with a single ordinal field
`thinking_retention: Literal["template", "tool_cycle", "all"]`.

`_resolve_renderer_config` carried the old booleans from `AutoRendererConfig`
onto the resolved concrete config by name; update it to carry the single
`thinking_retention` field instead (mirrors renderers' own auto carry-over).
Also update the renderer-client test and the stale `ClientConfig` docs
(which still listed the removed booleans as top-level fields — the real
config exposes them via the typed `renderer_config`).

Requires a renderers release that includes `thinking_retention`; the
`renderers>=` floor should be raised to that version once published.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@macroscopeapp

macroscopeapp Bot commented Jun 18, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved

Mechanical refactor consolidating two boolean configuration flags (preserve_all_thinking, preserve_thinking_between_tool_calls) into a single enum-style thinking_retention field. Changes are limited to documentation, test expectations, and the config propagation code with no new runtime behavior.

You can customize Macroscope's approvability policy. Learn more.

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.

1 participant