# NousResearch/hermes-agent · max_tokens silently dropped across providers and routes

## Open now

- 2 issues, 1 PR open on GitHub.
- #59763: _resolve_runtime_agent_kwargs_for_provider()\` omits \`max_tokens\` from its return dict, so \`model.max_tokens\` / \`HERMES_MAX_TOKENS\` / per-provider \`max_output_tokens\` caps are silently ignored on any provider-pinned route; \`_build_call_kwargs()\` additionally drops an explicit \`max_tokens\` for OpenRouter on the auxiliary path
- #60388: \[Bug\]: \`max_tokens\` settings across config.yaml are silently dropped
- PR #59792: fix(agent): include max_tokens in _resolve_runtime_agent_kwargs_for_provider return dict (#59763)

A bug where max_tokens settings from config.yaml were silently ignored on various code paths, with multiple fixes forwarding the parameter to all providers and routes. One related item adds a reference_max_tokens cap for advisor output.

## TL;DR

- 10 member(s): 2 open issue(s), 0 closed issue(s), 1 open PR(s), 1 merged PR(s), 6 PR(s) closed without merging.
- A fix was merged to main in PR #70279. Verify it addresses your case.
- **Recommended:** read PR #70279 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): 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.19`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #59763: _resolve_runtime_agent_kwargs_for_provider()\` omits \`max_tokens\` from its return dict, so \`model.max_tokens\` / \`HERMES_MAX_TOKENS\` / per-provider \`max_output_tokens\` caps are silently ignored on any provider-pinned route; \`_build_call_kwargs()\` additionally drops an explicit \`max_tokens\` for OpenRouter on the auxiliary path
- #60388: \[Bug\]: \`max_tokens\` settings across config.yaml are silently dropped

## Prior & competing PRs

- **#60645: fix(aux): forward max_tokens to all providers instead of dropping it for non-Anthropic/NIM**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#60620`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#70279: fix(moa): reference_max_tokens caps advisors on every provider, never the aggregator + per-slot caps (cluster salvage)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/auxiliary_client.py`, `agent/conversation_loop.py`, `agent/moa_loop.py`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `hermes_cli/moa_config.py`, `tests/agent/test_auxiliary_client.py`, `tests/agent/test_moa_context_max_tokens.py`, `tests/agent/test_moa_slot_max_tokens.py`, `tests/hermes_cli/test_moa_config.py`
- **#59792: fix(agent): include max_tokens in _resolve_runtime_agent_kwargs_for_provider return dict (#59763)**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `gateway/run.py`
- **#60454: fix(auxiliary): forward max_tokens to all providers, not just Anthropic/NIM (#60388)**. closed without merge
  - maintainer direction: category `stale_abandoned`; implication `active`
- **#60513: fix(aux): forward max_tokens to all providers instead of dropping it (#60388)**. closed without merge
  - maintainer direction: category `stale_abandoned`; implication `active`
- **#60620: fix: forward max_tokens to all providers in _build_call_kwargs (#60388)**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#71229: fix(gateway): forward max_tokens on provider-pinned routes (#59763)**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#124043: fix: resolve #60388 — \[Bug\]: max_tokens settings across config.yaml are silently dropped**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`

## Fix status

- Merged to main in PR #70279 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-07-23`.
- Subsystem: `agent`
