Conversation
…gent`, `mode`, and `subtask` fields
🦋 Changeset detectedLatest commit: 9d4bea1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d4bea1b91
ℹ️ 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".
| 'permissions?': 'Record<string, "allow" | "deny">', | ||
| // OpenCode agent frontmatter | ||
| 'mode?': '"primary" | "subagent" | "all"', | ||
| 'permission?': 'Record<string, unknown>', |
There was a problem hiding this comment.
Accept shorthand permission actions
When an agent uses the valid OpenCode shorthand permission: deny/ask/allow to apply one action to all permissions, this schema rejects it because Record<string, unknown> requires permission to be an object. I checked the upstream OpenCode config schema (https://opencode.ai/config.json): AgentConfig.permission references PermissionConfig, whose anyOf includes both a shorthand action string and an object, so facets using supported frontmatter will fail adapter metadata validation instead of building.
Useful? React with 👍 / 👎.
This PR was auto-generated by the release workflow. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @agent-facets/adapter-opencode@0.6.0 ### Minor Changes - [#348](#348) [`c4ac343`](c4ac343) Thanks [@eXamadeus](https://github.com/eXamadeus)! - Expand metadata support to include model, permission, agent, and subtask fields Co-authored-by: the-faceter[bot] <272408671+the-faceter[bot]@users.noreply.github.com>

Why
The OpenCode adapter's metadata schema only supported
tools,model, andpermissions, which wasn't enough to describe agents and commands that use OpenCode-specific frontmatter fields likemode,permission,agent, andsubtask.Details
mode("primary" | "subagent" | "all") andpermissionare agent-oriented fields;agentandsubtaskare command-oriented. BecausebuildAssetMetadatais not asset-type-aware, all fields live in a single shared schema and a facet is expected to only set the keys relevant to its asset type.permissionis typed asRecord<string, unknown>rather than a stricter shape because OpenCode allows permission values to be either a shorthand action string ("allow" | "ask" | "deny") or a nested glob-to-action object (e.g.edit: { "*": "deny", "foo/**": "allow" }). A tighter type would reject valid OpenCode config.The existing
permissionskey is retained as-is for backwards compatibility.The
@julian/openspec-adversaryfacet is bumped to2.1.0, which renames thereview-adversarycommand toreconcile-adversary-review.Verification
New tests cover acceptance of valid
agent/subtask,mode: subagent, and scopedpermissionblocks, as well as rejection of invalidmodevalues and non-booleansubtask. Round-trip install/read tests confirm the new frontmatter fields are written and parsed correctly.