You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: opencode integration unusable on opencode v2 — run --command removed (upstream: anomalyco/opencode#49903) #4639
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).
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.
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.specify and integration: opencode.
Supply a prompt such as build a login page.
Observe the generated invocation opencode run --command speckit.specify ... and the Unrecognized flag: --command error.
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() constructs opencode run; when the prompt starts with /, it appends --command and the command name before model, JSON, and message arguments.
tests/integrations/test_integration_opencode.py:22-60 — integration tests explicitly lock in the legacy run --command argv shape, including model and JSON variants.
tests/integrations/test_extra_args.py:330-370 — extra-argument tests also assume the prompt-derived --command flag and its ordering.
src/specify_cli/workflows/step/command/__init__.py:239 — workflow command execution delegates to the integration's build_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__.py
tests/integrations/test_integration_opencode.py
tests/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?]
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.
Activity
github-actions commentedon Sep 22, 2026
Bug assessment — opencode-v2-command: Likely valid, needs reproduction · severity medium
Bug Assessment: opencode integration unusable on opencode v2
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,runrejects--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 failedspeckit.specifyinvocation. 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
--commandoption. Plain prompts without a slash command are not implicated by the report.Reproduction
2.0.8.command: speckit.specifyandintegration: opencode.build a login page.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:
Files likely to change:
src/specify_cli/integrations/opencode/__init__.pytests/integrations/test_integration_opencode.pytests/integrations/test_extra_args.pyTests to add or update:
Risks & Considerations
Open Questions
run --command?]mnriem commentedon Sep 23, 2026
@markuswondrak Is there anything that can be done here? Is it blocked on upstream?
markuswondrak commentedon Sep 23, 2026
No, not really. v2 removed the
run --commandparameter 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.