Workers and OpenCode tools
The server image never runs scripts or harnesses. Workers do. A worker is a Linux host (in the alpha) that
runs azhi worker start, with the tools your workflows need.
Script runtimes
Section titled “Script runtimes”Script nodes need uv (Python 3.12) and/or Bun. The worker reports what it found, and the run plan marks anything missing as a blocker before a run starts.
Tools for OpenCode steps
Section titled “Tools for OpenCode steps”OpenCode’s search tools (grep, glob) run ripgrep. Each step gets a
fresh home folder, so without rg on the worker OpenCode downloads a copy on every step (and fails offline).
Run npx azhi setup on each worker host: it checks git, OpenCode and ripgrep and prints the install command
that fits the platform.
sudo apt install ripgrepsudo dnf install ripgrepbrew install ripgrepwinget install BurntSushi.ripgrep.MSVCThen open a new PowerShell window.
Without root, put rg in ~/.azhi/tools/bin (or $AZHI_TOOLS_DIR/bin, for a small system drive) or set
AZHI_RG_BIN. azhi doctor flags OpenCode workers without ripgrep.
Optional: token saving
Section titled “Optional: token saving”Off by default. Set AZHI_OPENCODE_TOKEN_SAVING=on on a worker, or token_saving: on|off under a profile’s
harness.opencode, to add search-first reading rules to OpenCode steps’ prompts: search with grep and glob,
read only the lines needed, never reread a file. The run’s Usage tab shows each turn’s cache share.
Optional: DCP context pruning
Section titled “Optional: DCP context pruning”npx azhi setup --dcp installs the pinned DCP
OpenCode plugin into the tools folder (about 180 MB). It is AGPL-3.0-or-later, so Azhi does not ship it.
- When token saving is on and the worker has DCP, the step loads it with update checks, notifications and slash commands off.
- DCP prunes only OpenCode’s own tool output. It never prunes the Azhi gateway tools (
azhi_*,submit_outputincluded), because their results carry the excerpt ids the model cites and the ledger records. - DCP’s settings come only from Azhi, so a checked-out repository cannot change how DCP runs.
- DCP only asks the model to compress once context is large: from 50,000 tokens, and insistently past 100,000, by
default. Change them with
AZHI_DCP_MIN_CONTEXTandAZHI_DCP_MAX_CONTEXT(a token count such as30000, or a share of the context window such as40%).
Optional: OpenCode 2 (preview)
Section titled “Optional: OpenCode 2 (preview)”Off by default. A worker started with AZHI_OPENCODE_MAJOR=2 runs OpenCode steps on OpenCode 2 through its own
adapter. npx azhi setup --opencode2 installs the pinned @opencode/cli into the tools folder (about 250 MB), or
set AZHI_OPENCODE2_BIN. It is not yet checked with real Copilot or ChatGPT accounts.
Concurrency
Section titled “Concurrency”At most 2 runs work on one repository at once; the rest wait in order. Change it per workspace with
azhi settings concurrency or the Workers page, or the server default with AZHI_MAX_RUNS_PER_REPO
(0 means no limit).