fix: preserve Anthropic provider identity in MoA - #55452
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary\n\nVerdict: LGTM\n\nAdds anthropic to the provider-identity-preserving path in MoA's _slot_runtime(). 1-line change in the source plus 26 lines of regression test. Well-scoped and targeted fix.\n\n### Looks Good\n- Single-line source change with clear rationale\n- Regression test ensures Anthropic MoA slots don't return base_url/api_key runtime kwargs\n- Consistent with the existing pattern for nous, openai-codex, and xai-oauth\n---\nReviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review: LGTM
Adds "anthropic" to the MoA provider identity set so Anthropic slots don't get auto-detected as custom chat-completions endpoints. This preserves the Messages API adapter path. Clean one-line fix with a focused regression test.
Verdict: LGTM -- correct provider identity fix.
|
Closing as a duplicate of #54609 (submitted ~26h earlier), which fixed the same issue — adding One note for the record: the "downgraded to a custom chat-completions call / wrong wire protocol" framing is only partly the cause — a native anthropic host ( |
Summary
MoA reference/aggregator slots currently resolve provider runtime metadata with
resolve_runtime_provider(). For providers whose resolved runtime includes abase_url,_slot_runtime()passes thatbase_urlintocall_llm().call_llm()treats an explicitbase_urlas a custom endpoint. That is correct for generic OpenAI-compatible custom endpoints, but it is wrong for first-class providers whose provider branch supplies a protocol adapter or special auth behavior.This was already handled for
nous,openai-codex, andxai-oauth. This PR addsanthropicto the same provider-identity-preserving path so MoA Anthropic slots continue through the Anthropic Messages adapter instead of being treated as custom chat-completions endpoints.Why
Without this, an Anthropic MoA slot can be downgraded into a custom chat-completions call. On Anthropic Messages-compatible endpoints this can route to the wrong wire protocol/path and fail before the aggregator receives useful reference output.
Change
anthropicinagent.moa_loop._slot_runtime().base_url/api_keyruntime kwargs and therefore do not forcecall_llm()into the custom endpoint path.Validation
Result: