Repository navigation
Studio: Skills pill stays with every skill unticked; its X or the + menu turns Skills off - #13687
Conversation
…enu turns Skills off
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3a236059f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const skillsForTools = () => | ||
| useSkillsSwitchStore.getState().on === false ? [] : getSkillsSnapshot().skills; |
There was a problem hiding this comment.
Snapshot the Skills switch for queued sends
When a prompt is queued or waits for model loading, the adapter deliberately uses snapshotQueuedChatRunSettings so later composer changes cannot alter that turn, but this helper bypasses the captured runtime and reads the live global switch during payload construction. Because changing this new store also does not advance queuedSettingsEpoch, toggling Skills while a queued prompt is waiting silently changes whether that already-queued turn receives skill tools; capture the switch with the other queued settings instead of reading it live here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: which skills are ticked is already read live from the skills snapshot when a queued turn's payload is built, so the switch behaves the same as ticking or unticking a skill during that wait.
| persist((set) => ({ on: null, setOn: (on) => set({ on }) }), { | ||
| name: "unsloth_chat_skills_on", |
There was a problem hiding this comment.
Recount context usage when toggling Skills
With a local model loaded and at least one enabled skill, using the pill X or the + menu only calls this setter. The request and token-count builders now honor the switch, but no context-usage invalidation or recount is triggered, so the displayed token usage continues including—or excluding—the skill tool schema until some unrelated event causes another count. The setter should trigger the same context refresh performed after changing an individual skill.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: toggling Search, Code or MCP does not recount either; the bar keeps the last exact count until the next turn, and the switch follows that.
| persist((set) => ({ on: null, setOn: (on) => set({ on }) }), { | ||
| name: "unsloth_chat_skills_on", | ||
| }), |
There was a problem hiding this comment.
Clear the Skills switch during preference reset
The new persisted key is not included in GeneralTab's PREFS_KEYS, even though that list backs “Reset all local preferences.” After a user explicitly turns Skills on or off, running that reset and reloading leaves unsloth_chat_skills_on intact, so the composer does not return to the unset/default behavior advertised by the reset. Add this key to the reset list alongside the other chat preferences.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: the switch is composer state like MCP's per-chat on/off key (unsloth_chat_mcp_enabled), which is also not in PREFS_KEYS.
| const skillTools = skillToolNames( | ||
| getSkillsSnapshot().skills, | ||
| skillsForTools(), | ||
| codeToolsEnabled, | ||
| userTexts(outboundMessages), |
There was a problem hiding this comment.
Explicitly filter skill tools when Skills is off
When Skills is off and no other composer tool is selected, skillsForTools() makes skillTools empty, causing the local request branch to omit both enable_tools and enabled_tools. On a server whose launcher default or --enable-tools policy enables tools, _effective_enable_tools treats that omission as tools-on and _select_request_tools treats the absent allow-list as the full catalog, re-adding read_skill/create_skill for enabled skills. Thus the switch still exposes skill tools in this common configuration; the request must explicitly exclude them rather than relying on an omitted tool block.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not reproducible: with no tool selected the local branch sends an explicit enable_tools: false, not an omitted block, and --enable-tools outranking that is the intended operator override for every UI-off tool. With other tools on, enabled_tools is an explicit list without the skill tools.
…g the last skill keeps the pill
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 282619ffe8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Ticking a skill means using it, so it switches Skills back on. | ||
| if (updated.enabled) { | ||
| useSkillsSwitchStore.getState().setOn(true); |
There was a problem hiding this comment.
Preserve a later Skills-off action during enable requests
When enabling a skill takes long enough for the user to close the skill menu and click the pill's X, that later action sets the switch to false, but the successful request then unconditionally writes true here and turns Skills back on. This makes network completion order override the user's most recent explicit choice; only apply the automatic enable if the switch has not changed since the request began.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: it needs the X clicked after closing the menu but before a local PUT returns, which is not a real session path; the switch follows the latest completed skill change.
… while Skills is off
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Two failures, both from this PR. Main passes both checks, and this branch merged into current main reproduces the first locally (5 failed, 9 passed vs 14 passed on main). 1. The app itself is fine: 2.
|
#13687 added the Skills switch's Turn off skills label in en only, so the strict overlay check in Frontend CI fails with it missing from all 13.
…earch contract, zoo 2026.10.5 scan baseline (#13701) * Studio i18n: move the Italian rewind filesNotRestored string into rewind #13676 added it under settings.data.library, so the overlay parity check in Frontend CI fails with an overlay key missing from en. * Tests: lift arrow-function consts like functions in the node harness resolver #13687 added const skillsForTools = () => ..., which reads the zustand Skills switch store. The resolver treated it as an eagerly evaluated const and dropped it because the store cannot be lifted, so the token count parity harness failed with ReferenceError: skillsForTools is not defined. An arrow or function expression reads its references only when called. The parity harness also gets a stand-in Skills switch store. * Baseline the unsloth-zoo 2026.10.5 findings after review Five pinned zoo sites moved digest in 2026.10.5. Four have the same matched code; speculative.py adds two mx.eval calls (MLX array evaluation). The rest of each file's 2026.10.4 to 2026.10.5 diff adds no network, exec or process code. * Studio i18n: translate skills.turnOff in every overlay #13687 added the Skills switch's Turn off skills label in en only, so the strict overlay check in Frontend CI fails with it missing from all 13. * Tests: follow the keyed + menu in the deep research contract #13679 builds the chat + menu from a keyed list, so the one-shot gate is now deepResearch: researchAvailable ? ( ... ) : null. * Tests: shorten the deep research contract comment
Summary
Unticking the last skill in the composer's Skills pill removed the pill from the toolbar, so there was no way back without going through the + menu's Manage skills dialog. Skills now has its own on/off switch, the way MCP does.
read_skill/create_skill), whatever is ticked.unsloth_chat_skills_on) is unset until first used, and unset follows whether any skill is ticked, exactly as before. Any skill change first pins an unset switch to its current value, so unticking or deleting the last skill on an existing install keeps the pill too. Reset to defaults returns the switch to unset.@no longer offers skills in either composer, since no skill would load.Verification
npm run typecheck,npm test(12076 pass),npm run build. New:skills-switch-pin.test.tsruns the real skills API against a stubbed server for the untick, reset and bulk paths (the reset case fails on the earlier commit), plus pill, + menu, adapter and mention-gate checks inskills-composer-pill.test.ts.Not tested here: a model call with Skills off (no model loads on this CPU host). The request side is covered by the adapter change and its test.
Screenshots
Skills on with every skill unticked: the pill stays, greyed.
Hovering the pill: its icon becomes the X that turns Skills off.