Fix/docs consistency - #67
Conversation
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughChangesThe PR updates retry, API, and machine-state documentation. It adds a parallel-dispatch regression test for retry observer notifications and records the changes in Retry documentation and validation
Possibly related PRs
🚥 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 (3)
src/engine/bare/dispatch.rs (3)
1500-1528: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the repeated
AlwaysRecoverablereflector into a shared test helper.This struct definition duplicates the identical
AlwaysRecoverablealready defined at Line 1405 (recovery_backoff_cancelled_promptly) and again at Line 1611 (execute_tool_call_runs_recovery_on_failure). Three identical copies now exist in this test module. Extract one module-levelAlwaysRecoverableand reuse it across the three tests to reduce duplication.🤖 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/dispatch.rs` around lines 1500 - 1528, Extract the identical AlwaysRecoverable implementation from the affected test into a single module-level test helper, then remove the duplicate definitions in recovery_backoff_cancelled_promptly and execute_tool_call_runs_recovery_on_failure so all three tests reuse that shared reflector.
1589-1590: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDiscarding the dispatch result with
.ok()hides unexpected hard failures.
bare.dispatch_tools(&calls, 0).await.ok()silently swallows anyErr(for example an unexpectedLoopError::Cancelledor a dispatch bug). If dispatch fails for a reason unrelated to the retry logic, the test would still proceed to the count assertions, which could produce a confusing failure message instead of a clear one pointing at the actual dispatch error.🤖 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/dispatch.rs` around lines 1589 - 1590, Update the test call to bare.dispatch_tools(&calls, 0).await so unexpected dispatch errors are propagated or explicitly asserted, rather than converted to None with .ok(). Preserve the test’s intended handling of the expected error_tool outcome while ensuring failures such as LoopError::Cancelled surface directly from the dispatch operation.
1486-1603: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTighten the assertion to the exact deterministic attempt count.
RetryTwice::decideretries whileattempt < 2and skips atattempt == 2. Combined with the loop inexecute_tool_call, this setup deterministically produces exactly 3 full attempts (2 retries + 1 skip), matching the comment at Line 1530: "Retry the first two attempts, then give up with a soft error." The assertion at Line 1594 only checkspres >= 2 && posts >= 2. This under-verifies the contract: a regression that drops one attempt (2 instead of 3) would still pass this test.Use
assert_eq!(pres, 3)andassert_eq!(posts, 3)to pin the exact, deterministic value.♻️ Proposed tightening
- let pres = pre_count.load(Ordering::Relaxed); - let posts = post_count.load(Ordering::Relaxed); - assert!( - pres >= 2 && posts >= 2, - "parallel retried call must fire side-effects per attempt; got pre={pres} post={posts}" - ); - assert_eq!( - pres, posts, - "every PRE must have a matching POST (pairing invariant)" - ); + let pres = pre_count.load(Ordering::Relaxed); + let posts = post_count.load(Ordering::Relaxed); + assert_eq!( + pres, 3, + "expected exactly 3 attempts (2 retries + 1 skip); got pre={pres}" + ); + assert_eq!( + pres, posts, + "every PRE must have a matching POST (pairing invariant)" + );🤖 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/dispatch.rs` around lines 1486 - 1603, In parallel_retried_call_fires_side_effects_per_attempt, replace the lower-bound assertion on pre_count and post_count with exact assertions that both pres and posts equal 3, matching RetryTwice’s two retries followed by the final skipped attempt. Preserve the existing PRE/POST pairing assertion.
🤖 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/engine/bare/dispatch.rs`:
- Around line 1500-1528: Extract the identical AlwaysRecoverable implementation
from the affected test into a single module-level test helper, then remove the
duplicate definitions in recovery_backoff_cancelled_promptly and
execute_tool_call_runs_recovery_on_failure so all three tests reuse that shared
reflector.
- Around line 1589-1590: Update the test call to bare.dispatch_tools(&calls,
0).await so unexpected dispatch errors are propagated or explicitly asserted,
rather than converted to None with .ok(). Preserve the test’s intended handling
of the expected error_tool outcome while ensuring failures such as
LoopError::Cancelled surface directly from the dispatch operation.
- Around line 1486-1603: In
parallel_retried_call_fires_side_effects_per_attempt, replace the lower-bound
assertion on pre_count and post_count with exact assertions that both pres and
posts equal 3, matching RetryTwice’s two retries followed by the final skipped
attempt. Preserve the existing PRE/POST pairing assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: caf12f07-4069-486b-a1b2-6e184432ddc1
📒 Files selected for processing (5)
CHANGELOG.mdsrc/api.rssrc/config.rssrc/engine/bare.rssrc/engine/bare/dispatch.rs
1eca460 to
29ff20b
Compare
No description provided.