You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With set retries enabled, cancellation just before the next retry wait can leave a request waiting for its entire configured delay before returning 499. A normally expired wait also leaves its abort listener attached to the request signal.
Reuse the existing cancellation-aware wait helper. Keep a timer turn for zero-delay retries so queued cancellation can run before another dispatch. Retry limits and the existing 499 response are preserved.
Proof of fix
Four regression scenarios fail on pristine release/v3.8.53 at 6ecb2090 and pass with the fix. They exercise the real handleComboChat handler with synthetic upstream responses, covering cancellation before the wait and listener cleanup after success or exhaustion. Cancellation during a wait, dispatch counts and zero-delay behavior are also checked.
Scoped ESLint, Prettier, whitespace checks and pre-commit hooks pass. The private UI-kit snapshot gate skips because its reference clone is unavailable.
Full lint exceeded a 300-second local budget. Full unit/Vitest suites, typecheck and application build were not run; those checks remain for CI.
Related: #17885 fixed separate loop-safety timers. This patch covers the delay between sets.
Target: release/v3.8.53.
⚠️ base-red inherited: #17219. The target release branch already has unrelated failing checks tracked in that issue.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Combo-set retries now stop immediately when a request has already been cancelled, returning the expected cancellation response.
Cancellation during a retry delay is handled reliably, and retry attempts continue to yield before dispatching—even when the delay is zero.
Retry and safety timers are cleaned up across cancellation, retries, and other terminal outcomes.
The combo-set retry loop now uses a cooldown-aware wait with a minimum delay of 1 ms. Tests cover cancellation and cleanup during retry delays, pre-aborted requests, successful retries, and retry exhaustion.
The retry loop uses waitForCooldownAwareRetry with a minimum delay of 1 ms. The existing abort check and 499 response remain in place. The changelog describes cancellation handling, listener cleanup, and yielding before zero-delay retries.
Retry timer and cancellation tests tests/unit/combo-loop-safety-timer-cleanup.test.ts
Controlled retry timers support tests for cancellation, pre-aborted requests, successful retries, and retry exhaustion. The tests check timer and abort-listener cleanup.
Retry waits now handle cancellation and preserve the 499 response. No merge-blocking risk was established; run the usual CI checks.
Pre-merge checks: 6 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 6 passed
Check name
Status
Explanation
Title check
The title follows the Conventional Commits form fix(combo): ... with an allowed type. It names the main change: set-retry waits now cancel promptly, which matches the comboAttemptLoop.ts change that…
Description check
The description covers the problem, the fix, proof of fix, validation, and related issues. It follows the template's main sections (Summary, Validation, Tests Added Or Updated via the updated test fil…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Tests For Production Code
The PR changes production code in open-sse/services/combo/comboAttemptLoop.ts. It also updates tests/unit/combo-loop-safety-timer-cleanup.test.ts with retry-timer tracking and regression tests for…
No Ai Attribution
PASS. All three reviewed commits have no trailers, and no commit message contains a Co-Authored-By trailer or a Generated with footer. The authored PR body also contains neither prohibited attribu…
Full details: Title check
Explanation
The title follows the Conventional Commits form fix(combo): ... with an allowed type. It names the main change: set-retry waits now cancel promptly, which matches the comboAttemptLoop.ts change that routes the set-retry delay through the cancellation-aware wait helper.
Full details: Description check
Explanation
The description covers the problem, the fix, proof of fix, validation, and related issues. It follows the template's main sections (Summary, Validation, Tests Added Or Updated via the updated test file, Target Branch via the stated release base). Gaps: the Related Issues section does not use the Closes # or Related to # format, and the Target Branch checklist is not ticked. The Coverage Notes and Reviewer Notes sections are not addressed explicitly. The author states the target is release/v3.8.53, while the template requires the active release/v3.8.x branch, which the author should confirm.
Full details: Tests For Production Code
Explanation
The PR changes production code in open-sse/services/combo/comboAttemptLoop.ts. It also updates tests/unit/combo-loop-safety-timer-cleanup.test.ts with retry-timer tracking and regression tests for pre-abort, expired waits, and zero-delay cancellation.
Full details: No Ai Attribution
Explanation
PASS. All three reviewed commits have no trailers, and no commit message contains a Co-Authored-By trailer or a Generated with footer. The authored PR body also contains neither prohibited attribution.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
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
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.
With set retries enabled, cancellation just before the next retry wait can leave a request waiting for its entire configured delay before returning 499. A normally expired wait also leaves its abort listener attached to the request signal.
Reuse the existing cancellation-aware wait helper. Keep a timer turn for zero-delay retries so queued cancellation can run before another dispatch. Retry limits and the existing 499 response are preserved.
Proof of fix
Four regression scenarios fail on pristine
release/v3.8.53at6ecb2090and pass with the fix. They exercise the realhandleComboChathandler with synthetic upstream responses, covering cancellation before the wait and listener cleanup after success or exhaustion. Cancellation during a wait, dispatch counts and zero-delay behavior are also checked.Updated test:
tests/unit/combo-loop-safety-timer-cleanup.test.ts.Validation
Related: #17885 fixed separate loop-safety timers. This patch covers the delay between sets.
Target:
release/v3.8.53.