Add live CI test for real agent CLI plumbing#62
Closed
Tim-Pohlmann wants to merge 4 commits into
Closed
Conversation
Unit tests assert BuildInvocation's argument shape against a fake process runner, so a real opencode/claude CLI renaming or dropping a flag we rely on (--model, --format json, --append-system-prompt, ...) would go unnoticed until a real job run failed. Adds a new agent-plumbing CI job that installs the real CLIs via npm and invokes them with no API key: opencode with no --model is expected to actually succeed on its free default, and every other (agent, model) combination is expected to fail with an auth-shaped error rather than an "unknown argument" error — proving the flags were accepted without needing any paid credentials in CI.
Tim-Pohlmann
added a commit
that referenced
this pull request
Jul 7, 2026
The real claude-code CLI rejects --print combined with
--output-format=stream-json unless --verbose is also present
("Error: When using --print, --output-format=stream-json requires
--verbose"). Our fake-process unit tests never caught this since they
stub the CLI; PR #62's new live agent-plumbing CI job (which invokes
the real CLI with no key) caught it immediately.
…rding
CI showed opencode wraps request-level failures (missing key, unauthorized,
upstream errors) in a generic {"type":"error","error":{"name":"UnknownError",...}}
JSON envelope rather than surfacing auth-specific wording, so the keyword-based
assert_auth_failure check (which fits claude) never matched. A "type":"error"
envelope is still proof the CLI parsed --model/--format as real flags, since an
unrecognized flag fails with a CLI usage error before any JSON is emitted at all.
S6505 (--ignore-scripts) and S8543 (pin versions) both conflict with what this line is for: opencode-ai's postinstall script symlinks its real binary (so --ignore-scripts breaks the install), and the job exists specifically to test against latest to catch upstream CLI drift (so pinning defeats its purpose). Suppressed via sonar.issue.ignore.multicriteria in the scanner begin step rather than left unexplained/red.
PR #61 added --verbose to ClaudeAgent.BuildInvocation (claude now requires it alongside --print --output-format stream-json). This branch's bats file hardcodes that same invocation shape to test the real CLI directly, so it needs the same flag or every claude test here fails on a CLI usage error that the assert_auth_failure check correctly refuses to treat as an auth failure.
|
3 tasks
Owner
Author
|
Superseded by #63 + #64: instead of a bats script invoking the real agent CLIs with hand-copied argument lists (which drifted from |
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
agent-plumbingjob inci.yml: installs the realopencodeandclaudeCLIs via npm and invokes them with the exact flag shapesOpenCodeAgent/ClaudeAgentconstruct, with no API key set.--modelis expected to actually succeed (validates the free-default-model assumption for real, not mocked).Split out from #61 per request, so the model/provider-passthrough change and its live CI coverage can be reviewed independently.
Test plan
batsinterpreter — parses/executes correctly (fails only on "command not found" since opencode/claude aren't installed in this sandbox)shellcheckcleanpython3 -c "import yaml; yaml.safe_load(...)")