iCode Workbench · Harness · OpenCode
OpenCode in iCode Workbench
OpenCode is an open-source CLI coding agent built to work with many model providers. In Workbench it runs as a primary harness: each session gets its own Git worktree, the task sits in a durable queue, and the result is reviewed in the checkout where it was made.
This page is currently available in English only.
What OpenCode is good at
- Provider choice. OpenCode is designed to work with many providers, including OpenAI, DeepSeek, Kimi, Zhipu, Qwen, OpenRouter, and local or OpenAI-compatible endpoints.
- Open-source workflow. It is a terminal-native agent; you keep your provider account, your keys, and your model choice.
- Resumable sessions. OpenCode keeps its own conversation state; Workbench can resume a session by id.
Workbench changes where the session runs and how the result is tracked; it does not change OpenCode's model behavior or permissions.
Why run it in Workbench
- One worktree per session. Two OpenCode sessions in one checkout can overwrite each other; Workbench gives each its own branch and working directory.
- A durable queue. A session is a process; a task has states. Workbench tracks queued, running, waiting, completed, and failed work.
- Native provider injection. OpenCode is one of the three harnesses (with Claude Code and Codex) that support provider endpoint injection and Mira's native assistant.
- Review in place. Files, Search, and Source Control live beside the terminal, scoped to the session checkout, with line notes and a separate review decision.
Setup
- Install OpenCode using its official instructions, then confirm
opencode --versionworks in your shell. - Configure a provider in OpenCode outside Workbench and run one session, so the CLI's authentication and model selection are in place.
- Add the repository to Workbench and open it. The harness keeps its own credentials; Workbench does not store your provider keys.
If OpenCode is installed but Workbench does not see it, check that the opencode executable is on the PATH of the shell Workbench launches. On Windows, a WSL target needs OpenCode installed inside the distro, not only on Windows.
Launch and resume
Create a new session from New worktree, choose OpenCode, and give the task a scope. Workbench launches opencode in the session checkout. Each session is independent: its own branch, its own terminal, its own context.
Workbench uses OpenCode's resume recipe: --session $TOKEN when a session id was captured, and --continue as the fallback. If the app restarts, the detached host keeps the PTY alive; sleep a session to stop the process and keep the checkout, then wake it to resume where the harness supports it.
Task and review
Give the session a task statement with a goal, owned paths, a done-when command, and an out-of-scope list. When the session finishes, review the diff in its checkout: run the done-when command yourself, check files outside the owned paths, and decide accept, revise, or reject.
A completed process is not an accepted task. For the workflow, read how to review AI-generated code and how to queue coding agent tasks.
Status at a glance
The session row shows the project, branch, target, and state. OpenCode reports its running and waiting state through Workbench's native adapter; a session that cannot report stays unknown rather than guessing. Sleep a session to stop the process and keep the checkout; wake it to resume where the harness supports it.
A concrete task
Task: “Move the provider configuration into a shared module.”
- Create a worktree from main and name the branch after the task.
- Scope the session: owned paths
src/config/providers.tsand its tests; model defaults and route tables are out of scope. - Launch OpenCode in the session checkout with the task statement; its provider selection stays in the harness.
- Queue the task if you are running another session; one worktree per task.
- Review the diff in the checkout: run the config tests, check that every caller still resolves the provider, and look for a changed default.
- Decide accept, revise, or reject; merge after the combined result passes.
Provider settings are easy to change by accident. The review should confirm that the refactor moved the configuration without changing which model or endpoint a caller uses. If you use a local or self-hosted endpoint, keep it configured in OpenCode; Workbench does not proxy model traffic. The worktree and review gate are the same regardless of provider; only the agent and its model change.
Limits
- Workbench does not change the agent. OpenCode's model behavior, provider configuration, and permissions are its own.
- Desktop only. Workbench is a desktop app; there is no mobile or remote server. If you need those, Orca is the broader tool.
- Pre-1.0. Workbench is still changing; verify current behavior before standardizing a team on it.