Skip to content

feat: honor disable-model-invocation in uploaded skill content - #31159

Merged
jaaydenh merged 330 commits into
mainfrom
chat-project-skills/frontmatter-api
Nov 18, 2026
Merged

jaaydenh merged 330 commits into
mainfrom
chat-project-skills/frontmatter-api

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Addresses @ethanndickson's review comment on #30882: the same SKILL.md file could be manual-only in Claude Code and the project dialog but automatic in Coder, because the server and the browser each handled disable-model-invocation in their own way.

The server now owns the key for personal, organization, and project skills:

  • When a create or update request leaves model_invocable unset, disable-model-invocation: true in the content turns automatic use off, and false turns it back on. The key is read with the function workspace skills use, so a file gets the same setting in both places. Only YAML booleans count, so a quoted "true" is ignored.
  • An explicit model_invocable in the request always wins.
  • New content without the key leaves the setting unchanged, so editing text never turns it back on.
  • Content is stored as uploaded. Every API response returns content whose key agrees with model_invocable: when the stored file says otherwise, the server replaces the value of the key or adds the key before the first one, and leaves every other byte alone.
  • Download and Export all save the content the API returns, so the browser no longer edits the file. withDisabledModelInvocation is removed.
  • An upload is rejected with a 400 when the key holds a value the server can't replace with a boolean, such as a list. A later change to model_invocable can then always reach the file.

Two edges:

  • Adding the key makes the returned file about 30 bytes larger, so a file at the 64 KB upload limit can be too large to upload again.
  • A skill stored before the upload check with a value the server can't replace is returned as stored.

Workspace skills already honor the key since #31147.

#31160, the frontend PR on top of this one, adds the switch to the personal and organization skill editors.

Generated by an agent on behalf of the user

…ject-skills/skill-chips-transcript

# Conflicts:
#	site/src/pages/AgentsPage/components/ChatMessageInput/SkillChip.tsx
…lls/actions-site

# Conflicts:
#	site/src/pages/AgentsPage/components/ProjectPage/ProjectSkillsDialog.tsx
@jaaydenh
jaaydenh temporarily deployed to main November 13, 2026 09:36 — with GitHub Actions Inactive
@jaaydenh
jaaydenh temporarily deployed to docs-preview November 13, 2026 09:37 — with GitHub Actions Inactive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93ba66a603

ℹ️ 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".

Comment thread coderd/x/skills/skills.go Resolved
nickvigilante added a commit that referenced this pull request Nov 13, 2026
…s to CI in CI reviews (#32197)

## Summary

Step 3 of the doc-check skill has the review run lint that CI already
runs on the same PR.
In CI review mode the skill now skips that step, and runs no test suite,
build, or generator.

## Changes

- `SKILL.md` step 3 starts with a CI review rule: skip the step, run no
test suite, build, or generator, and record the skip in the trace.
- The other modes keep the step, because an author runs them before CI
does.

Every check the step lists already runs in `ci.yaml`:

| Check | CI job |
|-------|--------|
| `make lint/emdash`, `make lint/docs-html`, `make lint/docs-manifest`,
`make lint/markdown` | `lint`, through `make lint` |
| markdownlint and the table format check | `lint-docs`, through `pnpm
check-docs` |
| Vale, advisory | `lint-docs` |

Both jobs are in the `required` check, so a failing check blocks the
merge without the review reporting it.

## Why

On 2026-11-13 a review of #32185 took 215 seconds.
113 of them went to two tool calls that ran lint and the PR's own two
shell test suites, each suite twice.
Each of those calls is also one more model call that can wait in the
queue.

## Testing

- `markdownlint-cli2` and `markdown-table-formatter --check` pass on
`SKILL.md`.
- Not tested in a live review.
A CI review reads the skill from the base branch, so this text takes
effect only after it merges.
- Dry run: two replays of a CI review of #31159 at `3580c80` with this
text plus #32199, posting nothing.
Both skipped step 3, ran no lint, test, or build, and wrote the
`deterministic_checks` entry as the step asks.
The replays ran on a cloud model with no sub-agents, not on the shared
model.

## Not in this PR

- Passing CI's check results into the review prompt.
- The Copy Editor persona asks for these results so it does not repeat
them, and a CI review now has none to give it.

Linear: DOCS-1751

_Generated by Coder Agents on behalf of @nickvigilante._
@jaaydenh
jaaydenh temporarily deployed to main November 16, 2026 10:53 — with GitHub Actions Inactive
@jaaydenh
jaaydenh requested review from ethanndickson and nickvigilante and removed request for ibetitsmike November 16, 2026 14:22

@nickvigilante nickvigilante left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Docs LGTM pending an engineer review 👍

Comment thread coderd/x/skills/skills.go Outdated
// count. content is raw unchanged when the key is absent, or when removing
// its lines would change any other frontmatter field, as in flow-style
// frontmatter such as {name: x, disable-model-invocation: true}.
func RemoveDisableModelInvocation(raw string) (content string, disable *bool) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the split between the server and the browser intended? The server removes disable-model-invocation on upload (RemoveDisableModelInvocation), and the browser adds it back on download (skillFileContent). Three things about this look odd to me:

  1. The two sides must agree on what counts as the key, and they are separate parsers (yaml.v3 nodes here, front-matter in the browser). They disagreed once already in this PR: in the quoted-key case, the download had the key twice. That case is fixed, but the two parsers remain.
  2. Only the UI download has the line. The API returns the file without it (docs). For example, a script that exports organization skills through the API into .claude/skills gets files that Claude Code treats as automatic.
  3. On main, create reads the key with SkillDisablesModelInvocation, the same function that workspace skills use. This PR reads it with a second parser, and the two give different answers for some files. For example, {name: x, disable-model-invocation: true, description: y} is manual-only as a workspace skill and on main, but automatic here. The value is found (L234-L236) and then dropped (L190-L192). The PR description says the setting still applies for flow style, but that holds only when the key is last.

So the same skill gives a different file through the API than through the UI, and the same file can give a different setting here than as a workspace skill. Is there a simpler shape for this?

Generated by an agent on behalf of the user

@jaaydenh jaaydenh Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not intended, and there is a simpler shape. As of 9add09b the server owns the key in both directions and the browser no longer touches it.

  1. Two parsers. skillFileContent and withDisabledModelInvocation are gone. Download and Export all save the content the API returns. One Go function, WithModelInvocable, makes a file agree with model_invocable. It no longer removes lines: it replaces the value of an existing key or adds the key before the first one, then re-reads the result to confirm that the setting is right and the other fields are unchanged.
  2. API and UI differ. Content is stored as uploaded, and db2sdk.Skill applies that function to every response that carries content. The API, Download and Export all now return the same bytes, so your export script gets disable-model-invocation: true for manual-only skills. The test flips only model_invocable with a PATCH and checks the file a GET returns.
  3. Second reader. Create and update read the key with SkillDisableModelInvocationValue, which SkillDisablesModelInvocation now wraps, so a stored skill and a workspace skill read a file the same way. It returns a second value because false turns automatic use back on. Your example is manual-only again, and the test creates a skill from it. A key that arrives through a YAML merge is honored too, which was the Codex finding I declined earlier.

Three edges are left:

  • An upload whose key holds a value the server can't replace with a boolean, such as a list, now gets a 400. A later change to model_invocable can then always reach the file.
  • A skill stored before that check with such a value is returned as stored.
  • Adding the key makes the returned file about 30 bytes larger, so a file at the 64 KB limit can be too large to upload again.

I updated the PR description and the docs. #31160 is merged up with this branch and no longer has its own copy of skillFileContent.

Generated by an agent on behalf of the user

The server removed the key on upload and only the browser added it back
on download. The API returned files that other tools read as automatic,
and a second YAML reader disagreed with the one workspace skills use.

Store skill content as uploaded. Read the key with the shared
workspacesdk reader, and make the content in every API response agree
with model_invocable. Browser downloads now save that content unchanged.
Say which values Coder ignores and which it rejects, describe the returned file by what the reader gets, and note that a stored file whose key cannot be set is returned unchanged.
@jaaydenh
jaaydenh temporarily deployed to main November 17, 2026 11:25 — with GitHub Actions Inactive
@jaaydenh
jaaydenh temporarily deployed to main November 17, 2026 11:25 — with GitHub Actions Inactive
@jaaydenh
jaaydenh temporarily deployed to main November 17, 2026 11:58 — with GitHub Actions Inactive
@jaaydenh
jaaydenh temporarily deployed to main November 17, 2026 12:04 — with GitHub Actions Inactive
@jaaydenh

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 76d5a88f9e

ℹ️ 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".

@jaaydenh
jaaydenh merged commit 7c7e2e7 into main Nov 18, 2026
35 of 38 checks passed
@jaaydenh
jaaydenh deleted the chat-project-skills/frontmatter-api branch November 18, 2026 07:04
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
main — 76d5a88f Deployed Nov 18, 2026 by jaaydenh via cla #259169
docs-preview — 76d5a88f Deployed Nov 18, 2026 by jaaydenh via cleanup #201
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants