[Bug]: opencode integration unusable on opencode v2 — run --command removed (upstream: anomalyco/opencode#49903)
Bug Description
The opencode integration dispatches commands as opencode run --command <name>, but opencode v2 removed --command. Every workflow command step fails immediately with Unrecognized flag: --command (exit 1).
Tracking report — no spec-kit-side workaround is proposed. The integration can only be fixed once upstream decides the v2 headless command path. Upstream: anomalyco/opencode#49903.
Steps to Reproduce
- Install opencode v2 (
opencode --version→ 2.0.8). - Run a workflow command step with
command: speckit.specify,integration: opencode. - Spec Kit emits
opencode run --command speckit.specify ….
Expected Behavior
The command is dispatched and runs.
Actual Behavior
opencode run --command speckit.specify … → ERROR: Unrecognized flag: --command in command opencode run, exit 1 (failed in ~54 ms in run cockpit-d012782e9339).
Specify CLI Version
1.0.9.dev0
AI Agent
opencode
Operating System
Ubuntu 24.04.5 LTS (Linux 6.17.0-1032-oem, x86_64)
Python Version
3.12.3
Error Logs
$ opencode run --command speckit.specify "build a login page"
ERROR
Unrecognized flag: --command in command opencode run
exit=1
Additional Context
src/specify_cli/integrations/opencode/__init__.py:62-67appends--command.- The slash prompt is synthesized internally, so users cannot avoid it.
- Upstream report: anomalyco/opencode#49903. Related: #2416, #2409, #4580.
- Requested handling: tracking issue (e.g.
triage-can-wait) until upstream decides, to prevent duplicate reports.
AI Disclosure
Drafted with an AI assistant (OpenCode agent, model: DeepSeek V4.1 Flash); commands and logs reproduced on the affected machine and reviewed by the reporter before posting.
Bug assessment — opencode-v2-command: Likely valid, needs reproduction · severity medium
Bug Assessment: opencode integration unusable on opencode v2
- Slug: opencode-v2-command
- Created: 2026-09-22T18:16:15Z
- Source: issue #4639
- Verdict: likely valid, needs reproduction
- Severity: medium
Report (summarized)
The reporter states that Specify CLI 1.0.9.dev0 emits opencode run --command <name> ... for slash-prefixed workflow commands. With opencode 2.0.8, run rejects --command, so the workflow exits with status 1 before execution. The report includes Ubuntu 24.04.5, Linux x86_64, Python 3.12.3, and a failed speckit.specify invocation. The reporter links the upstream discussion at anomalyco/opencode#49903 and references related Spec Kit issues #2416, #2409, and #4580. No additional issue comments were present.
Symptom
For opencode v2 installations, slash-prefixed Spec Kit workflow dispatch is expected to run the selected command but instead fails immediately because the integration adds the removed --command option. Plain prompts without a slash command are not implicated by the report.
Reproduction
- Install opencode v2 and verify a version such as
2.0.8. - Use a Spec Kit workflow command step with
command: speckit.specifyandintegration: opencode. - Supply a prompt such as
build a login page. - Observe the generated invocation
opencode run --command speckit.specify ...and theUnrecognized flag: --commanderror.
The exact supported replacement invocation for opencode v2 is [NEEDS CLARIFICATION: upstream has not established the v2 headless command path in this report]. This assessment does not independently reproduce against an installed opencode v2 binary.
Suspected Code Paths
src/specify_cli/integrations/opencode/__init__.py:45-78—OpencodeIntegration.build_exec_args()constructsopencode run; when the prompt starts with/, it appends--commandand the command name before model, JSON, and message arguments.tests/integrations/test_integration_opencode.py:22-60— integration tests explicitly lock in the legacyrun --commandargv shape, including model and JSON variants.tests/integrations/test_extra_args.py:330-370— extra-argument tests also assume the prompt-derived--commandflag and its ordering.src/specify_cli/workflows/step/command/__init__.py:239— workflow command execution delegates to the integration'sbuild_exec_args(), making the integration argv the dispatch boundary for command steps.
Root Cause Hypothesis
The opencode integration encodes the pre-v2 CLI contract unconditionally: slash-prefixed prompts are translated to run --command <name>. Opencode v2 removed that option, so every slash-command workflow using the v2 executable is rejected by the CLI before Spec Kit receives any useful output. Confidence: high for the reported v2 failure; low for the correct replacement until the upstream interface is confirmed.
Proposed Remediation
Preferred: Confirm the supported opencode v2 headless command-dispatch syntax upstream, then update OpencodeIntegration.build_exec_args() to emit that syntax for v2 while preserving the legacy form for supported pre-v2 releases, or make the supported-version policy explicit if compatibility cannot be maintained. Keep model, JSON-output, extra-argument ordering, and plain-prompt behavior aligned with the selected CLI path. Update the integration and extra-args tests to assert each supported version/path and document the compatibility boundary.
Alternatives:
- Pin or constrain the supported opencode version until upstream provides a stable v2 command path. This avoids emitting known-invalid argv but leaves newer installations unable to use the integration.
- Temporarily reject or clearly warn on detected unsupported opencode versions before dispatch. This improves diagnostics but does not restore v2 functionality.
Files likely to change:
src/specify_cli/integrations/opencode/__init__.pytests/integrations/test_integration_opencode.pytests/integrations/test_extra_args.py- Relevant integration documentation or compatibility metadata, if the project has a documented version policy.
Tests to add or update:
- Assert the v2 argv shape once upstream's replacement is known.
- Preserve a regression test for the legacy argv shape if backward compatibility is supported.
- Cover model, JSON output, extra arguments, slash-prefixed commands, and plain prompts for each supported path.
- Add a version-detection or unsupported-version diagnostic test if dispatch is gated by CLI version.
Risks & Considerations
- The upstream replacement may still be in flux; implementing an assumed syntax could create another broken integration.
- Version detection adds subprocess/API compatibility and maintenance concerns, and users may have wrappers or alternate executables configured through environment variables.
- Changing argv could affect command names, message quoting, JSON parsing, and extra-argument precedence; existing dispatch contracts must remain intact.
- The failure is scoped to opencode users but makes the integration unusable for affected v2 versions, supporting medium rather than low severity.
Open Questions
- [NEEDS CLARIFICATION: What exact opencode v2 command or prompt-dispatch syntax replaces
run --command?] - [NEEDS CLARIFICATION: Which opencode versions should Spec Kit officially support concurrently?]
- [NEEDS CLARIFICATION: Does opencode expose a stable machine-readable version/capability check suitable for selecting the argv shape?]
Generated by 🐛 Assess Bug from Labeled Issue for #4639 · copilot · gpt52codex · 1.72 AIC · ⌖ 6.86 AIC · ⊞ 22.4K · ◷
@markuswondrak Is there anything that can be done here? Is it blocked on upstream?
No, not really. v2 removed the run --command parameter and does not resolve slash commands either when inputted as plain text (like /speckit.implement).
Only thing left would be to warn users who use Opencode v2 that workflows will not work for them with this integration.
This issue has been automatically marked as stale because it has had no activity for 30 days. It will be closed in 30 days unless there is a substantive update. If the problem still applies, please provide updated context such as whether it is still reproducible, the affected version or environment, its current impact, and any new reproduction details. A comment that only states that the issue is "still relevant" does not give maintainers enough information to reconsider it.