Skip to content

feat: allow thinking_budget_tokens=0 for non-Anthropic providers (MiniMax/OpenAI-compatible support)#570

Closed
Lunox-1337 wants to merge 2 commits intoplastic-labs:mainfrom
Lunox-1337:minimax-support
Closed

feat: allow thinking_budget_tokens=0 for non-Anthropic providers (MiniMax/OpenAI-compatible support)#570
Lunox-1337 wants to merge 2 commits intoplastic-labs:mainfrom
Lunox-1337:minimax-support

Conversation

@Lunox-1337
Copy link
Copy Markdown

@Lunox-1337 Lunox-1337 commented Apr 17, 2026

Summary

Changes the lower-bound validation for THINKING_BUDGET_TOKENS from gt=0 (must be > 0) to ge=0 (must be >= 0) in three settings classes. This enables using Honcho with providers that do not support extended thinking/reasoning budgets — specifically MiniMax-M2.7 and other OpenAI-compatible APIs.

Changes

  • config.py:259DeriverSettings.THINKING_BUDGET_TOKENS: gt=0ge=0
  • config.py:441SummarySettings.THINKING_BUDGET_TOKENS: gt=0ge=0
  • config.py:545DreamSettings.THINKING_BUDGET_TOKENS: gt=0ge=0

Why

The existing code at clients.py:1385 already guards the thinking budget parameter — it is only passed to the API when provider == "anthropic" and thinking_budget_tokens > 0. However, the Pydantic validation was blocking thinking_budget_tokens=0 at config load time, preventing Honcho from starting with providers that don't support the parameter.

With this change, users can configure:

[deriver]
provider = "custom"
model = "MiniMax-M2.7"
thinking_budget_tokens = 0

[summary]
provider = "custom"
model = "MiniMax-M2.7"
thinking_budget_tokens = 0

via the OpenAI-compatible API:

OPENAI_COMPATIBLE_BASE_URL = "https://api.minimax.io/v1"
OPENAI_COMPATIBLE_API_KEY = "${MINIMAX_API_KEY}"

No Behaviour Change for Existing Users

  • Dialectic level settings already used ge=0 (unchanged)
  • Anthropic users with thinking_budget_tokens > 0 are unaffected — validation still requires values >= 0
  • Non-Anthropic providers were already not sending thinking budget to the API — this just removes the spurious config-level error

Summary by CodeRabbit

  • Refactor

    • Thinking-budget constraints updated to allow a value of zero for relevant configuration settings, preserving previous defaults and upper bounds.
  • Changes

    • Per-reasoning-level defaults updated: provider set to a custom provider, model switched to "MiniMax-M2.7" across levels; thinking-budget set to 0 for medium/high/max; minimal level's max output increased from 250 to 1024.

…upport)

- Change gt=0 to ge=0 for THINKING_BUDGET_TOKENS in:
  - DeriverSettings (deriver)
  - SummarySettings (summary)
  - DreamSettings (dream)
- MiniMax-M2.7 via OpenAI-compatible API does not support
  thinking budget parameter, so config must accept 0
- Existing client code already filters thinking_budget when
  provider != 'anthropic' (clients.py:1385)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Walkthrough

Changed three settings' THINKING_BUDGET_TOKENS validators from gt=0 to ge=0 and updated DialecticSettings.LEVELS defaults: provider/model switched to "custom"/"MiniMax-M2.7" for multiple levels, MAX_OUTPUT_TOKENS for minimal increased, and several levels' THINKING_BUDGET_TOKENS set to 0.

Changes

Cohort / File(s) Summary
Validation Constraint Updates
src/config.py
Changed THINKING_BUDGET_TOKENS field validators in DeriverSettings, SummarySettings, and DreamSettings from gt=0 to ge=0, allowing zero while keeping previous upper bounds (5000, 2000, 32000).
Dialectic LEVELS Defaults
src/config.py
Updated DialecticSettings.LEVELS defaults: for minimal, low, medium, high, max switched (PROVIDER, MODEL) to ("custom","MiniMax-M2.7"); set THINKING_BUDGET_TOKENS to 0 for medium, high, max; increased minimal.MAX_OUTPUT_TOKENS from 250 to 1024. Other per-level fields unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibbled defaults through the night,
Swapped tiny budgets left and right.
Models changed to “MiniMax” bright,
Zero tokens now feel light.
Hoppity code, all set to flight ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: relaxing validation to allow thinking_budget_tokens=0 and adding support for non-Anthropic providers like MiniMax, which aligns with the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/config.py (1)

259-259: Optional: mirror the Anthropic thinking-budget guard from DialecticLevelSettings.

DialecticLevelSettings._validate_anthropic_thinking_budget (lines 338–349) rejects 0 < THINKING_BUDGET_TOKENS < 1024 for Anthropic (which Anthropic's API requires). Now that DeriverSettings, SummarySettings, and DreamSettings all accept ge=0, a user could still configure e.g. THINKING_BUDGET_TOKENS=512 with PROVIDER="anthropic" and hit a runtime API error — this gap pre-dates this PR but is worth closing alongside the relaxation, particularly for SummarySettings whose le=2000 upper bound leaves a valid-but-API-invalid window of 1..1023.

Consider extracting the existing validator into a small helper (or mixin) and applying it to the three settings classes.

Also applies to: 441-441, 545-545

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/config.py` at line 259, Current config allows THINKING_BUDGET_TOKENS
values (ge=0) that violate Anthropic's requirement (reject 0 < tokens < 1024);
extract the existing DialecticLevelSettings._validate_anthropic_thinking_budget
logic into a shared helper function or mixin (e.g.,
validate_anthropic_thinking_budget) and call it from DeriverSettings,
SummarySettings, and DreamSettings validators so that when PROVIDER ==
"anthropic" those classes reject values 1..1023; update references to the
THINKING_BUDGET_TOKENS field validation to invoke this shared validator to
ensure consistent enforcement across settings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/config.py`:
- Line 259: Current config allows THINKING_BUDGET_TOKENS values (ge=0) that
violate Anthropic's requirement (reject 0 < tokens < 1024); extract the existing
DialecticLevelSettings._validate_anthropic_thinking_budget logic into a shared
helper function or mixin (e.g., validate_anthropic_thinking_budget) and call it
from DeriverSettings, SummarySettings, and DreamSettings validators so that when
PROVIDER == "anthropic" those classes reject values 1..1023; update references
to the THINKING_BUDGET_TOKENS field validation to invoke this shared validator
to ensure consistent enforcement across settings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43e0a1c4-195b-4d25-8704-d13262837e54

📥 Commits

Reviewing files that changed from the base of the PR and between 9524358 and 12589a6.

📒 Files selected for processing (1)
  • src/config.py

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/config.py (1)

359-395: ⚠️ Potential issue | 🟠 Major

Default dialectic levels hard-require an OpenAI-compatible endpoint with no graceful fallback.

All five reasoning levels default to PROVIDER="custom" / MODEL="MiniMax-M2.7" with no BACKUP_PROVIDER/BACKUP_MODEL. Per src/utils/clients.py:266-270, CLIENTS["custom"] is only registered when both LLM_OPENAI_COMPATIBLE_API_KEY and LLM_OPENAI_COMPATIBLE_BASE_URL are set. Any deployment that upgrades without configuring both env vars will fail at dialectic request time with ValueError("Missing client for custom") — a breaking change for existing Anthropic/Google users without a graceful degradation path.

Consider one of:

  • Add BACKUP_PROVIDER="anthropic" + BACKUP_MODEL="claude-haiku-4-5" on each level for graceful fallback.
  • Revert to prior anthropic/google defaults and document the MiniMax config as an opt-in example in config.toml/docs.
  • Add a startup validator that errors with a clear message when any level uses custom but both LLM_OPENAI_COMPATIBLE_* env vars aren't set.

The model identifier "MiniMax-M2.7" is correct per the official MiniMax OpenAI-compatible API.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/config.py` around lines 359 - 395, The LEVELS default_factory currently
assigns PROVIDER="custom"/MODEL="MiniMax-M2.7" for all DialecticLevelSettings
which breaks deployments missing OpenAI-compatible env vars; update each
DialecticLevelSettings entry in the LEVELS dict to include
BACKUP_PROVIDER="anthropic" and BACKUP_MODEL="claude-haiku-4-5" so callers can
gracefully fall back when CLIENTS["custom"] is not registered (see
DialecticLevelSettings and CLIENTS behavior in src/utils/clients.py); ensure the
added fields match the DialecticLevelSettings schema and update any validation
if present to accept these backup fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/config.py`:
- Around line 359-395: The LEVELS default_factory currently assigns
PROVIDER="custom"/MODEL="MiniMax-M2.7" for all DialecticLevelSettings which
breaks deployments missing OpenAI-compatible env vars; update each
DialecticLevelSettings entry in the LEVELS dict to include
BACKUP_PROVIDER="anthropic" and BACKUP_MODEL="claude-haiku-4-5" so callers can
gracefully fall back when CLIENTS["custom"] is not registered (see
DialecticLevelSettings and CLIENTS behavior in src/utils/clients.py); ensure the
added fields match the DialecticLevelSettings schema and update any validation
if present to accept these backup fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41715d9c-dedb-44a5-b1d8-fc226aec15bf

📥 Commits

Reviewing files that changed from the base of the PR and between 12589a6 and 84edfdf.

📒 Files selected for processing (1)
  • src/config.py

@VVoruganti
Copy link
Copy Markdown
Collaborator

Closed due to #459

@VVoruganti VVoruganti closed this Apr 20, 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