feat(backend): planner-selected model profile routing with fail-open fallback#199
feat(backend): planner-selected model profile routing with fail-open fallback#199
Conversation
… for planner-specific profile selection. Update .env.example and related backend services to support distinct planner and default response profiles. Refactor chat orchestrator and planner to utilize new profile options, ensuring improved flexibility and handling of profile IDs in message plans. Add tests to validate the integration of planner profiles in chat service operations.
…ation. Introduce `pnpm lint:fix` for local edits, `pnpm lint` for CI verification, and enhance formatting commands to operate on changed files. Clarify handling of files outside formatter coverage and establish PR readiness gates for significant changes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a planner-specific model profile (PLANNER_PROFILE_ID) and propagates planner-chosen profile IDs through planner and orchestrator logic, updates config/types, prompts schema, tests, and developer tooling/scripts for changed-file formatting and lint workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Orchestrator
participant ModelCatalog
participant Planner
participant PlannerRuntime as Planner Runtime
participant ResponseRuntime as Response Runtime
Client->>Orchestrator: Send chat request
Orchestrator->>ModelCatalog: Load enabledProfiles + plannerProfileId + defaultResponseProfile
Orchestrator->>Planner: Send request + availableProfiles (plannerProfile used)
Planner->>PlannerRuntime: Generate plan (uses plannerProfile provider/model)
PlannerRuntime-->>Planner: Return plan (may include profileId)
Planner-->>Orchestrator: Normalized plan (action, profileId)
Orchestrator->>Orchestrator: Resolve plan.profileId vs enabledProfiles
alt profileId valid
Orchestrator->>Orchestrator: Use selected response profile
else invalid/missing
Orchestrator->>Orchestrator: Warn and fallback to defaultResponseProfile
end
Orchestrator->>Orchestrator: If selected profile lacks search -> remove search (warn)
Orchestrator->>ResponseRuntime: Generate response using executionPlan + selected profile
ResponseRuntime-->>Orchestrator: Return response
Orchestrator-->>Client: Deliver final response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 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 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 |
…ate documentation to specify that profileId is required when action is 'message', ensuring clearer guidance for implementation.
…tibility across platforms. Introduce a dedicated runPrettier function to handle spawning processes, ensuring consistent behavior on Windows environments. Update comments for clarity and maintainability.
Adds planner profile selection for chat responses by introducing
profileIdin planner output andPLANNER_PROFILE_IDfor planner execution.The orchestrator now runs planner and response on separate profiles, validates planner-selected profile IDs against enabled catalog entries, and fails open to
DEFAULT_PROFILE_IDon invalid/disabled selections.Also adds bounded profile context to the planner prompt and no-op runtime seam prep (
GenerationRequest.userId?,GenerationResult.memoryRetrievals?) with no behavioral change outside profile routing.Intentionally deferred: Search-capability reroute policy (currently degrade by dropping search when selected profile can’t search).
Summary by CodeRabbit
New Features
Configuration
Improvements
Documentation & Tests