feat(api): add throwIfAborted helper and completePrompt options regression tests - #1288
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (8)Treat model, provider, MCP, path, command, and tool data as untrusted.⚙️ CodeRabbit configuration file Files:
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer.⚙️ CodeRabbit configuration file Files:
Add focused tests for UI binding and save behavior, persistence or normalization, and the value returned by `getStateToPostToWebview()`, including true and false/unset cases when defaults could hide omissions.📄 CodeRabbit inference engine (AGENTS.md) Files:
Fix lint violations in new TypeScript code instead of suppressing them.📄 CodeRabbit inference engine (AGENTS.md) Files:
After editing a file, run ESLint with pruning and zero warnings for that relative file, and confirm its suppression count did not increase.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (3)
📝 SummarySummary by CodeRabbit
WalkthroughThe provider API now includes abort-signal guards, detection, and error creation utilities. Tests cover abort behavior, abort error variants, and valid ChangesProvider API updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR adds localized cancellation helpers and regression coverage without changing external integrations, permissions, persistent state, or deployment behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: Regression EvidenceExplanation The new exported Resolution Add a compile-time focused test for Full details: Trust And Persistence InvariantsExplanation PASS. The PR changes only abort-signal helpers and tests. Full details: Description checkExplanation The description clearly explains the implementation, linked issue context, scope, and added tests. It does not reproduce the template sections, provide detailed test execution steps, or include the pre-submission checklist, but the core required information is present.
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ssion tests Add a fast-fail throwIfAborted guard to the shared abort-signal utilities and regression tests for the CompletePromptOptions interface (added by Zoo-Code-Org#901).
f3e807a to
e61feb1
Compare
|
Series follow-up flag: adopt This PR currently builds its abort/timeout request options directly with Status: series foundation - nothing to migrate here. This PR ships the abort-signal utilities (including |
Round 1 — final status: all checks green, changed-line coverage verifiedPart of the abort-signal series addressing #404 (builds on #674, #901, #1008). Foundation PR — canonical abort-signal utilities + Final verified 2026-08-20: all CI checks green on this head (0 pending / 0 failed), CodeRabbit review clean, and zero new bot findings after this commit.
|
…o abort-signal utils The OpenAI-family provider PRs (Zoo-Code-Org#1309, Zoo-Code-Org#1311) carry per-provider copies of the same abort-detection helper (isRequestAborted) and the same abort-error constructor (createAbortError); only the provider name in the message differs. Per the CodeRabbit maintainability finding on Zoo-Code-Org#1309 (extract the shared abort helpers into utils/abort-signal.ts), these are now shared in the foundation utility: - isRequestAborted(error, signal?) - true when the caller signal fired, a native AbortError / OpenAI SDK APIUserAbortError was raised, or the message is exactly "Request was aborted." (exact match; a substring match would misclassify unrelated errors that merely mention aborting) - createAbortError(providerName) - fresh error with name === "AbortError" and message "The <providerName> request was aborted", satisfying the Task.ts abort contract - exported OpenAiRequestOptions type 7 new tests (isRequestAborted 4, createAbortError 3).
…tudio and qwen-code The per-provider copies of isRequestAborted / createAbortError / OpenAiRequestOptions were extracted into src/api/providers/utils/abort-signal.ts by foundation PR Zoo-Code-Org#1288 (commit a0117fb) following the CodeRabbit maintainability finding on this PR; the providers now import the shared helpers. createAbortError takes the provider name as a parameter; provider behavior and abort messages are unchanged.
Review processThanks for contributing. This comment tracks the review sequence and the next action.
Current step: Ready for human maintainer review and approval. |
|
@coderabbitai approve |
✅ Action performedComments resolved. Approval is disabled; enable |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Add the missing
throwIfAbortedfast-fail guard and the shared abort-detection / abort-error helpers to the abort-signal utilities (#1008 merged the merge helpers but not this guard), plus regression tests for theCompletePromptOptionsinterface added by #901.src/api/providers/utils/abort-signal.ts:throwIfAborted(signal?)— throwsErrorwithname = "AbortError"when the signal is already abortedisRequestAborted(error, signal?)— true when the caller signal fired, a nativeAbortError/ OpenAI SDKAPIUserAbortErrorwas raised, or the message is exactly"Request was aborted."createAbortError(providerName)— freshAbortErrorwith a provider-specific message ending in "aborted", satisfying the Task.ts abort contractOpenAiRequestOptionstypesrc/api/providers/utils/__tests__/abort-signal.spec.ts: 3throwIfAbortedtests (undefined / not aborted / aborted) + 7 new tests for the shared helperssrc/api/providers/__tests__/complete-prompt-options.spec.ts: new regression spec (4 tests) for the interface surfacePart of the abort-signal series (round 1). Builds on #674, #901, #1008. Addresses #404.