fix(auxiliary): support minimax-oauth as an auxiliary provider for vision - #86960
raymondyan-zhijie wants to merge 1 commit into
Conversation
Duplicate of #36779: it already provides the dedicated MiniMax OAuth auxiliary routing for this same missing dispatch path. |
fix(auxiliary): support minimax-oauth as an auxiliary provider for vision
|
…sion resolve_provider_client only handled nous/openai-codex/xai-oauth in its oauth_external branch; minimax-oauth fell through to (None, None), so an auxiliary.vision config of minimax-oauth/MiniMax-M3 could never build a client and vision_analyse was permanently unavailable. Add _build_minimax_oauth_aux_client(), mirroring how agent_init.py builds the main agent MiniMax OAuth client: short-lived ~15min tokens are handled by passing a callable token provider to build_anthropic_client, which installs a per-request bearer hook re-reading auth.json. Add a dedicated minimax-oauth branch in resolve_provider_client between xai-oauth and the custom endpoint branch. Falls back to (None, None) with a warning when no MiniMax OAuth token is present. Co-Authored-By: Claude <noreply@anthropic.com> (cherry picked from commit d7f8088d13ca44466bf90699c78590a97c98cd91) (cherry picked from commit bf6289d)
9427e98 to
15a4544
Compare
|
Rebased onto current The revision that was here patched the inline provider if-chain inside On the duplicate label. #36779 does target the same dispatch hole, but it has never been merged and reports Still true on _EXPLICIT_PROVIDER_BRANCHES: Dict[str, Callable[[_ResolveRequest], _ResolveResult]] = {
"auto": _resolve_auto_branch,
"openrouter": _resolve_openrouter_branch,
"nous": _resolve_nous_branch,
"openai-codex": _resolve_openai_codex_branch,
"xai-oauth": _resolve_xai_oauth_branch,
"custom": _resolve_custom_branch,
}No |
Re-triaged after the rebase: dropping the |
Summary
resolve_provider_client's OAuth handling only coverednous/openai-codex/xai-oauth. A config usingauxiliary.vision: {provider: minimax-oauth, model: MiniMax-M3}fell through to the "Other OAuth providers not directly supported" arm and returned(None, None), socheck_vision_requirements()stayed false and the vision tool was permanently unavailable — images sent over Feishu/WeChat/Open WebUI returned 400.This adds a dedicated
minimax-oauthbranch toresolve_provider_clientand a_build_minimax_oauth_aux_client()helper that mirrors howagent_init.pyconstructs the main agent's MiniMax OAuth client.Implementation notes
api_keyas a static string at construction time, so a static bearer would 401 mid-session.build_minimax_oauth_token_provider()returns a callable;build_anthropic_clientdetects the callable and installs a per-request bearer hook that re-readsauth.json, so a refresh persisted by another process is picked up immediately.(None, None)with a warning when no MiniMax OAuth token is present — never blocks on missing auth.xai-oauthbranch and the Custom endpoint branch inresolve_provider_client.Verification
check_vision_requirements()gate returns True.resolve_vision_provider_client()resolves to anAsyncAnthropicAuxiliaryClientwith modelMiniMax-M3.xai-oauthwith no token still returns(None, None).adminuser) and confirmed via live Feishu image test.🤖 Generated with Claude Code