fix(providers): bound non-streaming response body reads - #320
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📓 Path-based instructions (4)All LLM providers must implement the `Provider` interface from `src/types.ts`; new providers must be registered in `BUILTIN_PROVIDERS` and wired through `createProvider()`.📄 CodeRabbit inference engine (AGENTS.md) Files:
Use Node.js built-in `node:test` and `node:assert/strict`; do not use Jest or Mocha.📄 CodeRabbit inference engine (AGENTS.md) Files:
Library code must throw errors directly; command handlers should catch errors and display them through `outro(pc.red(...))`.📄 CodeRabbit inference engine (AGENTS.md) Files:
Use ESM imports with `.js` extensions for local modules, and use `import type` for type-only imports.📄 CodeRabbit inference engine (AGENTS.md) Files:
🪛 GitHub Actions: CI / 0_Test (ubuntu-latest).txtsrc/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. 🪛 GitHub Actions: CI / 1_Test (macos-latest).txtsrc/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. 🪛 GitHub Actions: CI / 2_Test (windows-latest).txtsrc/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. 🪛 GitHub Actions: CI / Test (macos-latest)src/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. 🪛 GitHub Actions: CI / Test (ubuntu-latest)src/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues. 🪛 GitHub Actions: CI / Test (windows-latest)src/providers/openai-compatible.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write src/providers/openai-compatible.ts' to fix code style issues. src/providers/anthropic.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write src/providers/anthropic.ts' to fix code style issues. src/providers/cohere.ts[error] 1-1: Prettier formatting check failed. Run 'prettier --write src/providers/cohere.ts' to fix code style issues. 🔇 Additional comments (6)
📝 WalkthroughWalkthroughProvider completion and model-discovery requests now apply timeouts while reading response bodies. Shared helpers abort stalled reads and cancel streams. Tests cover all affected providers and verify timeout errors and cancellation. ChangesProvider body timeout handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Non-streaming provider responses now have bounded body reads and stream cancellation, preventing indefinite hangs. The supplied coverage spans completion and model-discovery paths, so the change is mergeable with normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
A rabbit reads the stream with care Comment |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
452bc01 to
9e2f2ac
Compare
|



Summary
Closes #304.
Note: the local test suite could not be executed in this environment because outbound access to github.com is unavailable; the deterministic regression tests are included for CI verification.
Summary by CodeRabbit
Bug Fixes
Tests