Package Exports
- opencode-orchestrator
Readme
1. Install
npm install -g opencode-orchestratorThe install hook merges OpenCode config instead of replacing it, prefers opencode.jsonc when present, preserves existing plugin tuple options, and skips automatic config mutation in CI.
To remove the plugin from OpenCode config:
npm explore -g opencode-orchestrator -- npm run cleanup:plugin
npm uninstall -g opencode-orchestratorManual fallback: remove "opencode-orchestrator" or ["opencode-orchestrator", {...}] from the plugin array in opencode.json or opencode.jsonc.
2. Configure
Tested compatibility:
- Node.js
24+ @opencode-ai/plugin1.17.4@opencode-ai/sdk1.17.4
OpenCode plugin options belong inside the plugin array as ["plugin-name", {...}] tuples. Configure agentConcurrency and missionLoop there:
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode/gpt-5.1-codex",
"permission": {
"question": "allow"
},
"agent": {
"commander": {
"model": "opencode/gpt-5.1-codex"
},
"worker": {
"model": "anthropic/claude-opus-4-5-20251101"
}
},
"plugin": [
[
"opencode-orchestrator",
{
"agentConcurrency": {
"commander": 1,
"planner": 10,
"worker": 10,
"reviewer": 10
},
"missionLoop": {
"ledger": true,
"markdownMemory": true,
"maxEvidenceEvents": 20
}
}
]
]
}Model selection follows normal OpenCode inheritance. The plugin does not force a model:
- Commander uses the global
modelunlessagent.commander.modelis set. - Planner, Worker, and Reviewer inherit the invoking primary agent model unless
agent.<name>.modelis set. - Generated Commander, Planner, Worker, and Reviewer agents inherit global permissions.
- Same-name user agent config can still override model, temperature, and specific permission keys.
Legacy top-level concurrency keys (agentConcurrency, providerConcurrency, modelConcurrency, defaultConcurrency) are still accepted for backward compatibility, but the plugin tuple is the preferred location.
3. Run
Inside OpenCode:
/task "Implement the requested change and verify it"Mission controls:
/task ...starts a persisted mission loop under.opencode/.Esc/OpenCode interrupt is respected by idle guards so the plugin does not immediately re-continue an interrupted turn./canceland/stopdeactivate the current mission loop.- The default mission iteration ceiling is
1,000,000,000.
Authorized Shell Listener TUI
For owned lab machines or explicitly authorized test environments, the bundled Rust CLI can run a multi-session TCP shell listener:
orchestrator shell-listener --bind 127.0.0.1 --port 4444The listener is intentionally outside the OpenCode JSON-RPC tool surface. It is an operator-driven terminal workflow, not an LLM-callable tool.
Safety defaults:
- Loopback-only bind by default.
- Non-loopback bind addresses require
--allow-remote. - Raw stream logs are stored under
.opencode-orchestrator/shell-listener/. - The CLI does not generate payloads, exploit targets, or bypass authentication.
TUI commands:
| Command | Purpose |
|---|---|
sessions |
Show connected sessions, peer addresses, status, and raw log paths. |
use <id> |
Select the active session. |
send <text> |
Send one input line to the active session. Use this for login, registry, CDK, or reverse-proxy prompts that need human input. |
run <cmd> |
Send a command followed by a unique sentinel marker so completion can be recognized in output. |
pty |
Send a manual PTY helper to the active session when the remote environment supports Python. |
close [id] |
Close a session. |
quit |
Stop the listener UI. |
4. How It Works
flowchart LR
U["/task input"] --> C["Commander"]
C --> P["Planner"]
C --> W["Worker pool"]
W --> R["Reviewer"]
P --> S["Mission state"]
W --> S
R --> V{"Verified?"}
V -- "no" --> C
V -- "yes" --> D["Done"]| Agent | Purpose |
|---|---|
| Commander | Interprets the mission, coordinates agents, and keeps the loop aligned. |
| Planner | Breaks work into ordered steps and tracks dependencies. |
| Worker | Implements scoped file changes with isolated context. |
| Reviewer | Checks completion evidence, tests, and integration risk. |
Runtime evidence is written only when enabled:
| Artifact | Purpose |
|---|---|
.opencode/mission-ledger.jsonl |
Bounded event trail for mission decisions. |
.opencode/docs/brain/scratchpad.md |
Generated Markdown memory surface for active missions. |
.opencode/docs/brain/knowledge-map.canvas |
Obsidian-compatible visual map of objective, evidence, and verification nodes. |
.opencode/docs/brain/memories/*.md |
Generated mission-relevant memory notes indexed by the knowledge retriever. |
5. Developer Notes
npm run build
npx tsc --noEmit
npm test
cargo test --workspace --all-targetsUseful references:
- OpenCode plugins: https://opencode.ai/docs/plugins/
- OpenCode config: https://opencode.ai/docs/config/
- OpenCode keybinds: https://opencode.ai/docs/keybinds/
- Project issues: https://github.com/agnusdei1207/opencode-orchestrator/issues
Contributions are welcome: open an issue or pull request when you find a bug, compatibility gap, or focused improvement.
Config logs:
| Platform | Path |
|---|---|
| Unix | /tmp/opencode-orchestrator.log |
| Windows | %TEMP%\opencode-orchestrator.log |
6. License
MIT License. See LICENSE.