mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-04 02:21:47 +00:00
The direct Minimax OpenRouter endpoint silently drops tool-call streams on tool-calling workflows (MiniMax-M2#109, reproduced 4/4 times on 2026-04-18: zero content, no finish_reason, silent close at ~40s). PR #12072 surfaced the failure to the user; this PR avoids it entirely by routing minimax/* requests to Fireworks / NovitaAI / Google-Vertex / AtlasCloud / Together by default. New module agent/provider_tweaks.py centralizes known-broken-endpoint avoidance with a single registry entry per upstream bug. User-supplied provider preferences (provider_sort, providers_allowed/ignored/order) always win — tweaks only fill in defaults where absent, and a user who sets 'only' is fully opted out. Wired into both provider_preferences build sites in run_agent.py (main chat loop + iteration-summary call). Only applies when base_url targets openrouter.ai. Validation | | Before | After | |---|---|---| | minimax/minimax-m2.7 tool-call stream on OR (direct endpoint) | 0/4 success | 4/4 on Fireworks | | extra_body.provider injected for minimax/* on OpenRouter | no | ignore=[minimax] order=[fireworks,novitaai,google-vertex,atlascloud,together] | | extra_body.provider for anthropic/* on OpenRouter | unchanged | unchanged | | extra_body.provider for minimax/* on api.minimax.io | unchanged | unchanged | | User-supplied {only:[minimax]} | unchanged | unchanged (explicit opt-in honoured) | | tests/agent/test_provider_tweaks.py | n/a | 23 passed | | tests/run_agent/test_streaming.py | 26 passed | 26 passed | Live e2e sanity (real OpenRouter call): 89.6s clean response via Fireworks, with `extra_body.provider={'ignore': ['minimax'], 'order': ['fireworks',...]}` confirmed in the outgoing request. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| anthropic_adapter.py | ||
| auxiliary_client.py | ||
| bedrock_adapter.py | ||
| context_compressor.py | ||
| context_engine.py | ||
| context_references.py | ||
| copilot_acp_client.py | ||
| credential_pool.py | ||
| display.py | ||
| error_classifier.py | ||
| gemini_cloudcode_adapter.py | ||
| google_code_assist.py | ||
| google_oauth.py | ||
| insights.py | ||
| manual_compression_feedback.py | ||
| memory_manager.py | ||
| memory_provider.py | ||
| model_metadata.py | ||
| models_dev.py | ||
| nous_rate_guard.py | ||
| prompt_builder.py | ||
| prompt_caching.py | ||
| provider_tweaks.py | ||
| rate_limit_tracker.py | ||
| redact.py | ||
| retry_utils.py | ||
| skill_commands.py | ||
| skill_utils.py | ||
| smart_model_routing.py | ||
| subdirectory_hints.py | ||
| title_generator.py | ||
| trajectory.py | ||
| usage_pricing.py | ||