Skip to content

Address review of the high reasoning default: OpenRouter Haiku budget, fit boundary, retired-variable warning - #551

Merged
neuromechanist merged 2 commits into
developfrom
feature/issue-548-review-fixes
Sep 29, 2026
Merged

neuromechanist merged 2 commits into
developfrom
feature/issue-548-review-fixes

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #550. Follows #549.

#549 merged before its independent review was addressed; this carries those fixes.

Changes

  • OpenRouter Haiku is sent its level's budget itself, reasoning: {"max_tokens": 4096} at high, not effort: OpenRouter turns an effort into a share of max_tokens, which is unset on this path (its models listing also gives Haiku no supported_efforts). none sends no reasoning field, and no temperature is sent while Haiku thinks, as on the Claude Platform path (Anthropic does not allow one with thinking). Sonnet, Luna and gpt-oss are unchanged (checked in the request body).
  • Fit rule: a max_tokens from 1025 to 2047 now gets the 1024 minimum budget instead of failing every request; 2048 and above leave the minimum budget's worth for the answer; 1024 or less is still refused. A budget a caller names is never lowered (a test now pins it).
  • ANTHROPIC_THINKING_BUDGET_TOKENS: get_settings logs a warning naming reasoning_effort as the replacement when it is still set (an operator who lowered it on purpose would otherwise get 4096 silently).
  • default_thinking loses its budget parameter and DEFAULT_THINKING_BUDGET_TOKENS goes: the default level's budget in THINKING_BUDGET_TOKENS is the one source.
  • Stale comments corrected (_THINKING_OFF, router, thinking docstring, .context note); CHANGELOG and ADR 0015 updated, including that Haiku on a caller's own OpenRouter key now reasons.

Tests

  • Fit boundaries (8000, 5121, 5120, 5119, 3000, 2049, 2048, 1500, 1025, and the refused 1024 and 1000), a caller's own budget, Haiku temperature on both paths (kept for none, dropped otherwise), OpenRouter Haiku per level and none, the other models keeping their temperature, and the warning (by name, any case, not when unset, startup unaffected).
  • No result depends on the process environment any more: the routing fixtures pin anthropic_max_output_tokens, and the tests pass with ANTHROPIC_MAX_OUTPUT_TOKENS=4000. One warning test was itself not hermetic (a shell exporting the variable hid a case-sensitivity mutation); fixed.
  • 11 mutations killed. Full offline suite (3,720 tests) and ruff pass.

Not verified by a request

reasoning.max_tokens on OpenRouter is documented as used as given (1024 at least) and max_tokens unset is not documented, so what OpenRouter fills in is unknown; BYOK only. No live Anthropic or OpenRouter request has been made.

  • Tests
  • Ruff
  • A real request through Haiku on dev

…dary, retired-variable warning

- OpenRouter: Haiku is sent its level's budget as reasoning.max_tokens (an
  effort would be a share of an unset max_tokens), no reasoning field for none,
  and no temperature while it thinks, as on the Claude Platform path.
- _fit_thinking_budget: a max_tokens between 1025 and 2047 gets the 1024 minimum
  instead of failing; a callers own budget is never lowered.
- default_thinking loses its budget parameter and DEFAULT_THINKING_BUDGET_TOKENS:
  the default level's budget is the one source.
- get_settings warns when the retired ANTHROPIC_THINKING_BUDGET_TOKENS is set.
- Tests: routing fixtures pin max output tokens; boundary, explicit-budget and
  temperature cases; the process environment no longer decides a result.

Tested: 3720 offline tests; 11 mutations killed.
…riable warning

Tested: not applicable (docs).
@neuromechanist
neuromechanist merged commit 858634c into develop Sep 29, 2026
7 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-548-review-fixes branch September 29, 2026 22:06
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