OpenCode agent type plugin for mngr
Project description
imbue-mngr-opencode
Plugin that registers the opencode agent type for mngr.
OpenCode is an open-source terminal-based AI
coding agent. This plugin runs it as a first-class mngr agent: an interactive
TUI with RUNNING/WAITING lifecycle reporting, conversation resume across
stop/start, mngr transcript support, and per-agent config/credential
isolation.
Usage
mngr create my-agent opencode
Pass arguments straight through to the opencode command with --:
mngr create my-agent opencode -- --model anthropic/claude-sonnet-4-5
mngr stop then mngr start resumes the agent's conversation; mngr transcript <agent> prints the conversation; mngr list reports the agent as RUNNING while
it works and WAITING when it is idle.
How it works
OpenCode is a client-server app (a server owns the sessions and event bus; TUI / CLI / HTTP clients talk to it) with SQLite-backed sessions and no POSIX-sh hook mechanism. mngr leans into that shape:
- The agent runs as a server + an attached TUI. Each agent's tmux pane runs
a launch script that starts a headless
opencode serveplus anopencode attachTUI client.mngr connectshows the attached client; the server owns the session. - Messages are sent via the server's HTTP API, not by typing into the TUI:
mngr messagePOSTs the prompt to the agent's server (prompt_async), and the attached client renders it — so the conversation is fully visible while sending stays robust (no keystroke races, no screen-scraping). - Isolation is via
OPENCODE_CONFIG_DIR(a per-agent config dir holdingopencode.json+ an auto-loaded plugin) andXDG_DATA_HOME(a per-agent data dir holding the session db,auth.json, storage, and logs), injected only on the OpenCode processes. No$HOMErelocation. - Lifecycle (RUNNING/WAITING) is maintained by a small in-process TypeScript
plugin that watches the server's event bus and touches/removes the mngr
activemarker (it runs only in the server process). It is subagent-aware: the marker clears only when the root session goes idle, so spawning task-tool subagents keeps the agent RUNNING until the whole turn finishes. waiting_reason(shown bymngr list) reports why a WAITING agent is blocked, as the claude and codex agent types do. When a tool blocks on an approval prompt (anaskpermission policy), opencode emitspermission.asked; the plugin tracks pending prompts and keeps apermissions_waitingmarker, which promotes the agent to WAITING and surfaces aPERMISSIONSreason. An idle agent whose turn is complete reportsEND_OF_TURN. Unlike codex (whose hook model fires nothing when a dialog is cancelled, briefly mislabeling the reason), answering or cancelling an opencode prompt clears the marker promptly: a denial emitspermission.repliedandsession.idle, and an abort emitssession.idle— each clears it (verified live against opencode 1.17.7).- Transcripts: the same plugin writes the raw transcript and, on session
idle, rebuilds the common-format transcript
mngr transcriptreads — both in-process, no background converter or supervisor. - Auth: the per-agent
auth.jsonsymlinks to the user's shared~/.local/share/opencode/auth.json, so oneopencode auth login(in any agent) authenticates them all.
Configuration
Define a custom variant in your mngr config (mngr config edit):
[agent_types.my_opencode]
parent_type = "opencode"
auto_allow_permissions = true
[agent_types.my_opencode.config_overrides]
model = "anthropic/claude-sonnet-4-5"
Then create agents with your custom type:
mngr create my-agent my_opencode
Options
| Option | Default | Meaning |
|---|---|---|
cli_args |
() |
Extra arguments forwarded to the opencode attach (TUI) client. |
config_overrides |
{} |
Key/value blob merged last into the per-agent opencode.json (e.g. model, the permission policy block). |
sync_global_config |
true |
Base the per-agent opencode.json on a copy of the user's ~/.config/opencode/opencode.json. |
symlink_auth |
true |
Symlink the per-agent auth.json to the shared one (one login authenticates all agents). Set false for full isolation. |
auto_allow_permissions |
false |
Inject a wildcard allow into the per-agent permission policy (auto-approve everything not explicitly denied). |
emit_common_transcript |
true |
Emit the common transcript that mngr transcript reads. |
Choosing the model
The model is read by the agent's OpenCode server from its per-agent
opencode.json, so it is set through config (format: provider/model; list
options with opencode models). Three ways, highest precedence first:
-
Per agent-type --
config_overrides.modelon anopencodevariant (the TOML example above). Applies to every agent of that type. -
On the
mngr createcommand line -- mngr's generic per-invocation override reaches right intoconfig_overrides:mngr create my-agent opencode -S agent_types.opencode.config_overrides.model=anthropic/claude-sonnet-4-5
-
Globally -- the
"model"in your~/.config/opencode/opencode.json, inherited whensync_global_configistrue(the default).
Notes:
- If the model's provider isn't authenticated, OpenCode silently falls back to
a free model -- so if you set, say,
anthropic/claude-sonnet-4-5but the agent shows a free "OpenCode Zen" model, runopencode auth loginand create/restart the agent. (The free OpenCode-Zen models need no auth.) - Passing the model after
--(mngr create ... opencode -- --model X) does not work:--args go to theopencode attachclient, which has no--modelflag; the model is used by theserveprocess, fromopencode.json.
Not yet implemented
Carried gaps (shared with mngr_antigravity): session preservation on destroy,
scheduled-deploy contributions, the live streaming snapshot, and clone carrying
the source conversation forward.
See the mngr agent types documentation for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imbue_mngr_opencode-0.2.17.tar.gz.
File metadata
- Download URL: imbue_mngr_opencode-0.2.17.tar.gz
- Upload date:
- Size: 64.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79aec6e2eee8d4f37c734e26f0b4647c4e11170cb5f26ab6b0640e590adb2844
|
|
| MD5 |
08b43ef0f14d6973ebe0c790b9ba4054
|
|
| BLAKE2b-256 |
efec948cae515440f7c0c48c43149d514a6938074b25c6212eef34da12f3edd7
|
Provenance
The following attestation bundles were made for imbue_mngr_opencode-0.2.17.tar.gz:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_opencode-0.2.17.tar.gz -
Subject digest:
79aec6e2eee8d4f37c734e26f0b4647c4e11170cb5f26ab6b0640e590adb2844 - Sigstore transparency entry: 1858307717
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Branch / Tag:
refs/tags/v0.2.17 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imbue_mngr_opencode-0.2.17-py3-none-any.whl.
File metadata
- Download URL: imbue_mngr_opencode-0.2.17-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739aaf6d7967c6244617b4d1baae9a8d77178ba086766f7e1d095c7bac77fc55
|
|
| MD5 |
ac2131ed0ad023088ea5bc388318e62c
|
|
| BLAKE2b-256 |
14e869669de42868cda2f93df5c285ad03badaec707886842073203761480d6e
|
Provenance
The following attestation bundles were made for imbue_mngr_opencode-0.2.17-py3-none-any.whl:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_opencode-0.2.17-py3-none-any.whl -
Subject digest:
739aaf6d7967c6244617b4d1baae9a8d77178ba086766f7e1d095c7bac77fc55 - Sigstore transparency entry: 1858308047
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Branch / Tag:
refs/tags/v0.2.17 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Trigger Event:
push
-
Statement type: