Skip to content

feat(serve): server sessions load approved skills - #968

Merged
ajianaz merged 2 commits into
developfrom
feat/server-skills
Nov 19, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/server-skills

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Capability 3 of #945 (step 4 of #941): a new tole serve, tole acp or MCP-over-HTTP session loads skills through the shared apply_skills, as tole chat does.

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/acp used 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: a skill file 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 later git pull would change what loads into every new session with no approval. That source stays refused on server faces.

Changes

  • session/assemble.rs: ServerSkills (process-level --skill files and --no-skills) built by a validating ServerSkills::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_skills calls apply_skills.
  • session/host.rs: a NEW session appends the skills sections to its pinned prompt and registers load_skill (ReadOnly), before the session file exists. resume keeps the stored prompt (append-only); only a session whose pinned prompt already holds the skills index gets load_skill back. set_server_skills is set once at startup; opening a session before that is an error (not a silent default that could lose --no-skills). SessionOverrides and the routes gain no skill input.
  • main.rs: serve and acp accept --skill, TOLE_SKILL, a profile's skills, the user config's skill, and no_skills from any source; a bad explicit file fails startup naming the file. A skill from the PROJECT config is refused with the config hint. mcp and mission still 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_parity runs the CLI's apply_skills on the CLI side (the compared prompt includes the skills sections); load_skill/skill_search are machine dependent like uteke_*.

Testing

  • Host tests: approved loads into the pinned prompt and registers load_skill; unapproved, revoked and changed skills do not load; a skill outside the workspace is not discovered; --no-skills loads none; explicit skills append; resume of an old session adds nothing; overrides carry no skill input.
  • Explicit file tests: a valid file passes; oversized file, body over the cap, FIFO, directory, missing and invalid files each fail startup with the file and reason; no_skills does not read files; a file gone bad after startup fails session creation.
  • config_sensitive: project-config skill refused on serve and acp (restored, narrowed to the project config); flag, TOLE_SKILL and user config skill pass the face check on both (they reach the startup validation). The mcp and mission refusals are unchanged; the TOLE_SKILL refusal test uses tole mcp.
  • Existing tests that open server sessions in-process (serve unit tests, session_tools, face_parity) now set the skills choice first, as the entrypoint does.
  • face_parity mutation (a stray prompt line on server sessions) fails the test, then reverted.
  • fmt, clippy (3 profiles), full cargo test -p tole-cli --no-fail-fast (all results ok) and assemble_golden + face_parity with --no-default-features --features shell-tools pass.

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).
@github-actions

Copy link
Copy Markdown

🔍 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.
@ajianaz
ajianaz merged commit c036340 into develop Nov 19, 2026
23 checks passed
@ajianaz
ajianaz deleted the feat/server-skills branch November 20, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant