Repository navigation
Fall back to cached Claude CLI result on probe timeout - #904
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
In Auto mode, a Claude CLI probe timeout now falls back to the retained CLI result from the last 15 minutes, the same way other CLI failures already did. Before this,
record_auto_sourcepropagated the timeout immediately as a transport failure, so the stale-cache fallback at the end offetch_via_autowas never reached.stale_cli_result_on_probe_timeout: when the CLI leg returns a transport-class error (the CLI probe has no network leg, so this is a probe timeout), return the retained CLI result if one is still within its TTL. With no retained result, the timeout propagates as before.live_auto_success: a live OAuth or Web success in Auto mode clears the retained CLI result. Without this, a later CLI timeout could serve usage older than what the user already saw from OAuth or Web.Tests
New tests in
rust/src/providers/claude/mod.rs(all behindCLI_CACHE_TEST_LOCK, no real CLI, OAuth, network or cookies):cli_probe_timeout_returns_stale_cached_cli_resultcli_probe_timeout_without_cache_still_propagatescli_auth_failure_skips_timeout_fallback_and_is_recordedlive_oauth_or_web_success_drops_retained_cli_result(OAuth and Web)revoked_oauth_failure_keeps_retained_cli_resultCommands run
cargo fmt --allcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: passcargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings: passcargo test --manifest-path rust/Cargo.toml claude: all new and existing timeout/cache tests pass on every run. Some runs had one failure inproviders::claude::accounts::tests(a different test each time) from a Windows temp-file replace race (0x80070497); those tests pass alone, andaccounts.rsis not touched here.No UI change.