OPENCODE

An integration for OpenCode, an open-source terminal coding agent, so Coder Eval can run and score it. It connects OpenCode's streamed events to Coder Eval's standard records and supports choosing a provider and model.

In plain words
What is it for?
Use it to install OpenCode, configure authentication and model selection, run it non-interactively, and include its results in Coder Eval experiments.
Why use it?
It lets one evaluation setup compare OpenCode across different models while keeping the same sandboxed tasks and scoring process.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/uipath/coder_eval/opencode
Clone the repo
git clone --depth 1 https://github.com/UiPath/coder_eval
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,422 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.04422
Opus 5 $0.00021 $0.02211
Sonnet 5 $0.00008 $0.00884
Haiku 4.5 $0.00004 $0.00442

Measured yesterday against content hash 2811a8f3a884, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

OPENCODE scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/OPENCODE.md · 374 lines

How it starts

The opening of the file, as written. The whole thing — 374 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Running OpenCode in Coder Eval

Overview

OpenCode is an open-source terminal coding agent. Coder Eval drives it non-interactively:

opencode run --format json -m <provider/model> --dir <sandbox> --auto --pure "<prompt>"

--format json streams newline-delimited JSON events on stdout, one event per line. OpenCodeAgent reduces that stream into the standardized event protocol (AgentStart / TurnStart / ToolStart / ToolEnd / TurnEnd / AgentEnd) and lets EventCollector build the TurnRecord, exactly like every other harness.

Because OpenCode is model-agnostic, this is the cheapest way to evaluate a broad set of open-weight models (DeepSeek, Kimi, GLM, …) through a single agent.

Setup

1. Install the OpenCode CLI

OpenCode is a Node CLI, not a Python package:

npm install -g opencode-ai
opencode --version

The coder-eval[opencode] extra exists for symmetry with the other harnesses and carries no Python dependencies — the agent shells out to the binary above and imports no third-party package:

uv sync --extra opencode   # documents the opt-in; installs no extra packages

The opencode-ai package on PyPI is an HTTP client for opencode serve, a different integration surface than the CLI this harness drives. You do not need it.

If the binary is missing, the task fails at start() with an actionable error naming the install command, rather than failing obscurely mid-run.

2. Authentication

OpenCode resolves credentials itself, per provider. Either log in once:

opencode auth login

…or export the provider key, which Coder Eval forwards into the subprocess environment (it also picks up keys from .env, since config.py calls load_dotenv(override=True)):

export OPENROUTER_API_KEY="sk-or-..."   # OpenRouter (any model)
export DEEPSEEK_API_KEY="sk-..."        # DeepSeek first-party

Check what a given model id resolves to with:

Read the full file on GitHub · 374 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 374 lines · 42 tokens per session scan A 2811a8f3a884

Subscribe to this mod's changes

OPENCODE is an agent published in the GitHub repository UiPath/coder_eval (119 stars, last pushed 3d ago), licensed Apache-2.0. It adds 42 tokens to every session and 4,422 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.