Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def build_command(harness: str, model: str, prompt: str, cwd: str) -> List[str]:
return shlex.split(override) + [prompt]

if harness == "claude":
return ["claude", "-p", prompt, "--output-format", "stream-json", "--model", model]
# --verbose is mandatory with --print + stream-json, else claude errors out.
return ["claude", "-p", prompt, "--output-format", "stream-json", "--verbose", "--model", model]
if harness == "opencode":
return ["opencode", "run", prompt, "--model", model, "--format", "json"]
if harness == "cursor":
Expand Down Expand Up @@ -198,7 +199,7 @@ def _demo() -> None:
"""Self-check: build_command shapes, parse_stream, and a fail-open run
against a nonexistent binary. Run: python3 scripts/harness.py"""
cmd = build_command("claude", "sonnet", "hello", "/tmp")
assert cmd == ["claude", "-p", "hello", "--output-format", "stream-json", "--model", "sonnet"], cmd
assert cmd == ["claude", "-p", "hello", "--output-format", "stream-json", "--verbose", "--model", "sonnet"], cmd

parsed = parse_stream("claude", ['{"type":"result","tokens":5,"cost_usd":0.0}'])
assert parsed["status"] == "done" and parsed["tokens"] == 5, parsed
Expand Down
2 changes: 1 addition & 1 deletion tests/test_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_claude_shape(self):
cmd = harness.build_command("claude", "sonnet", "do the thing", "/repo")
self.assertEqual(
cmd,
["claude", "-p", "do the thing", "--output-format", "stream-json", "--model", "sonnet"],
["claude", "-p", "do the thing", "--output-format", "stream-json", "--verbose", "--model", "sonnet"],
)

def test_opencode_shape(self):
Expand Down
Loading
Loading