Repository navigation
Studio: only offer Agent Skills when Code is on - #12118
Conversation
Skills discovered from ~/.agents/skills and ~/.claude/skills are enabled by default, so any installed skill opened the tool loop for read_skill even with every composer pill off, and Ask mode kept pausing for approval (#11671). Skills are instructions for running code, so the chat request now offers read_skill and create_skill only while Code is on. The token count follows the same rule so it matches the sent request.
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. |
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24029adb0a
ℹ️ 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 hasEnabledSkills = skillToolsOffered( | ||
| getSkillsSnapshot().skills, | ||
| codeToolsEnabled, |
There was a problem hiding this comment.
Skip skill discovery when Code is off
When Code is off, this returns false only after the preceding unconditional settleSkillsForText(...) has completed. An uninitialized or stale skills catalog—especially an unknown @skill mention—can therefore still delay an all-tools-off send by the full 3-second settlement timeout even though no skill tool can enter the payload; buildLocalTokenCountExtras has the same ordering. Guard both settlement calls with the effective Code state so disabling Code also removes this otherwise-unused request-path latency.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Latency only and unchanged by this PR: the settle ran before this change too, and no payload is wrong. Leaving the discovery path as is.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
Skills discovered from ~/.agents/skills and ~/.claude/skills are enabled by default, so any installed skill opened the tool loop for read_skill even with every composer pill off, and Ask mode kept pausing for approval (unslothai#11671). The chat request now offers read_skill and create_skill only while Code is on, and the token count follows the same rule.
Summary
Agent Skills are discovered from
~/.agents/skillsand~/.claude/skillsand are enabled by default. Other tools install skills there, for examplehf skills addwrites anhf-cliskill whose description asks to be used for anything related to Hugging Face or ML. Any enabled skill opened the Unsloth tool loop withread_skill, so a chat with every composer pill off (Search, Code, MCP, Docs, Artifacts, Research) was still offered a tool, and in Ask mode it kept pausing for approval. This is the behaviour reported in #11671.Skills are instructions for running code, so they now follow the Code pill. The chat request offers
read_skillandcreate_skillonly while Code is on (the Code pill, or Full access where code is implied).Changes
studio/frontend/src/features/chat/api/skill-tools.ts: newskillToolsOffered(skills, codeToolsOn).studio/frontend/src/features/chat/api/chat-adapter.ts: the completion payload and the token-count extras both use it, so the counted prompt still matches the sent one.tests/skill-tools.test.tscovers the rule,tests/skills-token-count-discovery.test.tspins both call sites.Behaviour
read_skill, Ask mode promptsread_skillofferedNo backend change: the backend already drops skill tools that the request does not list in
enabled_tools.Testing
node --experimental-strip-types --test tests/skill-tools.test.ts tests/skills-token-count-discovery.test.ts tests/code-tool-placement.test.tspasses 21/21.tauri-backend-transport-failure.test.ts, a timing ladder) passes 3/3 when rerun alone and is not touched here.tsc -bpasses. ESLint onchat-adapter.tsreports the same 16 existing errors on main and on this branch.Related: #11671, #11787.
Before / after
Studio built from the merge base (left) and from this branch (right). Both have the
hf-cliskill thathf skills addinstalls in~/.agents/skills, Qwen3-0.6B GGUF loaded, Ask mode, Search and Code off, and the same prompt.enable_tools: trueandenabled_tools: ["read_skill", "create_skill"], and it stops on an approval prompt forread_skill.enable_tools: falseand the model answers directly.read_skill,create_skill,python,terminalandedit_file.