feat: add llm reflector - #51
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
📝 WalkthroughWalkthroughAdds ChangesReflection pipeline
API documentation
Sequence Diagram(s)sequenceDiagram
participant ToolRecovery
participant LlmReflector
participant ApiClient
participant ToolSchema
ToolRecovery->>LlmReflector: Analyze tool failure with schema
LlmReflector->>ApiClient: Request structured FailureAnalysis
ApiClient-->>LlmReflector: Return FailureAnalysis
LlmReflector->>ToolSchema: Validate modified_input when enabled
LlmReflector-->>ToolRecovery: Return analysis or error
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
CHANGELOG.md (1)
68-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse one spelling variant consistently.
This entry mixes “analysed” with the API’s “analyze”. Prefer “analyzed” throughout this changelog entry.
Also applies to: 85-94
🤖 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 `@CHANGELOG.md` around lines 68 - 81, Update the changelog entry describing LlmReflector so the spelling uses “analyzed” consistently, including the corresponding occurrence in the related entry range.Source: Linters/SAST tools
🤖 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/engine/bare/dispatch.rs`:
- Around line 1052-1060: Update the recovery reflection flow around
reflector.analyze to resolve the schema using the actually executed tool name
from result.resolved_tool_name rather than tc.tool. Use that resolved name to
look up the tool in self.tools, while preserving the existing analysis and
correction behavior.
In `@src/reflection/llm.rs`:
- Around line 147-150: Update build_user_message and its call site in the
surrounding reflection flow to accept the optional tool schema and include it in
the model prompt as a clearly delimited data field. Preserve schema cloning for
post-response validation while ensuring the model receives the same schema used
to validate input_fix generation.
- Around line 214-221: Move the schema_validation-disabled unused-variable
suppression in validate_modified_input to after the modified_input and schema
bindings are declared, or remove it if no longer needed. Ensure the function
compiles when schema_validation is disabled without referencing names before
their bindings.
---
Nitpick comments:
In `@CHANGELOG.md`:
- Around line 68-81: Update the changelog entry describing LlmReflector so the
spelling uses “analyzed” consistently, including the corresponding occurrence in
the related entry range.
🪄 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: 20878dd9-a68c-4f59-8bb2-48e9ee04e364
📒 Files selected for processing (7)
CHANGELOG.mdCargo.tomlREADME.mdsrc/engine/bare.rssrc/engine/bare/dispatch.rssrc/reflection.rssrc/reflection/llm.rs
No description provided.