Repository navigation
feat(core): provider failover chain with a durable route record (#209, 1/3) - #404
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 18, 2026
Merged
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.
What
Part 1 of 3 of #209: the failover mechanism in tole-core. Part 2 adds the real-provider integration test, part 3 the env/config wiring and docs.
Why
An unattended mission parks resumable when its provider has an outage, but makes no progress until a human resumes. A reserve provider turns most outages into a non-event, and durable sessions make the switch auditable.
Changes
failover.rs(new):FailoverProviderwraps an ordered chain (Link { label, provider }, primary first). On an "unavailable" error (connection failure, timeout, dropped stream, HTTP 5xx or 429) the same step is retried on the next provider; request errors (401/403/404/400, malformed responses) fail loud and never fail over. The answering provider stays active (no flapping); the primary is retried afterretry_primary_after(default 5 min). When every provider fails, the last error leads (the turn loop's transient-retry classification reads it) followed by the earlier ones.provider.rs: new default methodlast_route()(None for a single provider: no behaviour change).turn.rs: the route is stored under the namespacedtole_routekey of the step's usage row, next totole_wire.usage_report.rs: a row holding only tole's owntole_*keys is not a provider step (an empty object still is, the pre-token efficiency: lazy tool registration + tool-result trimming policy #211 contract), so route rows never change step accounting.Testing
cargo check -p tole-core --no-default-featurespass; cora review --staged clean.OpenAiProvidererror text and a full turn are covered by the integration test in part 2 (passes locally).Refs #209