feat(eval): add OpenCode agent harness - #56
Closed
Rodriguespn wants to merge 2 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Rodriguespn
force-pushed
the
pedrorodrigues/add-opencode-agent-support
branch
from
July 24, 2026 00:10
4d54c4a to
f51aef4
Compare
Rodriguespn
commented
Jul 24, 2026
Contributor
Author
There was a problem hiding this comment.
Tried running Kimi K3 locally but ran out of credits. Will need to upgrade my account to try again
Rodriguespn
commented
Jul 24, 2026
Rodriguespn
marked this pull request as ready for review
July 24, 2026 01:04
Rodriguespn
force-pushed
the
pedrorodrigues/add-opencode-agent-support
branch
from
July 24, 2026 15:01
e9a0971 to
a19a53a
Compare
Rodriguespn
changed the base branch from
main
to
explore/ai-gateway-vendor-provider
July 24, 2026 15:02
AI-964 AI spike for OpenCode support in evals
Prototype OpenCode support in evals. Context from the discussion: this seemed worth exploring ahead of launch, especially since OpenCode is open source. One possible tradeoff mentioned was substituting GPT-5.4-mini for a different harness if needed. AI-967 Add Kimi K3 to public evals benchmark
Add the Kimi K3 model to the public evals benchmark. The intended path is via Vercel AI Gateway and through OpenCode. |
Adds `opencode` (OpenCode CLI) as an eval agent on the agents framework: an agents/opencode module (runner + parser + factory + registry definition) plus experiments. Orchestration is unchanged; opencode's transcript is parsed into the same surface scorers use. Runs in both modes, like Claude Code / Codex. - runner.ts: install `opencode-ai`, then `opencode run <msg> --format json --dangerously-skip-permissions < /dev/null` (opencode blocks on stdin otherwise). Multi-provider: `provider/model` ids typed from the vendor SDKs (anthropic/openai/google); `apiKeyEnvVar` + `modelProvider` resolved from the prefix. MCP written to an OPENCODE_CONFIG file in scratch. - parser.ts: the 1.15 JSONL schema (text / tool_use / reasoning / error / step_*), paired tool_call + tool_result by callID. - engine.ts + types.ts: multi-provider CLIs carry an optional `modelProvider`; the engine prefers it over the per-agent-id mapping. `requireApiKey` uses the shared `requireEnv`. - eval-metadata: `opencode` harness id; `google` model provider. - Experiments: opencode-claude-sonnet-5, opencode-gpt-5.4-mini, opencode-gemini-flash. Adds @ai-sdk/google for the Gemini model-id types. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rodriguespn
force-pushed
the
pedrorodrigues/add-opencode-agent-support
branch
from
July 24, 2026 18:02
cead22f to
6ec3fec
Compare
Rodriguespn
changed the base branch from
explore/ai-gateway-vendor-provider
to
main
July 24, 2026 18:03
Contributor
Author
|
Closing in favor of #126 |
mattrossman
added a commit
that referenced
this pull request
Jul 28, 2026
…way (#126) Adds `opencode` as a CLI agent harness plus two experiments running Kimi K3 through the [Vercel AI Gateway](https://vercel.com/ai-gateway): `opencode-kimi-k3` and `opencode-kimi-k3-no-skills`. Consolidates parts of #56, #120, and #124 per [this thread](https://supabase.slack.com/archives/C0BAGJBL49E/p1784919389986449?thread_ts=1784890581.560609&cid=C0BAGJBL49E). AI gateway is used only for OpenCode w/ the new experiments. Uses OpenCode's [native `vercel` provider](https://vercel.com/docs/ai-gateway/coding-agents/opencode), so the only credential is `AI_GATEWAY_API_KEY` which is already configured in repo secrets. The CLI is pinned to 1.18.5 and must stay >= 1.17.0. Older versions don't await the run event loop ([opencode#31389](anomalyco/opencode#31389)) and intermittently exit mid-step with no final report, which was failing about half of sandbox runs regardless of model. Failures like that used to be invisible: results JSON just showed an empty transcript with `stoppedReason: "error"`. Running with `--debug` now prints opencode's actual errors, which is how this was diagnosed: ``` OpenCode error event: {"name":"UnknownError","data":{"message":"Unexpected server error. Check server logs for details.","ref":"err_1ffd1f34"}} ``` Incidental fix: eval refresh jobs now fail when the experiment writes no result instead of green-skipping (surfaced by a missing `AI_GATEWAY_API_KEY` in the workflow env, now also wired up). To test locally, add `AI_GATEWAY_API_KEY` to `.env` (create one in the [evals Vercel project](https://vercel.com/supabase/evals) under AI Gateway → API keys), then: ```sh pnpm eval -- --experiment opencode-kimi-k3 --eval investigate-db-001-table-row-counts ``` Closes AI-967, AI-964, AI-965 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Adds
opencodeas an agent.opencoderuns headless viaopencode run <msg> --format json --dangerously-skip-permissionsin the Docker sandbox.Validation
version: opencode
v1.15.7scenarios:
investigate-db-001-table-row-countsbuild-cli-001-bootstrap-appopencode-claude-sonnet-5stopopencode-gpt-5.4-ministopopencode-gemini-flashstopThe results were the same for both scenarios
Note: Tested with the models above but we don't have to go with these three + Kimi K3
Ref AI-964, AI-967