Repository navigation
Conversation
…aker The learn pass retried every unit three times with 2s/4s sleeps even when the provider was down, so an outage cost every unit's retries. A breaker from llm-resilience shared across the pass opens after two units in a row use up their retries; later units are skipped without a call and stay unlearned for the next run. Fatal errors and context overflows do not count. Adds llm-resilience 0.2.1 (default features off), which brings in parking_lot plus lock_api and parking_lot_core; tokio and tracing are already in the tree. Disclosure: I maintain llm-resilience.
This branch has not been deployed
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.
Problem
distill::proposeretries each learning unit on its own: up to 3 calls, sleeping 2 s then 4 s between them. Nothing carries over from one unit to the next, so when the provider is down a learn pass over N units makes 3N calls and waits about 6 s per unit before giving up on each one.Change
One
CircuitBreaker(fromllm-resilience) is now shared by every model call in a learning pass (learn()andlearn_from_run()each create one withdistill::breaker()).TransientorRateLimitederror counts as a failure.ProviderDownat once without calling the provider. Their trials stay unlearned, so the next run picks them up, the same as any other failed call today.LearnReportgets aprovider_down_skipscount (these units are also counted inmodel_errors).Tests
Two new tests in
crates/learn/src/tests.rs, using the existingScriptedProviderand paused tokio time:a_provider_outage_stops_the_pass_after_two_units: with three learnable units and a provider that always fails, the pass makes 6 requests instead of 9, and the third unit is reported as a provider-down skip.a_recovered_call_keeps_the_pass_going: a rate limit and a transient error followed by a good reply still adds the lesson, with no skips.cargo test -p gitagent-learnpasses (17/17).Dependency
llm-resilience0.2.1 withdefault-features = false, incrates/learnonly. It addsparking_lot(withlock_apiandparking_lot_core, plusredox_syscall, which is only built on Redox) toCargo.lock.tokioandtracing, which it also uses, are already in the tree.Disclosure: I maintain llm-resilience.