Repository navigation
feat: honor disable-model-invocation in uploaded skill content - #31159
Conversation
…oject-skills/project-skills-details
…tween chips in queued previews
…roject-skills/settings-api
…roject-skills/invocation-api
…kills/skill-chips-composer
…ject-skills/skill-chips-transcript
…roject-skills/settings-api
…oject-skills/project-skills-details
… a send is pending
…lify the skill chip markup
…ject-skills/skill-chips-transcript # Conflicts: # site/src/pages/AgentsPage/components/ChatMessageInput/SkillChip.tsx
…en the organization changes
…and cap pasted chips
…roject-skills/settings-api
…roject-skills/invocation-api
…ject-skills/skill-chips-transcript
…kills/skill-chips-composer
…roject-skills/settings-api
…lls/actions-site # Conflicts: # site/src/pages/AgentsPage/components/ProjectPage/ProjectSkillsDialog.tsx
…oject-skills/project-skills-details
… deleted-skill list refresh
… the composer is disabled
…roject-skills/settings-api
…roject-skills/invocation-api
…kills/skill-chips-composer
…ject-skills/skill-chips-transcript
There was a problem hiding this comment.
💡 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".
…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._
nickvigilante
left a comment
There was a problem hiding this comment.
Docs LGTM pending an engineer review 👍
| // 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) { |
There was a problem hiding this comment.
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:
- The two sides must agree on what counts as the key, and they are separate parsers (yaml.v3 nodes here,
front-matterin 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. - 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/skillsgets files that Claude Code treats as automatic. - On
main, create reads the key withSkillDisablesModelInvocation, 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 onmain, 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
There was a problem hiding this comment.
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.
- Two parsers.
skillFileContentandwithDisabledModelInvocationare gone. Download and Export all save thecontentthe API returns. One Go function,WithModelInvocable, makes a file agree withmodel_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. - API and UI differ. Content is stored as uploaded, and
db2sdk.Skillapplies that function to every response that carriescontent. The API, Download and Export all now return the same bytes, so your export script getsdisable-model-invocation: truefor manual-only skills. The test flips onlymodel_invocablewith aPATCHand checks the file aGETreturns. - Second reader. Create and update read the key with
SkillDisableModelInvocationValue, whichSkillDisablesModelInvocationnow wraps, so a stored skill and a workspace skill read a file the same way. It returns a second value becausefalseturns 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_invocablecan 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.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
Addresses @ethanndickson's review comment on #30882: the same
SKILL.mdfile could be manual-only in Claude Code and the project dialog but automatic in Coder, because the server and the browser each handleddisable-model-invocationin their own way.The server now owns the key for personal, organization, and project skills:
model_invocableunset,disable-model-invocation: truein the content turns automatic use off, andfalseturns 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.model_invocablein the request always wins.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.withDisabledModelInvocationis removed.model_invocablecan then always reach the file.Two edges:
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.