Skip to content

Studio: let @skill mentions work without Code and add bulk skill toggles - #13163

Merged
mahiatlinux merged 8 commits into
unslothai:mainfrom
Etherll:feat/studio-skills-autocomplete-and-toggles
Oct 10, 2026
Merged

mahiatlinux merged 8 commits into
unslothai:mainfrom
Etherll:feat/studio-skills-autocomplete-and-toggles

Conversation

@Etherll

@Etherll Etherll commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Skills in Unsloth Studio were tied to the Code tool. With Code off, the request sent enable_tools: false even when the message @mentioned a skill, so the skill was never loaded, and the @ suggestion list in the composer was hidden. The Code gate came from #12118, which only offers Agent Skills when Code is on to fix #11671: home-dir skills are on by default with no pill of their own, so a plain chat with Code off must not open the tool loop. #12538 added mention preloading and put the mention popover behind the same Code gate.

Changes:

  • With Code off, an @mention of an enabled skill anywhere in the thread now offers read_skill alone, so the backend preloads that skill's SKILL.md before generation. A plain message with Code off still sends enable_tools: false, so [Feature] Option to disable toolcalls #11671 stays fixed. create_skill writes files and still needs Code. Earlier turns count because the preloaded SKILL.md is not replayed, so a follow-up can read it again.
  • The @ suggestion list now shows whenever the model supports tools. Names that start with the query rank first, then names that contain it, then description matches. Tab accepts the highlighted skill as well as Enter.
  • When neither python nor terminal is offered, the skill catalog tip and the preloaded skill block tell the model that bundled scripts cannot run, that it must not claim to have run one, and that a script needs the Code tool in Unsloth Studio.
  • Manage skills has a new menu next to Refresh with Enable all, Disable all and Reset to defaults. Reset asks for confirmation, then clears every override so user and Claude skills are on and bundled skills are off, as on a fresh install.
  • New PUT /api/skills endpoint with body {"enabled": true | false | null} backs the menu. true/false set every valid, unshadowed skill on disk and keep overrides for skills not currently on disk. null drops all overrides. It returns the updated skill list.
  • The context-usage token count uses the same skill tool selection as the request, so read_skill is counted only when it would be sent.
  • Adds 7 new strings to all 14 locales.

Testing

Frontend (studio/frontend): npm test passed 11159/11159, npm run typecheck is clean, and npm run i18n:check reports parity across locales.

cd studio/frontend
npm test
npm run typecheck
npm run i18n:check

Backend (studio/backend): 648 passed.

cd studio/backend
python -m pytest tests/test_skills.py tests/test_explicit_skill_loading.py tests/test_skill_mention_semantics.py tests/test_anthropic_messages.py -q

End to end on CPU llama.cpp with Qwen3-4B-Instruct-2507 Q4_K_M, Code off, using a test skill named report-sentinel:

  • With this PR: a message with @report-sentinel sends enable_tools: true with enabled_tools: ["read_skill"]. A plain message sends enable_tools: false. The chat shows "Loaded report-sentinel · SKILL.md" and the reply follows the skill's instructions.
  • On main: the same @mention message sends enable_tools: false and the skill is never loaded.

Screenshots (light, dark, narrow) and the end-to-end chat follow in a comment.

With Code off, an @mention of an enabled skill now offers read_skill for that
thread, so the backend preloads its SKILL.md before generation. A plain chat
with Code off still sends enable_tools: false, which keeps unslothai#11671 fixed, and
create_skill stays with Code. The @ suggestion list now shows whenever the model
supports tools, ranks name prefixes first and accepts Tab as well as Enter.

When no local python or terminal tool is offered, the skill catalog tip and the
preloaded skill block tell the model that bundled scripts cannot run and need
the Code tool in Unsloth Studio.

Manage skills gets a menu with Enable all, Disable all and Reset to defaults,
backed by PUT /api/skills. Reset clears every override, back to how a fresh
install has it, and asks first.
@Etherll
Etherll requested a review from danielhanchen as a code owner October 9, 2026 20:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-09T20:09:26.887865Z d3463da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Tab only accepts an @ suggestion from the composer itself; the popover stays
open when focus moves, so Tab in another field used to rewrite the draft.

The frontend mention pattern now allows one trailing sentence mark, like the
backend preload, so a Code-off mention never opens the tool loop for a name the
backend will not load.

A bulk skill change no longer publishes its list after a sign-out or a newer
read, and a skill's own Enabled switch waits for the bulk change too. The
scripts note now points at the local Code tool, which also holds when Code runs
in the provider's sandbox.
A skills read that started during a bulk change no longer cancels it: the
change's own list is published and broadcast, and only a sign-out drops it.

With Code off, a skill name inside code, a blockquote or a quotation no longer
offers read_skill, matching the backend preload that treats it as literal text.
…t like the send

The Code-off gate no longer guesses which mentions are literal Markdown: the
approximation hid real mentions and could backtrack for seconds on pasted text.
A mention the backend treats as literal only opens the loop with read_skill.

The token count now settles the skills catalog with the counted user text, as
the send path does, so a skill made since page load is priced like the request.
…ng skill tools

The Code-off gate keeps read_skill offered for a skill mentioned in any earlier
turn, so the send and the count now settle the catalog against every user turn,
not only the latest one.
@Etherll

Etherll commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

With Code off, typing @ in the composer now lists the enabled skills, and a message that mentions one loads its SKILL.md before the model answers. A plain Code-off message still sends no tools. Manage skills also gets Enable all, Disable all and Reset to defaults.

What changed

  • Skills used to follow the Code pill, so with Code off the list was hidden and a mention never loaded. A mention of an enabled skill now offers only read_skill, which loads the skill before generation. create_skill and code execution still need Code, and the model is told a skill's scripts can't run without it.
  • There was no way to change every skill at once. A menu beside Refresh turns all skills on or off. Reset to defaults asks for confirmation, then restores the fresh-install state: your skills and Claude skills on, bundled skills off.
  • Follow-up fixes cover Tab accepting a suggestion from outside the composer, a bulk change losing its result to a concurrent refresh, and @ mentions with trailing punctuation that the backend never loads.

On d64b56d with Code off, Qwen3-4B-Instruct-2507 Q4_K_M (llama.cpp) on CPU received enabled_tools: ["read_skill"] for an @report-sentinel message, loaded the skill and followed it. On main the same message sent no tools and never loaded it. Frontend tests (11,160), typecheck and the skills backend tests (648) pass. Limits: the context meter doesn't price the preloaded SKILL.md (same on main for Code-on mentions), and a skill name inside code or quotes still offers read_skill without loading anything. "Frontend build + bundle sanity" (its Locale parity step) and "Core zoo" fail the same way on main.

Before: main 371da3d · After: PR head d64b56d

@ suggestions with Code off

Manage skills bulk menu

Reset confirmation and 420px layout

Code-off @mention loads the skill

@mahiatlinux mahiatlinux self-assigned this Oct 10, 2026
@mahiatlinux

Copy link
Copy Markdown
Contributor

Review and repair evidence

Reviewed the original contributor head d64b56da0962f37b989336935a99eedfbe2b52a9; the repaired source head is ae97f6a90cfec953ed4d317cb0c174c0aaea2a55.

Finding fixed

A per-skill toggle left other row switches active, so a second toggle or bulk mutation could overlap it. Since the server serializes writes but responses can publish out of order, the UI could finish on stale state. Commit 1e3b4faa88 disables every skill switch while any skill mutation is pending; ae97f6a90c is comment-only cleanup validated for AST/TypeScript equivalence. A negative mutation restoring the old row condition fails the new regression assertion (2 pass, 1 fail).

A/B and local verification

  • The merge base 371da3d3bb fails the expected Code-off mention probe ([] rather than ["read_skill"]) and has no bulk update function. Original head, repaired head, and prospective merge pass Code-off mention/plain-message/Code-on/earlier-turn behavior plus enable-all, disable-all, reset, and absent-override preservation.
  • Linux x86_64, Python 3.13.14: 648 focused backend tests pass on repaired head and again on a prospective merge with current main.
  • Node 26.8.2: the full frontend suite passes 11,160/11,160 on original and repaired heads. A prospective merge at 6105cb2d8f passes 11,180/11,180, typecheck, strict locale parity, and production build. After main advanced to 6ded031092, merge-tree stayed conflict-free and all 33 focused frontend skill tests plus all 648 focused backend tests passed. A final merge audit at 26de92cb72 remained conflict-free; its only overlap was additive locale keys, and the combined tree passes strict locale parity plus production/test TypeScript typechecks.
  • Four 2-million-character backend mention cases and two 5-million-character client token cases completed with correct no-match results; the client cases completed in 0.05s.
  • The external pre-commit failure is current-main breakage: a reproduced all-files run changes none of this PR's Python files and leaves only tests/version_compat/test_trl_loss_normalization_contract.py changed, independently introduced by version_compat tests: follow TRL 1.15's chunked_nll alias and GPU-only DPO scorer #13207. Main's own pre-commit push fails on the same revision.

UI evidence

pr_ui_diff.py used two isolated Studio installs and explicitly compared the original merge base 371da3d3bb with the exact repaired source head ae97f6a90c (not the prospective merge). With Code visibly off, BEFORE has no skill suggestion or bulk control; AFTER suggests report-sentinel and adds Skill actions with Enable all, Disable all, and Reset to defaults. The measured facts move code_off_suggestion_visible false -> true, bulk_actions_visible false -> true, and bulk_menu_items [] -> all three actions.

Code-off skill autocomplete, before and after

Bulk skill actions, before and after

CI and independent review

The original feature head passed CodeQL, Lint CI, and the composer compatibility matrix on Linux browsers, Windows browsers, macOS Safari, and macOS browsers. The two repair commits are covered by the full local suites, the focused mutation check, and the exact-head Chromium UI run above.

At evidence publication, GitHub's final-head workflows were queued behind a repository-wide backlog (more than 100 queued runs) with no completed Actions failure: Frontend CI, Backend CI, CodeQL, and Composer compatibility. The separate pre-commit failure is the demonstrated current-main failure noted above.

The staging mirror was tree-identical to upstream main plus repaired source head. Codex completed review with no findings.

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Ready to merge, all manually checked.

@mahiatlinux
mahiatlinux merged commit d50286c into unslothai:main Oct 10, 2026
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.

[Feature] Option to disable toolcalls

3 participants