Repository navigation
feat(serve): list pickable models, set the session model and thinking level - #967
Merged
Merged
Conversation
… level (#574) GET /models, POST /sessions/{id}/model and POST /sessions/{id}/effort write the fact/model and fact/reasoning_effort registers the TUI writes. The pickable list is the owner's (default model plus TOLE_MODELS); a request cannot name a provider URL or key.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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
Three routes behind the existing auth:
GET /models,POST /sessions/{id}/model {"model"}andPOST /sessions/{id}/effort {"effort": level|null}. Closes #574 (part of #523).Why
A graphical client has no model picker or thinking selector over
tole serve. Choosing a model also chooses what the token holder spends, and it is a durable register, so the server (the owner) must decide which models can be picked.Changes
serve/models.rs;serve.rsonly gets the route arms, oneStatefield and the module line.session_settings::write_model/set_effort), so thefact/modelandfact/reasoning_effortregisters are exactly what/modeland/thinkingwrite;tole resumereads them as before (session_model_e2e/session_effort_e2ecover that read).404unknown session,409while a turn runs (busy flag, thentry_lockon the turn lock, via the existingwith_idle_session),400for a bad value,401without the token (routes added tono_route_answers_without_a_valid_credential).TOLE_MODELS(the variable of the ACP picker), read at start-up. With noTOLE_MODELSonly the default can be picked. The provider's/modelsis NOT consulted, because it would let the token holder pick anything the key reaches. A request carries a model id only; it cannot name a provider URL or key, and an id outside the list (exact match) is a400.nullor"unset"clears the effort, an invalid level is a400, never coerced.docs/mobile-control.mdroute table andCHANGELOG.md(Added, Behavior Change) updated.Testing
cargo test -p tole-cli: 1606 passed, 0 failed.session_model/session_effort, default-only list.cargo fmt --all;cargo clippy -p tole-cli --all-targets -- -D warningsclean in default,--no-default-features, and--no-default-features --features shell-tools.