fix(sdk): drop --dangerously-skip-permissions + finish v1.4 migration in opencode harness (#582)#583
Merged
Merged
Conversation
… in opencode harness Closes #582. opencode v1.14 does not accept `--dangerously-skip-permissions` on the `run` subcommand. yargs prints the run-help screen to stdout and exits 0, so every SDK on top of OpenCodeProvider was silently capturing CLI help text as the LLM response — APPROVE'd reviews with 0 findings, empty turns, zero cost. The failure is fully silent (no stderr, no error, no non-zero exit). This PR: - Python (sdk/python/agentfield/harness/providers/opencode.py): drop the bad flag. opencode in non-TTY mode proceeds without permission prompting. - TypeScript (sdk/typescript/src/harness/providers/opencode.ts): switch from deprecated `opencode -c <dir> -p <prompt>` (pre-v1.4) to `opencode run --dir <dir> -m <model> <prompt>`. The deprecated form is broken on v1.14: `-c` rebound to `--continue` (boolean), no top-level `-p`. - Go (sdk/go/harness/opencode.go): drop the bad flag (the file already used the `run` subcommand otherwise). - Tests updated across all three SDKs to assert the new canonical invocation and to assert `--dangerously-skip-permissions` is NOT present. Reproduced end-to-end on Agent-Field/pr-af reviewing agentfield#575 with HARNESS_PROVIDER=opencode HARNESS_MODEL=openrouter/deepseek/deepseek-v4-pro: every cluster_scout returned the `opencode run [message..]` USAGE screen verbatim as its findings, meta_strategist saw garbage, pipeline early-exited with APPROVE / 0 findings in 5 min / $0.
Contributor
Performance
✓ No regressions detected |
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
AbirAbbas
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #582.
opencode v1.14+rejects--dangerously-skip-permissionson therunsubcommand — yargs prints the run-help screen to stdout and exits 0. The SDK then treats that help text as the LLM response. Failure is fully silent: no stderr, no error, no non-zero exit. Every multi-agent system on top ofOpenCodeProviderreturns garbage that looks successful.I hit this end-to-end running Agent-Field/pr-af on
agentfield#575withHARNESS_PROVIDER=opencode HARNESS_MODEL=openrouter/deepseek/deepseek-v4-pro: pipeline completedsucceededin 5 min withtotal_findings: 0, dimensions_run: 0, cost_usd: $0, event: APPROVE, because everycluster_scoutreasoner's "scout report" was theopencode run [message..]USAGE screen verbatim.Per-SDK fix
--dangerously-skip-permissionsafteropencode runopencode -c <dir> -p <prompt>(pre-v1.4); v1.14 rebinds-cto--continueand has no top-level-p, so opencode also prints help & exits 0opencode run --dir <dir> -m <model> <prompt>opencode run, but also appends--dangerously-skip-permissionsTests across all three SDKs updated to assert the new canonical invocation and to assert
--dangerously-skip-permissionsis NOT present anywhere on the constructed command.Why this fix is safe
opencode v1.14 in non-TTY mode (subprocess invocation, as the SDK uses it) does not prompt for permissions interactively — there's no TTY to read from. The flag was only needed to suppress an interactive prompt that never happens in headless execution. The opencode docs at https://opencode.ai/docs/cli/ still reference the flag, but it is not recognized by the
runsubcommand in v1.14.41 (opencode run --helpconfirms no such option).Reproduce before / verify after
Test plan
uv run --frozen pytest tests/test_harness_provider_opencode.py -x -q— 18 passednpx vitest run tests/harness_provider_opencode.test.ts— 5 passednpx vitest run tests/harness— 70 passedgo test ./harness/ -run "TestOpenCode|TestExecute" -count=1— okTestRunCLI/context_cancellation_returns_a_killed-process_result_with_partial_stdoutfails identically onorigin/main(unrelated)pr-af.reviewonagentfield#575no longer hits the help-text-as-scout-output failure (visible in pr-af node log — cluster_scout outputs are now actual LLM responses fromdeepseek-v4-pro)