Our engineers choose the model for each task in Fabric Code. It's our fork of Kilo Code, which is itself built on OpenCode, and what an agent may touch there is config we can read in a pull request. OpenCode 2.0 is the first version where routing routine work to a cheaper model can live in a committed config and run in the background while the expensive model keeps building.
For a company whose engineers use AI coding agents, two things matter more than which model tops this month's leaderboard. One is what the agent is allowed to touch, because it's the company's code and often its customers' data. The other is the token bill, which grows with every file the agent reads, even though most of an agent's week is renames, import fixes and one more test case. I wrote in August that teams are paying frontier prices to rename a variable, and on client work both weigh more, because the code and the data are the client's, under their agreements.
So we don't run one harness. Closed ones like Claude Code give us the strongest models with no setup. At milestones a change is reviewed by a model that didn't write it, through a small wrapper that pins the model and the effort. OpenCode, through Fabric Code, is the open one in that mix: the model is ours to choose and the permission model is config we can read.
Several harnesses also means several places for rules to live. In the repository behind this website the agent rules live in AGENTS.md, and CLAUDE.md is a short file that points there, because two copies of the rules drift apart and the one that drifts is the one nobody opened. It's also why we moved our agents' shared memory into Git.
Open and closed, for client work
A harness is everything around the model. It holds the context, runs the tools, edits the files and decides what the model may touch, and it decides how much of a good model you actually get.
With a closed harness the vendor makes those decisions and sells you the result. That's a fair trade for a solo developer, and it's why we use closed harnesses too. On client work we want three decisions back. We want to choose the model for each class of task. We want a provider allowlist, so a repository under a data processing agreement can only ever reach the providers that agreement names. And we want permissions written as rules a security reviewer can read in a pull request, not described in a settings screen.
OpenCode is MIT licensed and gives us all three. The cost of open is that we carry the integration. Nobody hands us a default that works, so we pick the models, test their tool calling and own the config.
What carrying a fork costs us
Fabric Code shows the cost plainly. Every line we change in the upstream code carries a // fabriccode_change marker, and a verifier script runs on every push and every pull request to check that our patches survived. Our runbook keeps a table of the patches each merge tends to overwrite, starting with the binary's name in the build script. When we took Kilo's 7.4.11 release in July, the merge report listed 1,793 changed files, and the next day went on test fixes the merge had broken.
That's the price of choosing the model ourselves. Fabric Code hasn't taken OpenCode 2.0 yet, and when it does, the new version would come through Kilo's own merge first. So what we say about 2.0 is what we'd do on a client repository, not something we've run.
Where model routing broke for us
Routing work to the right model is half the case for an open harness, and it's where Weave, our other fork, broke in May. Weave is our fork of the opencode-weave plugin that hands work from a main agent to subagents in Fabric Code, and it took an upstream sync that replaced a file we'd patched. Its agents fell back to a hard-coded github-copilot/claude-opus-4.6, and Fabric Code refused to start them for anyone who hadn't connected that provider.
The fix in 0.8.5 fetched the provider list while the plugin was loading. Fabric Code's provider list waits for every plugin to finish loading first, so each was waiting on the other, start-up timed out after 10 seconds and the terminal came up blank. We moved the fetch out in 0.8.6.
Then 0.8.7, on 13 May, fixed the quieter bug underneath. Subagents were still resolving to github-copilot/claude-sonnet-4.6 because the resolver read the provider's full catalogue, including providers the user had never signed in to, and the model the user had picked in the terminal was never passed through. Now the resolver only offers models the user can actually call, subagents inherit the picked model, and a test fails the next upstream sync if plugin start-up calls the provider list again.
So when 2.0 says routing lives in config, the first thing we'd check is which model each subagent really ran on. We'd read it from the logs, never from the config file, and Weave now logs each agent's resolved model and warns when one isn't connected.
What 2.0 changes for us
The 2.0 release note makes OpenCode one background service that the terminal, web and desktop clients attach to. For us that's the change that matters, because a scheduled review job, a script that opens a session on a branch and an engineer's terminal can share one process, and the primary agent can hand a review to a cheaper model in the background and keep going. Code Mode, on by default for MCP servers, lets the agent call several tools from one short script. Our Fabric repositories' OpenCode configs load two MCP servers each, Aspire and Playwright, so we'd measure whether it changes anything for a setup that small before counting on it.
The config we'd propose
The OpenCode configs in our own repositories are permissive, with edits, shell commands and web fetches allowed, because the code and the data in them are ours. This is the stricter project file we'd propose for a client repository before anyone upgrades. It's in the native 2.0 shape, checked against the config, agents, permissions and policies pages.
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-opus-5-5",
"providers": {
"llama": {
"name": "llama-server (local)",
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "http://127.0.0.1:8080/v1" },
"models": {
"qwen3-coder": { "name": "Qwen3-Coder (local)", "limit": { "context": 128000, "output": 65536 } }
}
}
},
"agents": {
// Session titles never need a frontier model.
"title": { "model": "llama/qwen3-coder" },
"reviewer": {
"description": "Reviews the current changes for bugs and missing tests",
"mode": "subagent",
"model": "llama/qwen3-coder",
// Every agent starts from allow-all, so deny everything, then allow listing and reading.
// No grep: it returns file contents and is checked against the pattern, not the file.
"permissions": [
{ "action": "*", "resource": "*", "effect": "deny" },
{ "action": "read", "resource": "*", "effect": "allow" },
{ "action": "glob", "resource": "*", "effect": "allow" },
// The read allowance above would undo the built-in .env prompt, so put it back as a deny.
{ "action": "read", "resource": "*.env", "effect": "deny" },
{ "action": "read", "resource": "*.env.*", "effect": "deny" },
{ "action": "read", "resource": "*.env.example", "effect": "allow" }
]
}
},
"permissions": [
{ "action": "shell", "resource": "git push *", "effect": "ask" }
],
"experimental": {
"policies": [
{ "action": "provider.use", "resource": "*", "effect": "deny" },
{ "action": "provider.use", "resource": "anthropic", "effect": "allow" },
{ "action": "provider.use", "resource": "llama", "effect": "allow" }
]
}
}
The review command is a Markdown file beside it, .opencode/commands/review.md, following the commands page:
---
description: Review this branch in the background
agent: reviewer
subagent: true
---
Review this diff against main. Report bugs first, with file and line.
!`git diff main...HEAD`
The policies block is the part a client's security team cares about. Policies never prompt, and a broader file beats a narrower one, so a provider denied in an engineer's global config can't be switched back on by a repository. That cuts both ways. In the repository this allowlist leaves Anthropic and a model on the engineer's own machine, however many API keys are in the environment, unless a global config or an OpenCode Console workspace allows another provider. A restriction a client's agreement requires belongs in that broader place, and the committed file is the default for everyone else.
The reviewer can list and read files and do nothing else, including starting another agent or running a shell. It can't read .env files either, which matters because whatever it reads can end up in findings it hands back to the parent session. It starts with fresh context, so the command puts the diff in its prompt. The ! block runs when an engineer types /review, as that engineer, and the result goes off in a background session on the local model. The title agent is where 1.x's small_model went. 2.0 still accepts the old field, but native config names the agent.
A local model is the point for code that can't leave the building, but it's only worth it if the model handles tool calls well. A cheap model that fumbles a tool call costs more than an expensive one that doesn't, because every retry pays to read the context again. We'd prove that on a week of real reviews before moving anything that writes code.
What the routing saves
Agentic coding spends most of its money reading. The agent reads files, reads them again after an edit, and reads the context again after it compacts. So the input price is the number to compare.
Claude Opus 5.5 is $4 per million input tokens and $20 per million output on Anthropic's models page. On OpenRouter's model list on 12 October, Qwen3-Coder-Next was $0.12 in and $0.80 out, and GLM-5 was $0.60 and $1.92.
Take a review that reads 300,000 tokens of code and context and writes 10,000 tokens of findings. On Opus 5.5 that's $1.40. On Qwen3-Coder-Next it's under five cents, about thirty times cheaper. Run that review on every pull request across a team and the gap easily pays for setting up and testing the routing.
None of that argues for running everything on the cheapest model. It argues for deciding, per class of work, what the work actually needs. This is where we'd start on a client repository:
| The work | Where we'd run it | Why |
|---|---|---|
| Choosing an approach across code nobody on the team wrote | Opus 5.5, in the foreground | The expensive mistake is the wrong plan, and it's made here |
| Chasing a failure three layers from its symptom | Opus 5.5 | Needs the whole picture held at once |
| A review pass on every pull request | The reviewer subagent on an open-weight model, in the background |
Reads a lot and writes a little, so it's almost all input price |
| Tests for a function that's already specified | Open-weight | The spec is in the context, and the tests either pass or they don't |
| A rename across forty files, a changelog entry, a session title | Open-weight or local | Mechanical, and easy to check |
| Anything in a repository whose data can't leave the client's network | Local only, enforced by policy | The client's agreement decides that |
Before trusting the cheap reviewer we'd run it beside the frontier one on the same pull requests for two weeks and read every finding the cheap one missed. If what it misses is style, it stays. If it misses a bug the other caught, it goes back to reviewing tests only.
The trap we'd check first
We'd commit the config above before anyone runs opencode upgrade --major. The migration guide is clear that plugins and scripts against the old server API are the real work, and one quieter change would catch a team that wasn't looking: 2.0 reads AGENTS.md only, with no CLAUDE.md fallback. A repository whose rules live in CLAUDE.md loses them without an error. It's the drift we already arranged this website's repository around, and the fix is the one we use. Rules go in AGENTS.md, and every other file is a pointer to it.
Frequently asked questions
Why fork an open harness instead of running it as it ships?
Because we ship it as a product of our own. Fabric Code goes out as a VS Code extension and as a CLI, @fabriccode/cli, under our name, and a fork is how our changes and our branding travel with it. A team that only wants OpenCode's routing and permissions doesn't need a fork at all, and a committed config like the one above gets them both.
Do 1.x permission rules carry over to 2.0?
Mostly, under new names, according to the migration guide. bash becomes shell, task becomes subagent, and write and patch become edit. One default changed the other way: 2.0 allows external_directory where 1.x didn't, so a repository that relied on the old behaviour needs an ask rule to get it back.
Does OpenCode 2.0 still give the agent LSP diagnostics?
No. 2.0 keeps the LSP settings in a 1.x config, but the migration guide says it doesn't run language servers or produce their diagnostics. An agent that leaned on type errors from the language server should get them from a type-check command in its instructions instead.