feat: unified provider architecture (Phase 1) — trait, registry, unified errors, validation, live OpenRouter#17
Open
mrap wants to merge 1 commit into
Open
Conversation
…ied errors, validation, live OpenRouter Implements axes 1, 2, 7, 8, 9 from the BOI provider architecture design doc: - Provider trait: name, capabilities, validate_config, invoke, cost_estimate, actual_cost - ProviderRegistry: built-ins (claude, openrouter, deterministic) registered at startup - ProviderError: unified enum replacing bespoke per-provider error handling - Validation lifecycle: registration-time, TOML-load-time (loud startup warnings), pre-invocation - runner.rs refactored: registry lookup replaces if/else chain + BOI_FORCE_CLAUDE removed - Unified telemetry: boi.phase.invoked / boi.phase.completed / boi.provider.error - CodexProvider added as third impl (proves extensibility without touching runner.rs) - Live verification: OpenRouter confirmed firing via daemon log + cost signature - docs/providers.md: full Provider trait contract + how-to guide Hard outcome: the OpenRouter-runtime-drop bug is now impossible. The daemon either honors `runtime = "openrouter"` or fails loudly at startup with an actionable message pointing to the missing env var. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Provider: Send + Sync) replacesPhaseRuntime—name,capabilities,validate_config,invoke,cost_estimate,actual_costclaude(always),openrouter(if API key present, else disabled with reason),deterministic(always)NotConfigured,AuthFailed,RateLimit,Timeout,BadResponse,NetworkError,CapabilityMissing,BudgetExceededBOI_FORCE_CLAUDEescape hatch removedboi.phase.invoked/boi.phase.completed/boi.provider.errorreplace bespoke spawn eventsdocs/diagnostics/2026-04-30-provider-arch-live-verified.mdHard outcome
The OpenRouter-runtime-drop bug (discovered 2026-04-29) is now structurally impossible. Daemon either dispatches to the named
runtime=provider or fails loudly at startup:Version target
v1.3.0 — please ship once reviewed. v1.2.0 was S9CE3 telemetry.
Test plan
cargo buildpassescargo test --libpasses (provider_trait, provider_error, provider_registry, provider_validation_startup, runner, telemetry_unified, codex_provider)boi providers listprints claude + openrouter (or disabled) + deterministicruntime=openrouterwhen key is absent🤖 Generated with Claude Code