v3.1.0
What's Changed
Gateway Routing
- Direct-first model resolution: Bare
provider/modelIDs (e.g.anthropic/claude-opus-4-5) now route to your direct provider key when configured, falling back to OpenRouter automatically when it isn't. Explicitopenrouter/...prefixes remain force-OpenRouter overrides. - Gateway control surface: New
--gateway auto|direct|openrouterCLI flag onstart,fanout, andcontinuecommands, plus matchinggatewayparameter on MCP tools.routing.preferconfig key sets the global default ("direct"by default). - Structured routing errors: Non-interactive CLI and MCP now emit consistent
model_route_errorobjects withtype,field,requested, andreasonfields instead of ad-hoc messages when routing fails. - Interactive fallback picker: When a direct route misses (missing key or model not in vendor's catalog), interactive runs now show a picker with alternatives instead of failing outright.
Model Catalog
- Live Anthropic model fetcher: The model catalog now queries Anthropic's API directly for the current model list, bringing parity with OpenAI and Google's existing live-fetch behavior.
Configuration
- Default aliases migration: Built-in aliases for direct-capable vendors (
openai,google,anthropic,deepseek) now resolve to bare canonical model IDs instead ofopenrouter/...prefixes, so they participate in direct-first routing automatically. Gateway-only vendors (Qwen, Grok, GLM, Mistral) remain unchanged. - One-time migration notice: If you hold both an OpenRouter key and a direct key for a vendor, the first qualifying run prints a one-time notice showing which vendor moved to direct routing. Set
routing.prefer: "openrouter"or use--gateway openrouterto restore the all-OpenRouter behavior without seeing the notice again. - Session provenance preservation: Resume and continue operations now preserve the gateway a run originally resolved to, even if keys or
routing.preferchange between runs.
Infrastructure
- Router foundation modules: New
provider-registry.js,model-descriptor.js,model-classification.js, andgateway-router.jsutilities provide unified provider metadata, descriptor grammar, tri-state model classification, and pure routing logic. All fully unit-tested with zero impact on existing launch paths. - Expanded test coverage: Added 14 new test files covering routing decision logic, model classification, error rendering, MCP integration, and end-to-end routing scenarios.
Full Changelog: v3.0.0...v3.1.0