Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 0 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughImplements a policy-driven, deterministic ranking for search-capable fallback profiles, adds selection-source policies to control reroute vs skip, propagates policy-derived reason codes into tool execution metadata, and updates types/schemas and tests to accept these reason codes. Changes
Sequence DiagramsequenceDiagram
participant Orchestrator as Chat Orchestrator
participant Ranker as Profile Ranker
participant PolicyMap as SelectionSource Policy
participant SearchExec as Search Executor
participant Metadata as Metadata Builder
Orchestrator->>Ranker: compute ranked search-capable fallbacks\n(exclude selected profile)
Ranker-->>Orchestrator: rankedFallbackCandidates
Orchestrator->>PolicyMap: query policy for selection source\n(allowReroute, rerouteCode, skipCode)
PolicyMap-->>Orchestrator: policyDecision
alt allowReroute == true
Orchestrator->>SearchExec: execute search on top-ranked fallback
SearchExec-->>Orchestrator: search results
Orchestrator->>Metadata: set toolExecutionContext\n(status: executed, reasonCode: rerouteCode)
else allowReroute == false
Orchestrator->>Metadata: remove search from generation\nset toolExecutionContext\n(status: skipped, reasonCode: skipCode)
end
Metadata-->>Orchestrator: updated execution context
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
This PR introduces deterministic, policy-driven fallback behavior when the selected response profile cannot execute requested search/tool behavior, and makes fallback outcomes auditable through stable execution reason codes.
What Changed
plannersource can reroute to a tool-capable fallback profile.requestanddefaultsources do not reroute and instead skip search deterministically.search_rerouted_to_fallback_profilesearch_reroute_not_permitted_by_selection_sourcesearch_reroute_no_tool_capable_fallback_availableWhy
The existing behavior depended on implicit first-match fallback, which could be surprising and harder to review in traces. This change makes fallback decisions intentional, deterministic, and explainable in both logs and execution metadata, while preserving fail-open behavior and keeping web/Discord behavior consistent through the shared backend orchestration path.
Important Implementation Details
chatOrchestratorand keyed by selection source (request|planner|default).chatServicefor skip decisions, and reroute reason codes are retained when runtime confirms tool execution.ResponseMetadataschema now allowsreasonCodeonexecutedevents for policy-audit cases.This PR was written using Vibe Kanban
Summary by CodeRabbit
New Features
Tests