Add configurable fallback LLM provider - #115
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #115 +/- ##
========================================
Coverage 99.85% 99.85%
========================================
Files 109 111 +2
Lines 11647 11973 +326
Branches 708 717 +9
========================================
+ Hits 11630 11956 +326
Misses 12 12
Partials 5 5 ☔ View full report in Codecov by Harness. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds optional LLM fallback configuration, validates paired provider settings, composes a sticky fallback wrapper, preserves request and cancellation error semantics, closes both providers safely, and documents and tests the behavior. ChangesLLM fallback
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Application
participant FallbackLLMProvider
participant PrimaryLLM
participant FallbackLLM
Application->>FallbackLLMProvider: invoke operation
FallbackLLMProvider->>PrimaryLLM: send request
PrimaryLLM-->>FallbackLLMProvider: LLMRequestError
FallbackLLMProvider->>FallbackLLM: retry operation
FallbackLLM-->>Application: return result
Application->>FallbackLLMProvider: close provider
FallbackLLMProvider->>PrimaryLLM: aclose()
FallbackLLMProvider->>FallbackLLM: aclose()
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
/agentic_review |
Code Review by Qodo
Context used✅ Compliance rules (platform):
46 rules 1.
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 563f8f3 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit aa6284c |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 3dd2ab5 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 005dbe9 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit ce7406b |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit ff9b43e |
|
Code review by qodo was updated up to the latest commit f731260 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 77a2a24 |
|
Code review by qodo was updated up to the latest commit 77a2a24 |
|
Code review by qodo was updated up to the latest commit 77a2a24 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit f500cfd |
f500cfd to
77a2a24
Compare
fa43088 to
55602fa
Compare
|
Code review by qodo was updated up to the latest commit 55602fa |
* feat(llm): add configurable fallback provider * fix(llm): address fallback review findings * fix(llm): preserve cancellation semantics * fix(llm): finish fallback cancellation cleanup * fix(llm): preserve original cancellation * fix(llm): keep cancellation traceback intact * docs(llm): clarify fallback tradeoff * docs(llm): surface fallback tradeoff * fix(llm): improve fallback diagnostics * docs(llm): explain sticky fallback * docs(llm): correct fallback lifetime * fix(llm): preserve cleanup diagnostics * fix(llm): clarify sticky fallback diagnostics * fix(llm): add fallback connection overrides * docs: remove redundant fallback guidance
Summary
LLM_FALLBACK_PROVIDERandLLM_FALLBACK_MODELsettingsVerification
prek run --all-filesuv run --frozen --with pytest --with pytest-cov -- pytest --cov --cov-branch --cov-report=xml(1159 passed; 99% coverage, no regression from master)Summary by CodeRabbit
New Features
Documentation