feat: connection pooling - #60
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughProvider builders now share HTTP client configuration, support injected ChangesProvider HTTP Configuration
Sequence Diagram(s)sequenceDiagram
participant Application
participant ProviderBuilder
participant HttpClientConfig
participant ReqwestClient
participant Provider
Application->>ProviderBuilder: configure with_* options
ProviderBuilder->>HttpClientConfig: pass HTTP settings or injected client
HttpClientConfig->>ReqwestClient: reuse client or build configured client
ReqwestClient->>Provider: provide HTTP transport
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
src/provider/anthropic.rs (1)
580-591: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftTriplicated HTTP-client-injection/pool/TCP config across all three provider builders. The new
http: Option<reqwest::Client>field, its four setters (http_client,pool_max_idle_per_host,pool_idle_timeout,tcp_keepalive), thetcp_nodelaydefault, thebuild()injection-vs-construct branch, and the full 5-test suite are copy-pasted verbatim across Anthropic, Gemini, and OpenAI builders. A shared helper (e.g. aHttpClientConfigstruct with abuild_http_client(self) -> Result<reqwest::Client, ApiError>method that each provider builder embeds/delegates to) would collapse this to one implementation and one test suite, so future knob additions need a single edit instead of three synchronized ones.
src/provider/anthropic.rs#L580-L591: extract thismatch self.http { ... }branch (plus the fields at L394-L425 and setters at L514-L566) into the shared helper.src/provider/gemini.rs#L639-L650: replace this identical branch (plus fields at L451-L482 and setters at L577-L629) with a call into the same shared helper.src/provider/openai.rs#L625-L636: replace this identical branch (plus fields at L452-L483 and setters at L560-L614) with a call into the same shared helper.🤖 Prompt for 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. In `@src/provider/anthropic.rs` around lines 580 - 591, The HTTP client configuration is duplicated across all provider builders. Extract the shared client field, default, setters, and construction logic into one reusable helper with a build method returning Result<reqwest::Client, ApiError>, then delegate from the Anthropic builder at src/provider/anthropic.rs:580-591, Gemini builder at src/provider/gemini.rs:639-650, and OpenAI builder at src/provider/openai.rs:625-636; consolidate the duplicated five-test suite alongside the helper and remove the provider-specific copies.
🤖 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.
Nitpick comments:
In `@src/provider/anthropic.rs`:
- Around line 580-591: The HTTP client configuration is duplicated across all
provider builders. Extract the shared client field, default, setters, and
construction logic into one reusable helper with a build method returning
Result<reqwest::Client, ApiError>, then delegate from the Anthropic builder at
src/provider/anthropic.rs:580-591, Gemini builder at
src/provider/gemini.rs:639-650, and OpenAI builder at
src/provider/openai.rs:625-636; consolidate the duplicated five-test suite
alongside the helper and remove the provider-specific copies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d9044b05-27de-477d-8eb8-cd9783c935cd
📒 Files selected for processing (5)
CHANGELOG.mdsrc/provider.rssrc/provider/anthropic.rssrc/provider/gemini.rssrc/provider/openai.rs
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/provider.rs`:
- Around line 215-224: Update the rustdoc link in the client-building
documentation to reference the existing with_http_client method instead of the
nonexistent http_client symbol. Leave the surrounding behavior and documentation
unchanged.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a76d81de-775c-461e-a918-357edc076969
📒 Files selected for processing (6)
CHANGELOG.mdexamples/chat.rssrc/provider.rssrc/provider/anthropic.rssrc/provider/gemini.rssrc/provider/openai.rs
No description provided.