Skip to content

feat: add OpenCode CLI support and fix evaluator paths - #8

Merged
govindhi merged 12 commits into
aws-samples:mainfrom
0xfabioo:feat/opencode-support
Sep 18, 2026
Merged

govindhi merged 12 commits into
aws-samples:mainfrom
0xfabioo:feat/opencode-support

Conversation

@0xfabioo

Copy link
Copy Markdown
Contributor

Summary

  • Add OpenCode cost tracking via CostSource.OPENCODE_JSON, target inference from the opencode binary, and JSONL step_finish parsing (provider cost + tokens across multi-step loops).
  • Support OpenCode workspace needs: {workspace} in CLI base-arg templates and automatic git init for non-repo workspaces.
  • Fix evaluator runners to use absolute workspace paths so WORKSPACE / venv paths are not double-nested when subprocesses already run with cwd=workspace.
  • Document an OpenCode runner example in config.cli-compare.example.yaml.

Test plan

  • Run a cli-compare config with an OpenCode runner (opencode run --format json --dir {workspace} ...) and confirm cost/tokens appear in the report
  • Confirm non-repo vibe tasks get a .git directory in the workspace before the CLI starts
  • Confirm pytest/script verification still finds workspace files (no double-nested WORKSPACE path)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Fabio Ferreira and others added 5 commits July 29, 2026 17:14
Introduce CostSource.OPENCODE_JSON, infer it from the opencode binary,
and sum provider cost/tokens across multi-step agent loops.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass {workspace} into CLI base-arg templates and initialize a git repo
in non-repo workspaces so CLIs like OpenCode can run.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent double-nested WORKSPACE/venv paths when subprocesses already
run with cwd set to the workspace.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document opencode_json cost inference and a sample runner using
--format json, {workspace}, and per-token fallback pricing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@0xfabioo

Copy link
Copy Markdown
Contributor Author

Hi @awssteph, anything left for this to be merged? Please let me know if I can help.

@awssteph

Copy link
Copy Markdown
Contributor

nope

@govindhi
govindhi merged commit 5651b67 into aws-samples:main Sep 18, 2026
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.

4 participants