Repository navigation
feat(serve): server sessions load approved skills - #968
Merged
Merged
Conversation
A new serve, acp or MCP-over-HTTP session runs the shared apply_skills over its workspace: approved skills only (#591), the index appended to the pinned prompt, load_skill registered ReadOnly. --skill/--no-skills are process-level owner choices accepted by serve and acp; no request field reaches skills. Resume keeps the stored prompt (#945 capability 3, #941).
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
…es, require startup skills choice A skill file named by the project config is not content-bound, so serve and acp refuse it (the flag, TOLE_SKILL, a profile and the user config stay allowed). Explicit skill files are checked at startup and at each session creation (regular file, size and body caps). Opening a server session before the skills choice is set is an error.
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 3 of #945 (step 4 of #941): a new
tole serve,tole acpor MCP-over-HTTP session loads skills through the sharedapply_skills, astole chatdoes.Why
The desktop client and chat gateway talked to a differently behaving agent than the CLI in the same repository. The owner gave the explicit go for skills. Security rules: approved skills only (#591), discovered in the session workspace, nothing skill-related from a request.
Why
serve/acpused to refuse--skill/--no-skills: they loaded no skills, so the flags had no effect and were refused loudly. Now that they load skills the owner's choice applies, except for one source: askillfile named by the PROJECT config sits inside the served repository, and the config trust binds the config's bytes, not the skill file's, so a latergit pullwould change what loads into every new session with no approval. That source stays refused on server faces.Changes
session/assemble.rs:ServerSkills(process-level--skillfiles and--no-skills) built by a validatingServerSkills::new;validate_explicit_skill(regular file, never a FIFO, at most 1 MiB, UTF-8, valid skill, body at most 16 KiB) runs at startup and again at each session creation. The CLI loop is unchanged.server_session_skillscallsapply_skills.session/host.rs: a NEW session appends the skills sections to its pinned prompt and registersload_skill(ReadOnly), before the session file exists.resumekeeps the stored prompt (append-only); only a session whose pinned prompt already holds the skills index getsload_skillback.set_server_skillsis set once at startup; opening a session before that is an error (not a silent default that could lose--no-skills).SessionOverridesand the routes gain no skill input.main.rs:serveandacpaccept--skill,TOLE_SKILL, a profile's skills, the user config'sskill, andno_skillsfrom any source; a bad explicit file fails startup naming the file. Askillfrom the PROJECT config is refused with the config hint.mcpandmissionstill refuse both, unchanged.docs/faces.md: skills row is one path.docs/threat-model.md: a note on server sessions and why the project layer stays refused. CHANGELOG### Changed, as a Behavior change.face_parityruns the CLI'sapply_skillson the CLI side (the compared prompt includes the skills sections);load_skill/skill_searchare machine dependent likeuteke_*.Testing
load_skill; unapproved, revoked and changed skills do not load; a skill outside the workspace is not discovered;--no-skillsloads none; explicit skills append; resume of an old session adds nothing; overrides carry no skill input.no_skillsdoes not read files; a file gone bad after startup fails session creation.config_sensitive: project-configskillrefused on serve and acp (restored, narrowed to the project config); flag,TOLE_SKILLand user configskillpass the face check on both (they reach the startup validation). The mcp and mission refusals are unchanged; theTOLE_SKILLrefusal test usestole mcp.serveunit tests,session_tools,face_parity) now set the skills choice first, as the entrypoint does.cargo test -p tole-cli --no-fail-fast(all results ok) and assemble_golden + face_parity with--no-default-features --features shell-toolspass.