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 (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (7)
🧰 Additional context used📓 Path-based instructions (5)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:
🔇 Additional comments (1)
📝 SummarySummary by CodeRabbit
WalkthroughThe provider API now includes abort-signal guards, detection, and error creation utilities. Tests cover abort behavior and valid ChangesProvider API updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The abort-signal utility regression coverage is strengthened without introducing an identified runtime or API risk. The change is ready to merge. 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 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 |
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 statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Awaiting fresh human maintainer or CODEOWNER approval. Automated review is complete for the latest commit but does not replace human approval. Review-state labels are managed by this workflow; do not edit them manually. |
|
@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. |
bypassed review - will update ci
The mutation-diff gate reports a surviving StringLiteral mutant on the throwIfAborted message literal. Assert the exact message so a blanked literal fails the suite.
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.