Bug Description
When running a workflow without explicitly passing the integration via --input integration=<name>, the workflow engine defaults to copilot (defined in workflow.yml). This overrides the project's actual initialized integration stored in .specify/init-options.json and .specify/integration.json.
If the copilot CLI happens to be installed on the system, the workflow incorrectly dispatches the command to Copilot instead of the configured project AI (e.g., opencode). This results in a confusing No such agent: speckit.specify error, because the project only contains agent files for the initialized AI, not Copilot.
Steps to Reproduce
- Initialize a project exclusively with Opencode:
specify init --ai opencode
- Ensure the
copilot CLI is coincidentally installed on your system (/usr/bin/copilot).
- Run a workflow without an explicit integration input:
specify workflow run speckit --input spec="..."
- The workflow fails at the first step (
speckit.specify).
Expected Behavior
The workflow engine should auto-detect the project's integration from .specify/integration.json (or .specify/init-options.json) and use it as the default. If I initialized the project with opencode, the workflow should dispatch to opencode.
Actual Behavior
The run fails with: "No such agent: speckit.specify".
The Failure Path:
- The
workflow.yml (lines 22-25) sets the default input for integration to "copilot".
- The
CommandStep resolves the integration input, choosing "copilot" over the project default.
CopilotIntegration.dispatch_command() attempts to run: copilot -p "<spec>" --agent speckit.specify.
- Because
/usr/bin/copilot exists, shutil.which("copilot") succeeds and dispatch proceeds.
- Copilot fails because the commands live at
.opencode/command/speckit.*.md, not .github/agents/speckit.*.agent.md.
Specify CLI Version
0.7.4.dev0
AI Agent
Claude Code
Operating System
Ubuntu 24.04.4 LTS
Python Version
3.12.3
Error Logs
Additional Context
Diagnostic Information & Open Questions
If we fix the workflow to correctly dispatch to opencode (or pass --input integration=opencode manually), we might hit a secondary bug.
Currently, OpencodeIntegration delegates to MarkdownIntegration.build_exec_args(), which generates the CLI command: ["opencode", "-p", prompt].
It needs to be verified if the opencode CLI actually supports the -p shorthand in non-interactive mode. Standard opencode usage typically expects opencode run <message> or opencode --prompt <message>.
(Diagnostic commands to verify this internally: opencode --prompt "test" vs opencode run "test").
Suggested Fixes & Quality Improvements
- Dynamic Default Resolution: The workflow YAML schema should support
integration: auto, telling the engine to read .specify/integration.json instead of hardcoding "copilot".
- Workflow Pre-flight Check: When
specify workflow run is invoked, it should warn or abort if the workflow's resolved integration mismatches the project's initialization state.
- Opencode Integration Test: Add a contract test specifically for
OpencodeIntegration.build_exec_args() to ensure the generated CLI flags (like -p) are actually supported by the opencode CLI in headless mode.
- Better CLI Error Bubbling: When
CommandStep._try_dispatch() fails, surface the actual stderr from the CLI tool rather than dropping it.
Bug Description
When running a workflow without explicitly passing the integration via
--input integration=<name>, the workflow engine defaults tocopilot(defined inworkflow.yml). This overrides the project's actual initialized integration stored in.specify/init-options.jsonand.specify/integration.json.If the
copilotCLI happens to be installed on the system, the workflow incorrectly dispatches the command to Copilot instead of the configured project AI (e.g.,opencode). This results in a confusingNo such agent: speckit.specifyerror, because the project only contains agent files for the initialized AI, not Copilot.Steps to Reproduce
specify init --ai opencodecopilotCLI is coincidentally installed on your system (/usr/bin/copilot).specify workflow run speckit --input spec="..."speckit.specify).Expected Behavior
The workflow engine should auto-detect the project's integration from
.specify/integration.json(or.specify/init-options.json) and use it as the default. If I initialized the project withopencode, the workflow should dispatch toopencode.Actual Behavior
The run fails with:
"No such agent: speckit.specify".The Failure Path:
workflow.yml(lines 22-25) sets the default input for integration to"copilot".CommandStepresolves the integration input, choosing"copilot"over the project default.CopilotIntegration.dispatch_command()attempts to run:copilot -p "<spec>" --agent speckit.specify./usr/bin/copilotexists,shutil.which("copilot")succeeds and dispatch proceeds..opencode/command/speckit.*.md, not.github/agents/speckit.*.agent.md.Specify CLI Version
0.7.4.dev0
AI Agent
Claude Code
Operating System
Ubuntu 24.04.4 LTS
Python Version
3.12.3
Error Logs
Additional Context
Diagnostic Information & Open Questions
If we fix the workflow to correctly dispatch to
opencode(or pass--input integration=opencodemanually), we might hit a secondary bug.Currently,
OpencodeIntegrationdelegates toMarkdownIntegration.build_exec_args(), which generates the CLI command:["opencode", "-p", prompt].It needs to be verified if the
opencodeCLI actually supports the-pshorthand in non-interactive mode. Standardopencodeusage typically expectsopencode run <message>oropencode --prompt <message>.(Diagnostic commands to verify this internally:
opencode --prompt "test"vsopencode run "test").Suggested Fixes & Quality Improvements
integration: auto, telling the engine to read.specify/integration.jsoninstead of hardcoding"copilot".specify workflow runis invoked, it should warn or abort if the workflow's resolved integration mismatches the project's initialization state.OpencodeIntegration.build_exec_args()to ensure the generated CLI flags (like-p) are actually supported by theopencodeCLI in headless mode.CommandStep._try_dispatch()fails, surface the actualstderrfrom the CLI tool rather than dropping it.