From fafc832238be8748f80f130a88a45369c0da4527 Mon Sep 17 00:00:00 2001 From: Gaurav Dubey Date: Fri, 10 Jul 2026 09:58:03 +0530 Subject: [PATCH] test(opencode): reject any namespace-scoped command agent id, not just the legacy prefix (#2477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address review: the frontmatter guard only rejected the `everything-claude-code:` prefix, so a hypothetical future `: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. --- tests/opencode-config.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/opencode-config.test.js b/tests/opencode-config.test.js index 9b0254e7..693ac3b9 100644 --- a/tests/opencode-config.test.js +++ b/tests/opencode-config.test.js @@ -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 + // (`:` — 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}` );