Skip to content

chore: refine builders - #61

Merged
bobrykov merged 2 commits into
masterfrom
feat/builders-refinement
Jul 23, 2026
Merged

chore: refine builders#61
bobrykov merged 2 commits into
masterfrom
feat/builders-refinement

Conversation

@bobrykov

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bobrykov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 51b97438-a6fa-410d-b8c5-630e5b43b8f3

📥 Commits

Reviewing files that changed from the base of the PR and between 998f8c1 and 706d5f4.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/engine/bare.rs
  • src/structured.rs
  • src/tool/shield.rs
📝 Walkthrough

Walkthrough

The PR standardizes consuming builder methods under a with_ prefix, updates optional-field builders to accept Option<T>, adds fluent BareLoop configuration methods, renames pipeline and request-option APIs, and distinguishes empty from incomplete tool pipelines.

Changes

Builder API unification

Layer / File(s) Summary
Request and loop configuration builders
src/api.rs, src/config.rs, src/engine/bare/stream.rs, src/provider/grammar.rs
StreamRequest and LoopConfig use consistent with_* methods, with optional values passed as Option<T> and tests covering setting and clearing values.
BareLoop and related builders
src/engine/bare.rs, src/engine/loop_core.rs, src/hooks/builtin/auto_commit.rs, src/tool/shield.rs
Consuming BareLoop configuration methods are added, while model-switch, session-result, auto-commit, and Unix shield builder methods are renamed to with_*.
Tool pipeline builder and integrations
src/middleware.rs, src/middleware/*, src/presets.rs
Pipeline builder methods become with_middleware, with_middleware_arc, and with_core; untouched builds return Empty, while middleware-only builds return MissingCore.
Structured request options
src/structured.rs, src/presets.rs
RequestOptions methods become with_response_format and with_tool_constraint, with structured request construction and tests updated.
Migration documentation
CHANGELOG.md
The unreleased changelog documents new fluent builders, breaking renames, pipeline error distinctions, and optional-builder migration guidance.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the PR’s main theme of refining builder APIs across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 50.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/builders-refinement

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/engine/bare.rs (1)

1344-1353: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update Rustdoc references left behind by the builder renames.

  • src/engine/bare.rs#L1344-L1353: change the switch_model example at Line 917 from .context_window(8192) to .with_context_window(8192).
  • src/tool/shield.rs#L1020-L1059: update the field-doc links at Lines 960, 965, and 972 to with_warn_threshold, with_block_threshold, and with_pattern.
🤖 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/engine/bare.rs` around lines 1344 - 1353, The Rustdoc references still
use builder method names from before the renames. In src/engine/bare.rs lines
1344-1353, update the switch_model example to call with_context_window; in
src/tool/shield.rs lines 1020-1059, update the field-doc links to
with_warn_threshold, with_block_threshold, and with_pattern.
🤖 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 `@CHANGELOG.md`:
- Around line 194-195: The earlier “### Added” StreamRequest builder listing
still presents renamed methods as current API. Update that listing to use the
corresponding with_* builder names, keeping the documentation consistent with
the rename described in the later changelog entry.

In `@src/structured.rs`:
- Around line 297-300: Update the documentation in RequestOptions::new to
reference Self::with_response_format instead of Self::response_format, matching
the builder method shown in the diff. Leave the with_response_format
implementation unchanged.

---

Outside diff comments:
In `@src/engine/bare.rs`:
- Around line 1344-1353: The Rustdoc references still use builder method names
from before the renames. In src/engine/bare.rs lines 1344-1353, update the
switch_model example to call with_context_window; in src/tool/shield.rs lines
1020-1059, update the field-doc links to with_warn_threshold,
with_block_threshold, and with_pattern.
🪄 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: 75933b9c-93e5-42e8-b718-eb29fc31c34b

📥 Commits

Reviewing files that changed from the base of the PR and between 9074507 and 998f8c1.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • src/api.rs
  • src/config.rs
  • src/engine/bare.rs
  • src/engine/bare/stream.rs
  • src/engine/loop_core.rs
  • src/hooks/builtin/auto_commit.rs
  • src/middleware.rs
  • src/middleware/memoize.rs
  • src/middleware/output_limit.rs
  • src/middleware/unknown_tool.rs
  • src/middleware/verify.rs
  • src/presets.rs
  • src/provider/grammar.rs
  • src/structured.rs
  • src/tool/shield.rs

Comment thread CHANGELOG.md
Comment thread src/structured.rs
@bobrykov
bobrykov merged commit 6011a0f into master Jul 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant