Repository navigation
Drop the failover decorator nobody calls - #132
Merged
Merged
Conversation
`tw-resil::failover` wraps a list of providers and switches on failure. Nothing calls it. Not this repo, and not the enterprise gateway that depends on tw-resil — that one does its own failover in `proxy::routing::select_route_with_failover`, and the only trace of this decorator over there is a doc comment in the MCP gateway saying it mirrors the design. 582 lines with no caller, which is how it stayed on an `AiProvider` trait that is about to change shape: nothing broke, because nothing ran. Removing it takes `tw-provider` out of tw-resil's dependencies, so tw-resil is down to tw-types. That matters beyond the line count: this crate could not be depended on from the rest of core without dragging the provider layer along with it. The circuit breaker stays where it is. `tw-resil::cb_registry` and `tw-gateway::health` sound like the same thing and are not — the first is a process-wide registry two gateways write into so a dashboard can render the state, the second is the state machine that decides whether an upstream is usable. Merging them is a separate question, and it needs the enterprise gateway's own 460-line `health.rs` in the comparison. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
tw-resil::failover— 582 lines — is deleted.FailoverProviderwraps a list of providers and switches on failure. Nothing calls it:proxy::routing::select_route_with_failover. The only trace of this decorator there is a doc comment in the MCP gateway noting that its circuit breaker "mirrors the design of FailoverBackend"No caller is also why it was still sitting on an
AiProvidertrait that is about to change shape — nothing broke, because nothing ran.Why it is worth doing now
It takes
tw-providerout of tw-resil's dependency list, leaving justtw-types.That matters beyond the line count: nothing else in core could depend on tw-resil without dragging the whole provider layer in behind it. That constraint is what pushed the circuit-breaker consolidation out of the earlier shared-layer work.
What is deliberately not in here
The circuit breaker stays put.
tw-resil::cb_registryandtw-gateway::healthsound like duplicates and are not:cb_registryhealthMerging them is a separate question, and answering it properly means putting the enterprise gateway's own 460-line
health.rsnext to both — its fields don't line up with either.cargo fmt --check,clippy --workspace --all-targets -- -D warnings, 85 test binaries green.🤖 Generated with Claude Code