Auxiliary client max_tokens handling in _build_call_kwargs across providers
Cluster 41035 · agent · Bug. Data as of
4 open items. Fix merged in #99725 on 31 Aug 2026. Check it covers your case.
The short answer
- Known?
- Yes. 16 related items grouped here, 2 issues already closed.
- Fix event
- A fix was merged to main in PR #99725. Check it covers your case. No release data is tracked. Fix link checked: 31 Aug 2026.
- Tracker
- The maintainers' tracker marks this
unresolved. That is separate from the fix event.
Next step: read #99725, then check whether your report is one of the 2 still open.
Read #99725Pick up a Lab taskMost members concern auxiliary LLM calls (title generation, compression, vision) where max_tokens is dropped, inflated, or not passed explicitly, with reported effects on OpenRouter (402 errors), LiteLLM/Bedrock proxies (HTTP 400), and local backends. The members are a mix of issue reports and proposed fixes, and the specific provider scenarios differ.
Open issues2
Open PRs2
Fixes on record
-
#99725 fix(compression): OpenRouter fallback survives credit-limited 402s by clamping to the affordable budget (salvage #41055)
files:
agent/auxiliary_client.py,tests/agent/test_aux_affordable_402_retry.py,tests/agent/test_auxiliary_openrouter_max_tokens.py
9 PRs closed without merging
From the close comments: duplicate 4 · superseded by another PR 2 · done elsewhere 1 · merged via another change 1 · other 1
-
#41055 fix(auxiliary): preserve max_tokens for OpenRouter to prevent free-tier 402 · merged via another change →
13c3958,#99725,#49785,#41035 -
#41063 fix(openrouter): include max_tokens + fix credential pool fallback (#41035) · done elsewhere →
c56b39c,#53906,#23495,#41035 -
#50139 fix(auxiliary): preserve explicit max_tokens caps (#50132) · other →
#50139,#50132 -
#50147 fix(auxiliary): preserve explicit caps for compatible routes · superseded by another PR →
#50132 -
#50158 fix(agent): pass max_tokens unconditionally in _build_call_kwargs · duplicate →
#50139,#50132,#50147
Show 4 more
-
#56934 fix(auxiliary): preserve max_tokens for OpenRouter to prevent 402 · superseded by another PR →
#41055 -
#56960 fix(auxiliary): preserve OpenRouter max_tokens for title generation · duplicate →
#41055,#56934,#56957 -
#57382 fix(auxiliary): cap OpenRouter max tokens · duplicate →
#41055,#56901 -
#58053 fix(auxiliary): preserve OpenRouter max tokens · duplicate →
#41055
Closed issues · 2
How this cluster was grouped
-
Link evidence (
partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text. - Members outside that structural core may belong to a different underlying problem.
-
Pairwise link density
0.12: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.