mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
test(opencode): reject any namespace-scoped command agent id, not just the legacy prefix (#2477)
Address review: the frontmatter guard only rejected the `everything-claude-code:` prefix, so a hypothetical future `<other-plugin>:agent` value could slip through. opencode registers its inline agents unscoped, so assert the id carries no `:` at all — rejecting the whole scoped class — alongside the existing registered-agent-map membership check.
This commit is contained in:
parent
9d1ecb0754
commit
fafc832238
1 changed files with 7 additions and 6 deletions
|
|
@ -96,13 +96,14 @@ if (
|
|||
|
||||
const agentId = match[1].trim().replace(/^['"]|['"]$/g, '');
|
||||
|
||||
// Regression guard for #2477: the Claude Code plugin namespace
|
||||
// (`everything-claude-code:`) is not a valid opencode agent scope.
|
||||
// OpenCode registers these agents unscoped in opencode.json's `agent`
|
||||
// map, so a scoped id fails to resolve ("Agent not found") and hard-
|
||||
// breaks subtask commands like /code-review on opencode.
|
||||
// Regression guard for #2477: opencode registers these agents unscoped
|
||||
// in opencode.json's `agent` map, so ANY namespace-scoped id
|
||||
// (`<plugin>:<agent>` — e.g. the Claude Code `everything-claude-code:`
|
||||
// prefix) fails to resolve ("Agent not found") and hard-breaks subtask
|
||||
// commands like /code-review on opencode. Reject the whole scoped class,
|
||||
// not just the one legacy prefix.
|
||||
assert.ok(
|
||||
!agentId.includes('everything-claude-code:'),
|
||||
!agentId.includes(':'),
|
||||
`${entry}: command agent must be an unscoped opencode agent id, got: ${agentId}`
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue