Repository navigation
feat(serve): route the model of a new server session - #971
Merged
Merged
Conversation
| false, | ||
| None, | ||
| ) | ||
| .map_err(|e| e.to_string()) |
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
Contributor
Author
|
Cora's finding on Generated by Claude Code |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Capability 2 of #945 (step 4 of epic #941): model routing (#586) for server sessions (
tole serve,tole acp, MCP session tools).Why
Routing was CLI-only (a
drift #945row in docs/faces.md). A server session has no prompt at creation, so it must be routed at its first prompt, with the CLI's semantics.Changes
session/host.rs:run_session_turn_detailed(the one path serve, acp and the MCP session tools share) calls the existingassemble::route_sessiononce, at the first prompt of a new session, before any provider call. Skipped when the session already has a model (a profile's, orfact/modelset by the client throughPOST /sessions/{id}/model) and for a resumed session (first_prompt_donestarts true). The owner's user config is read at that point; a request cannot add tiers or rules or enable routing. A router error or a user config that no longer loads fails that prompt, redacted, before any provider call.fact/modeland the redactedfact/routechange.tests/serve_routing_e2e.rs.Testing
tole serve): off by default, first prompt routed withfact/routerecorded, same tools with and without a route, second prompt not re-routed, client-set model not overridden, resume not re-routed, broken router errors before any provider call, error redaction.cargo fmt --all; clippy-D warningsin the default,--no-default-featuresand--no-default-features --features shell-toolsprofiles; fullcargo test -p tole-cli(1634 passed, 0 failed); face_parity also checked to still fail on a temporary mutation of a docs row (reverted).