fix: stop retrying LLM payment errors#48
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Summary by CodeRabbit
WalkthroughThis PR introduces end-to-end handling of HTTP 402 "payment required" responses from LLM API providers. A new Sequence DiagramsequenceDiagram
participant CLI as CLI Main
participant Convert as Convert Command
participant LLMClient as LLM Client
participant Provider as LLM Provider
CLI->>Convert: execute convert
Convert->>LLMClient: request LLM
LLMClient->>Provider: call generateText
Provider-->>LLMClient: HTTP 402 APICallError
LLMClient->>LLMClient: isPaymentRequiredError check
LLMClient->>LLMClient: wrap in LLMPaymentRequiredError
LLMClient-->>Convert: throw LLMPaymentRequiredError
Convert-->>CLI: reject with LLMPaymentRequiredError
CLI->>CLI: formatCLIError handler
CLI->>CLI: write "LLM payment required." to stderr
CLI->>CLI: set process.exitCode = 1
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
Summary
Tests