feat(moa): support per-slot reasoning effort - #61711
Conversation
|
Thanks for adding per-slot reasoning controls — the config shape and MoA plumbing look useful. I think the native Anthropic auxiliary path still needs one provider-aware hop before this works for slots such as On current build_anthropic_kwargs(
...,
reasoning_config=None,
)and does not merge {
"thinking": {"type": "adaptive", "display": "summarized"},
"output_config": {"effort": "medium"}
}Could the adapter accept the normalized Hermes A regression test at the final native client boundary would help: use a native Anthropic MoA reference slot with I observed the practical impact locally with a Fable reference: acting-agent Fable at explicit |
abe13b3 to
bf15c45
Compare
|
Thanks, agreed. I updated the PR to keep this provider-aware instead of relying on What changed:
thinking == {"type": "adaptive", "display": "summarized"}
output_config == {"effort": "medium"}
Validation after the patch: uv run --extra dev python -m pytest \
tests/agent/test_auxiliary_client.py \
-k 'AnthropicAuxiliaryReasoningTranslation or CodexAdapterReasoningTranslation' \
tests/hermes_cli/test_moa_config.py \
tests/agent/test_moa_reasoning_effort.py \
tests/agent/test_moa_slot_api_mode.py \
tests/agent/test_moa_aggregator_cost_slot.py -qResult: Also ran |
bf15c45 to
ea05be7
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for carrying the normalized config into the native Anthropic adapter; that directly addresses the provider-aware issue raised in the discussion.
Problems
agent/auxiliary_client.py:6282emitsextra_body.reasoningfor every provider, but this direct auxiliary path does not call the provider-profile hooks. That diverges from the standard transport atagent/transports/chat_completions.py:562-594: Kimi requires top-levelreasoning_effort(plugins/model-providers/kimi-coding/__init__.py:46-52), while Gemini emitsthinking_config(plugins/model-providers/gemini/__init__.py:37-48). Thus configured MoA slots for those providers will not receive their documented reasoning request shape.
Suggested changes
- Reuse the provider-profile reasoning request construction in the auxiliary builder, while retaining the native Anthropic
_reasoning_confighandoff. - Add final-kwargs coverage for Kimi and Gemini or a custom OpenAI-compatible endpoint, in addition to the Codex and Anthropic cases.
Automated hermes-sweeper review.
|
|
||
| # Provider-specific extra_body | ||
| merged_extra = dict(extra_body or {}) | ||
| if reasoning_config and isinstance(reasoning_config, dict): |
There was a problem hiding this comment.
This generic extra_body.reasoning translation bypasses the provider profiles used by the standard transport. It is not the correct request shape for Kimi (top-level reasoning_effort), Gemini (thinking_config), or custom endpoints (reasoning_effort/think). Please route reasoning_config through the shared provider-profile hooks before retaining this generic fallback.
|
Thanks, this was a good catch. Addressed in
I also carried Added final-kwargs regression coverage for Kimi, Gemini, custom OpenAI-compatible endpoints, and the async boundary. Verification:
|
|
Merged via PR #64631 — both of your commits were cherry-picked onto current main with your authorship preserved in git history (rebase merge, commits 3dca75b + 5646dbd). Thanks @justinschille — the provider-profile projection commit in particular was exactly right: per-slot depth is only useful if each advisor's wire gets the correct request shape, and you covered OpenRouter, custom/vLLM/GLM, Ollama-disable, and the Anthropic Messages path. On top of your commits we removed the ensemble-wide Closes #53932. |
Summary
Adds optional
reasoning_effortsupport to Mixture of Agents reference and aggregator slots.This lets a preset tune reasoning depth per slot instead of only at the global agent/session level. For example, a MoA preset can run the same model twice with different reasoning depths, then use a higher-reasoning aggregator:
What changed
reasoning_effortduring MoA config normalization for reference and aggregator slots.reasoning_effortwith the same Hermes reasoning parser used byagent.reasoning_effort.call_llmcalls.reasoning_configinto the existingextra_body.reasoningrequest shape.hermes moa listoutput.Why
MoA slots were previously provider/model only. That works for model diversity, but it cannot express useful same-model/different-depth councils. Per-slot reasoning effort makes MoA presets more expressive without changing existing preset behavior. Slots without
reasoning_effortcontinue using provider/Hermes defaults.Validation
Result:
Also ran: