feat(cursor): add first-class model, readonly, is_background subagent frontmatter fields - #1898
Merged
Conversation
… frontmatter fields Closes #1882 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up Cursor upstream updates by promoting the documented Cursor subagent frontmatter fields to first-class, typed optional fields on
CursorSubagentFrontmatterSchema:model(string, defaultinherit)readonly(boolean, defaultfalse)is_background(boolean, defaultfalse)Previously these three fields already round-tripped through the
cursor:section viaz.looseObjectpassthrough, so there was no data-loss bug — this change makes them first-class so they are explicitly typed and validated (e.g. wrong types likereadonly: "yes"are now rejected).The schema keeps
z.looseObject, andtoRulesyncSubagent/fromRulesyncSubagentcontinue to spread the fields into/out of the namespacedcursor:section, so no processor wiring change was needed. Cursor subagents remain project-scope only (.cursor/agents/); no global scope was added.Out of scope (intentional)
The issue also mentions a canonical top-level
modelmapping. This is intentionally skipped: rulesync has no canonical top-level subagentmodel, and each tool keepsmodelin its own namespaced section (e.g.claudecode.model,opencode.model,kilo.model). Adding a canonical mapping would contradict that existing convention.Evidence
Changes
src/features/subagents/cursor-subagent.ts: extend schema withmodel,readonly,is_background.src/features/subagents/cursor-subagent.test.ts: add happy-path tests for parsing the fields as first-class and round-tripping them through thecursor:section (file import + generate), plus an invalid-type rejection test.docs/reference/file-formats.mdandskills/rulesync/file-formats.md(auto-synced): document thecursor:subagent block.Verification
pnpm cicheckis fully green (code: fmt/oxlint/typecheck/267 test files, 6422 tests passing; content: skill-docs sync, cspell, secretlint all passing).Closes #1882
🤖 Generated with Claude Code