Repository navigation
feat(serve): choose a profile per session on create and resume (#740) - #885
Merged
Merged
Conversation
A request's optional profile selects a [profiles.<name>] table of the user config for one session: persona, allow list, memory room and model. The choice is fixed for the live session, wins over the recorded one on resume and is recorded as a fact/profile register. memory_room in a request is refused.
…ts (#740) A recorded profile with a malformed name, or a log that cannot be read to look for one, is now a 409 or 500 asking for an explicit profile instead of resuming under the daemon defaults. GET /sessions adds the profile key only when set. Docs say child agents, the advisor and the router use the daemon model, and that a resume takes persona and model from the effective profile.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 17, 2026
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
tole serveaccepts an optionalprofileonPOST /sessions, for create and for resume. It selects one[profiles.<name>]table of the user config for that session: persona, allow list, memory room and model. A session withoutprofileis exactly as before.Refs #740 (two items remain: the
tole sessions listprofile column and thetole doctorserve-profiles line).Why
One daemon should host several personas (#740). Owner decisions of 2026-11-16:
fact/profileregister; nothing is mutated).[profiles.*]has no budget field today, so none was invented; the server's existing budget logic applies.memory_room: it is refused with a 400, create and resume. The room comes from the profile only.Allow list precedence (the same rule
--profilehas on the CLI, fromconfig/apply.rs): an--allowflag on thetole servecommand line pins the daemon's list and the profile's allow is ignored, so a profile never widens it. Otherwise a profile that setsallowreplaces the daemon's config/env list, and one that sets none leaves it.--trustpresets are added in every case. Every approval still goes through the approval queue.Escalation analysis: selecting a profile needs the existing bearer token, and no auth is added here. A token holder may pick any user-config profile, including the widest one. That is acceptable under the current model, because the token already grants approval authority; per-profile authorization waits for #742. Only the user config is read (a project config cannot define profiles), and it is re-read on every selection. Profile names are validated to
[a-z0-9_-]{1,64}before any lookup, so a hostile name never reaches a message, path or log.Residuals: skills, grants, the advisor, the router and child agents stay process-wide on this face. Child agents, the advisor and the router use the daemon's model, because
tool_roster.rsstill reads the global provider config. Not done from the issue: thetole sessions listprofile column and thetole doctorserve-profiles line.Changes
serve_support/profiles.rs(new): profile selection from the user config, the allow precedence, the memory-room mapping, and the register helpers.serve.rs: parsesprofile, refusesmemory_room, reconciles on resume, and records the profile.GET /sessionsshowsprofileonly when set.session/host.rs:SessionOverridesandopen_session_with(open_sessionis a wrapper, so ACP and MCP are unchanged); a per-session pinned model.main.rs: passes the user config path (none under--no-config), the daemon allow list, trust presets and whether--allowwas a flag.docs/mobile-control.md(Session profiles),CHANGELOG.md,README.md,docs/epics.md([PLAN] serve: per-session profile on POST /sessions (+resume) — enabler personal fleet #740 leaves the parked table).Testing
crates/tole-cli/tests/serve_profile_e2e.rs, plus unit tests. They cover:utekelog)profile(list shape included)memory_roomrefusedwrite_filecall, and the--allowpinmemory_roomaccepted--allownot pinningcargo fmt --allis clean. Clippy with-D warningsis clean for the workspace (all features) and for--no-default-featureswith and withoutshell-tools.cargo check -p tole-core --no-default-features --testsandcargo check -p tole-cli --no-default-featurespass. Tests pass in the default,--no-default-featuresandshell-tools-only profiles withTOLE_REQUIRE_BWRAP=1 --no-fail-fast.corais not installed in the author's PATH andscripts/review-local.shneeds an LLM, socora review --staged --no-llmwas run before each commit with no issues. The CI Cora Review is the gate.