Harden retry/timeout classification on structured HTTP status and bra… - #235
Conversation
…nded app timeouts
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughRetry and timeout handling now uses structured HTTP status extraction and branded application timeout errors. Pinecone search and rerank tests cover structured 429 retries, while server and query-tool tests verify timeout classification. ChangesRetry and timeout classification
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PineconeOperation
participant transientShouldRetry
participant defaultShouldRetry
participant AppTimeoutError
PineconeOperation->>transientShouldRetry: evaluate thrown error
transientShouldRetry->>defaultShouldRetry: evaluate non-timeout error
defaultShouldRetry-->>transientShouldRetry: retry structured 429 or 5xx
transientShouldRetry-->>PineconeOperation: retry or propagate
AppTimeoutError-->>transientShouldRetry: do not retry application timeout
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/core/server/retry.ts`:
- Around line 163-181: Update defaultShouldRetry so any defined HTTP status
returns the result of isRetryableHttpStatus immediately, including non-retryable
statuses; only run hasTransientPineconeErrorName and message-regex fallbacks
when getHttpStatus returns undefined. Add a regression test in retry.test.ts
covering a structured non-retryable status with a retryable-looking message and
assert it returns false.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1140755d-1399-4265-95dc-376b250e7ba7
📒 Files selected for processing (6)
src/core/pinecone/rerank.test.tssrc/core/pinecone/search.test.tssrc/core/server/retry.test.tssrc/core/server/retry.tssrc/core/server/tool-error.test.tssrc/core/server/tools/query-tool.context.test.ts
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
=======================================
Coverage ? 86.34%
=======================================
Files ? 48
Lines ? 2599
Branches ? 875
=======================================
Hits ? 2244
Misses ? 353
Partials ? 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Summary
Retry and timeout classification no longer depends primarily on error-message regex. Transient failures are detected from structured HTTP status, Pinecone SDK error names, and a branded
AppTimeoutErrorbefore falling back to network-ish message patterns.AppTimeoutError(thrown bywithTimeout) and strengthenisAppTimeoutErrorviainstanceof, cause-chain walk, and legacy message-prefix fallbackforEachErrorInChain,getHttpStatus, andisRetryableHttpStatusto extract status fromstatus/statusCode, Pinecone error names, and name-gated SDK message patternsdefaultShouldRetry: reject app timeouts first, then structured status →PineconeConnectionError→ message-regex last resortPineconeUnmappedHttpError,AppTimeoutErrornon-retry, andclassifyToolCatchError→TIMEOUTClassification-only change: retry counts, backoff defaults, and
requestTimeoutMswiring are unchanged.Closes #230
Test plan
npm run ci(typecheck, lint, format, build, benchmark smoke, test:coverage)retry.test.ts— structured{ status: 429 },PineconeUnmappedHttpError+Status: 429,AppTimeoutErrornot retried viadefaultShouldRetrysearch.test.ts/rerank.test.ts— reworded 429 retried throughrunWithPolicy; search timeout rejectsAppTimeoutErrortool-error.test.ts/query-tool.context.test.ts—AppTimeoutErrormaps to MCPTIMEOUTSummary by CodeRabbit