Skip to content

fix(agents): verify opencode 2.3.0 adapter against real CLI (#116) - #207

Open
Falguni-105 wants to merge 1 commit into
secfoo-com:mainfrom
Falguni-105:verify/opencode-cli-116
Open

Falguni-105 wants to merge 1 commit into
secfoo-com:mainfrom
Falguni-105:verify/opencode-cli-116

Conversation

@Falguni-105

Copy link
Copy Markdown

Covers one adapter for #116 (the issue notes one well-verified adapter is a complete PR).

Verified against @opencode/cli 2.3.0 (Windows x64, 2026-11-28) with a new scripts/record_agent.py that captures real stdout/stderr/exit code and refuses to save a transcript containing a key-shaped value.

What the recordings found and this PR fixes

  • Flag drift: v2 rejects --pure and --dir (flag_drift.json records the CLI's Unrecognized flag errors). The argv now uses --standalone, with the working directory supplied by Popen(cwd=...).
  • Security regression: v2 ignores the old OPENCODE_CONFIG_CONTENT / OPENCODE_PERMISSION env vars. With those alone, a write tool actually created proof.txt. The PR ships a v2 permissions array (read/glob/grep only) via OPENCODE_CONFIG; permission_denied.json records the same write being refused.
  • Auth failures are JSON events on stdout with empty stderr in v2; describe_failure() now surfaces the CLI's message.

Recordings (tests/fixtures/agents/opencode/2.3.0/, replayed by tests): success (secret-scanning --depth quick on examples/, 46675 input / 3382 output tokens, cost 0), auth_failure, timeout, permission_denied, flag_drift.

Docs: added the opencode row and a verification matrix with CLI version, date, verifier, install/auth/run/timeout/cost checks.

Test note: on this machine tests/test_agents/test_api.py has 15 pre-existing failures because langgraph is not installed. All new/affected tests and tests/test_docs_consistency.py pass.

@Falguni-105
Falguni-105 requested a review from vsn411 as a code owner November 27, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants