From f1cb544016bea274c7553e6b68d4ae131fcca28d Mon Sep 17 00:00:00 2001 From: Tabish Bidiwale Date: Tue, 25 Nov 2025 12:02:24 +1100 Subject: [PATCH] fix(opencode): remove hardcoded agent field from slash commands Remove the `agent: build` field from OpenCode slash command templates to allow OpenCode to use the current/custom agent instead of requiring the build agent to be available. Fixes #334 --- src/core/configurators/slash/opencode.ts | 3 --- test/core/init.test.ts | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/configurators/slash/opencode.ts b/src/core/configurators/slash/opencode.ts index 25e8e329..48d37807 100644 --- a/src/core/configurators/slash/opencode.ts +++ b/src/core/configurators/slash/opencode.ts @@ -11,7 +11,6 @@ const FILE_PATHS: Record = { const FRONTMATTER: Record = { proposal: `--- -agent: build description: Scaffold a new OpenSpec change and validate strictly. --- The user has requested the following change proposal. Use the openspec instructions to create their change proposal. @@ -20,7 +19,6 @@ The user has requested the following change proposal. Use the openspec instructi `, apply: `--- -agent: build description: Implement an approved OpenSpec change and keep tasks in sync. --- The user has requested to implement the following change proposal. Find the change proposal and follow the instructions below. If you're not sure or if ambiguous, ask for clarification from the user. @@ -29,7 +27,6 @@ The user has requested to implement the following change proposal. Find the chan `, archive: `--- -agent: build description: Archive a deployed OpenSpec change and update specs. --- diff --git a/test/core/init.test.ts b/test/core/init.test.ts index 43fc6fb2..7fdd5c4f 100644 --- a/test/core/init.test.ts +++ b/test/core/init.test.ts @@ -492,21 +492,21 @@ describe('InitCommand', () => { expect(await fileExists(openCodeArchive)).toBe(true); const proposalContent = await fs.readFile(openCodeProposal, 'utf-8'); - expect(proposalContent).toContain('agent: build'); + expect(proposalContent).not.toContain('agent:'); expect(proposalContent).toContain( 'description: Scaffold a new OpenSpec change and validate strictly.' ); expect(proposalContent).toContain(''); const applyContent = await fs.readFile(openCodeApply, 'utf-8'); - expect(applyContent).toContain('agent: build'); + expect(applyContent).not.toContain('agent:'); expect(applyContent).toContain( 'description: Implement an approved OpenSpec change and keep tasks in sync.' ); expect(applyContent).toContain('Work through tasks sequentially'); const archiveContent = await fs.readFile(openCodeArchive, 'utf-8'); - expect(archiveContent).toContain('agent: build'); + expect(archiveContent).not.toContain('agent:'); expect(archiveContent).toContain( 'description: Archive a deployed OpenSpec change and update specs.' );