Skip to content

v3.10.1: ADR-043 LLM Router Actually Wired

Choose a tag to compare

@proffesor-for-testing proffesor-for-testing released this 22 May 08:13
· 108 commits to main since this release
11773f6

What's New

The ADR-043 LLM router is now actually wired into the production swarm path. HybridRouter and per-service analyzeXxxWithLLM() branches (ADR-051) were implemented in previous releases but never injected — every domain service accepted llmRouter as an optional dependency and zero callers passed one, so the LLM branches in 15 service paths across 11 domains were unreachable.

Behavioral consequence: fleets booted with ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, GOOGLE_AI_API_KEY, GEMINI_API_KEY, or GOOGLE_API_KEY in env will now route LLM-enhanced analysis through that provider — previously the same fleet ran zero LLM calls from the swarm path regardless of provider config.

Highlights

  • Kernel constructs a HybridRouter singleton during initialize() and threads it through every domain factory and MCP standalone tool. One router instance — single cost tracker, cache, circuit breaker.
  • aqe llm config --set now persists to .agentic-qe/llm-config.json (was a TODO comment before — settings evaporated with the process). File is apiKey-stripped on write; --set apiKey=... is refused and points users at env vars.
  • Gemini provider accepts GOOGLE_API_KEY in addition to GOOGLE_AI_API_KEY and GEMINI_API_KEY.
  • Two real HybridRouter fallback-chain fixes surfaced by the E2E pass:
    • Fallback chain was hardcoded to ['claude', 'openai', 'ollama'] — users with only Gemini/openrouter/azure/bedrock had no fallback. Now honors all 7 ExtendedProviderType providers + the user's defaultProvider.
    • Non-retryable errors short-circuited the entire fallback loop. Now they skip the retry-delay but continue to the next fallback entry.
  • 10-finding qe-devils-advocate audit hardening sweep closed before merge.
  • Three opt-out mechanisms: AQE_LLM_ROUTER_DISABLED=1, KernelConfig.llmRouter: { enabled: false }, or unset provider keys.

Getting Started

npx agentic-qe init --auto

To enable the LLM router, set any provider key:

export GEMINI_API_KEY=...   # or ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.

To explicitly opt out:

export AQE_LLM_ROUTER_DISABLED=1

Verified Against Real Providers

End-to-end round-trip verified on 2026-05-21 against Gemini (gemini-2.5-flash), OpenAI (gpt-4o-mini), and OpenRouter (openai/gpt-4o-mini). 5 real-provider E2E tests, 16 behavioral integration tests, 17 structural wiring tests, 110+ unit tests.

See CHANGELOG and v3.10.1 release notes for full details.