Repository navigation
feat: honor disable-model-invocation in skill frontmatter - #31147
Conversation
… focusable and cover submit settlement
…t-skills/project-skills-dialog
…ts through refetches and handle deleted skills
…oject-skills/project-skills-details
… and toggle tests to the Details row PR
…downloads, toggles, refetches and deleted skills
…roject-skills/invocation-api
…tates the readOnly prop
…ll details after deletes and refresh after download 404s
…t-skills/project-skills-dialog
…oject-skills/project-skills-details
…permission check failures
…etail eviction and download 404 refreshes
…roject-skills/invocation-api
…state skill helpers
…t-skills/project-skills-dialog # Conflicts: # site/src/pages/AgentsPage/components/SkillsTable.tsx # site/src/pages/AgentsPage/components/SkillsTableView.tsx
…kill refetches on save and respect the skill cap
…oject-skills/project-skills-details # Conflicts: # site/src/api/queries/chatProjectSkills.ts
…ed skill refetches on save and the skill cap
…kill permission check before opening
…roject-skills/invocation-api
…led while project skills load
…oject-skills/project-skills-details
…roject-skills/invocation-api
Skills gain two independent settings. action marks a project skill as a one-click action above project composers; a check constraint keeps it on project skills, and personal and organization routes reject the field. model_invocable controls whether agents see and load a skill on their own: skills with it off are left out of <available-skills> and read_skill, but structured skill invocations still load them.
read_skill refuses a workspace skill hidden from the model, and before this branch it was the only tool that returned a skill's absolute directory. A person can still invoke such a skill, but its body could not run the scripts it bundles, because the model never learned where they are. Invoking a workspace skill now stores the pinned skill directory on the invocation part, and the prompt renders it as a `dir` attribute on the <invoked-skill> block, escaped as an attribute value. The field is internal only: API responses already strip it, and hook payloads now drop it next to the skill body.
|
@codex review
|
|
Codex Review: Didn't find any major issues. 🚀 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". |
…odel-invocation # Conflicts: # coderd/apidoc/docs.go # coderd/apidoc/swagger.json # coderd/exp_chats.go # coderd/userskills.go # coderd/x/chatd/ARCHITECTURE.md # coderd/x/chatd/chathooks/hooks_internal_test.go # coderd/x/chatd/chathooks/trigger.go # coderd/x/chatd/chatprompt/chatprompt.go # coderd/x/chatd/chatprompt/chatprompt_test.go # coderd/x/chatd/chattool/skill.go # coderd/x/chatd/project_instructions.go # coderd/x/chatd/skill_invocation.go # coderd/x/chatd/skill_invocation_internal_test.go # codersdk/skills.go # docs/ai-coder/agents/extending-agents.md # docs/reference/api/chats.md # docs/reference/api/schemas.md # site/src/api/typesGenerated.ts # site/src/pages/AgentsPage/AgentCreatePage/AgentCreatePage.tsx # site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.test.tsx # site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx # site/src/pages/AgentsPage/components/ProjectPage/ProjectSkillsDialog.tsx
|
@codex review
|
|
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". |
…invocation The skill index sentence said every discovered skill is listed, which a skill that sets disable-model-invocation: true no longer is. The stored-skill sentence claimed any project editor import honors the key and presented the API default as fixed, but edit-mode import keeps the current setting and an explicit model_invocable wins. A new "Turn off automatic use" section states when the key applies to stored skills, with the UI path first.
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27de7f5c6d
ℹ️ 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".
An invoked workspace skill stores its directory on the message, and every later prompt replays it. After the chat was rebound to another workspace, or unbound, the prompt still pointed the model at that path, which there either does not exist or holds a different skill. The invocation now also stores the chat's workspace, and the prompt shows the directory only while the chat stays bound to it, as workspace file references already do. The field is internal: API responses strip it and hook payloads drop it.
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f043b2a34
ℹ️ 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".
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f043b2a34
ℹ️ 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".
TestSDKFieldsFormatted requires every uuid.UUID field in codersdk to carry format:"uuid", including internal fields that Swagger ignores.
|
@codex review
|
|
Codex Review: Didn't find any major issues. Hooray! 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". |
Documentation CheckRe-reviewed at Design notes
Related open PRs
Findings for agents- id: coverage-1
persona: coverage
class: suggestion
blocking: false
file: docs/ai-coder/agents/extending-agents.md
line: 140
quote: "When you invoke a workspace skill, the agent also gets the skill's directory, so the agent can run the scripts that the skill includes."
evidence:
- coderd/x/chatd/chatprompt/chatprompt.go:1368
- coderd/x/chatd/chatprompt/chatprompt.go:1355
rule: null
problem: The invoked-skill directory is only included while the chat stays bound to the owning workspace; the docs do not say this.
fix: "When you invoke a workspace skill, the agent also gets the skill's directory, as long as the chat stays in that workspace, so the agent can run the scripts that the skill includes."
verified: trueAutomated review via Coder Agents. Reply to a finding's thread with the reason if the finding is wrong. |
|
@codex review
|
|
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". |
Extends #30882's
model_invocablesemantics to workspace skills and to stored skills created through the API.Claude Code and Xum let skill authors set
disable-model-invocation: truein SKILL.md frontmatter, so agents never pick the skill on their own and it runs only when a person invokes it. Coder Agents honored the key only when someone imported a SKILL.md file while adding a project skill (#30884).What changes
true, chatd leaves the skill out of<available-skills>before merging sources, so a listed skill with the same name keeps its bare name, andread_skillreports it as not found. The skill stays in the/menu, and invoking it still loads its body.read_skill_fileserves its supporting files under the bare name orworkspace/<name>and refuses itsSKILL.md(case-insensitive, afterpath.Clean). Skills without the key behave as on the base.diron<invoked-skill>, escaped as an attribute value. Before, onlyread_skillgave the model a skill's directory, and it refuses a hidden skill, so a hidden skill could not run the scripts it bundles. The part also stores the chat's workspace, and the prompt showsdironly while the chat stays bound to it, as it does for workspace file references. This changes feat: send skill invocations as structured message parts #30861's invocation code. Hook payloads drop the directory and its workspace like the body, and API responses strip both.model_invocablestoresmodel_invocable = false. An explicit value wins, and PATCH is unchanged. This covers personal, organization, and project skills, which sharecreateSkill.workspacesdk.SkillDisablesModelInvocationreads the key. TheCreateSkillRequest.ModelInvocabledoc comment, the generated API docs, andextending-agents.md(the SKILL.md format, a new "Turn off automatic use" section, and the notes on the skill index, the skill tools, and aliases) describe the new behavior.Follow-ups
Testing
read_skill,read_skill_file, invocation of a hidden skill and the directory it carries (attribute escaping, no directory after the chat changes workspace, no directory in hook payloads), and the create default for personal and organization skills. Each new test fails when its code path is removed.read_skill_fileby symlinks and stale pins, plus a bare-name lookup bug and a docs gap that round 2 fixed. Round 3 found that the content check added against those bypasses refused a listed skill's file whose own frontmatter sets the key. After round 3 we narrowed the rule to the hidden skill'sSKILL.mdpath. The key decides what agents are offered (the index andread_skill), not which files they can read:read_fileandexecutealready open any workspace file, so a content check inread_skill_fileprotected nothing and kept producing edge cases.c9ff25dc29f. Later commits added a behavior-neutral cleanup (cd617533c2e), one test case from the test audit (044c1e6e23a), and a comment fix (9ec3768b18b), which passed validation without another UAT round. Round 5 passed on2b518c6c2b1, which adds the skill directory. A real model ran hidden skills' scripts from thediron<invoked-skill>, including directories whose paths contain&,',",<and>, and API responses carried no directory. Merging main after feat: show project skill actions above project chat composers #30884 landed (2d7d3cb9674) did not change this PR's diff, so UAT was not rerun.8f043b2a342, which shows the directory only while the chat stays bound to the skill's workspace, has Go tests but no UAT round.2d7d3cb9674, and27de7f5c6d7fixes its findings: the skill index sentence said every skill is listed, the stored-skill sentence claimed any project editor import honors the key and presented the API default as fixed, the API path came before the UI path, and some wording broke the docs style rules. The fix is docs-only, so UAT was not rerun.9ec3768b18b, then raised one P2 on the same head when the PR was marked ready: an invoked hidden skill gets no skill directory. A probe confirmed it, and2b518c6c2b1fixes it. Its earlier finding on that head (honorCODER_AGENT_EXP_SKILL_META_FILE) was refuted, because the pinned skill snapshot always readsSKILL.md. Both threads are resolved, and Codex found no major issues on2b518c6c2b1or on the merge2d7d3cb9674.27de7f5c6d7, Codex raised two P2s. One was confirmed: an invoked skill's directory stayed in the prompt after the chat moved to another workspace, which a prompt test showed on that head, and8f043b2a342fixes it. The other was declined: on Windows,scripts\..\SKILL.mdgets past theSKILL.mdcheck inread_skill_file, but that check is not an access boundary (read_fileopens any path), and Windows has more aliases (SKILL.md.,SKILL.md::$DATA,SKILL~1.MD) that normalizing backslashes would not stop. On8f043b2a342, Codex asked to bind the directory to the workspace build instead. That was declined: every workspace start is a new build with new agent IDs, so the directory would drop after each stop and start, and the pinned body and the live files can diverge without a rebuild anyway, as they do forread_skill. A later request on that head asked to limit a hidden skill'sread_skill_fileaccess to invocations in the current workspace. That was declined too:read_skill_fileresolves names against the current pin for listed skills on main as well, and the key decides which skills agents are offered, not which files they can read. All four threads are resolved.a697dcd927fadds theformat:"uuid"tag thatTestSDKFieldsFormattedrequires on the new field, and Codex found no major issues ona697dcd927f.ae70b2c533fis docs-only: it applies the doc-check suggestion to say that an invoked skill's directory is included only while the chat stays in that workspace. The author doc-check self-check found no blocking findings on it, and Codex found no major issues onae70b2c533f.