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.
Metadata
Release files for imbue-mngr-opencode 0.2.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| imbue_mngr_opencode-0.2.17.tar.gz | 64.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| imbue_mngr_opencode-0.2.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.3 kB
Release files / imbue_mngr_opencode-0.2.17.tar.gz
| Download URL | imbue_mngr_opencode-0.2.17.tar.gz |
|---|---|
| Size | 64.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79aec6e2eee8d4f37c734e26f0b4647c4e11170cb5f26ab6b0640e590adb2844
|
|
BLAKE2b-256 checksum How to use checksums |
efec948cae515440f7c0c48c43149d514a6938074b25c6212eef34da12f3edd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency logRelease files / imbue_mngr_opencode-0.2.17-py3-none-any.whl
| Download URL | imbue_mngr_opencode-0.2.17-py3-none-any.whl |
|---|---|
| Size | 36.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
739aaf6d7967c6244617b4d1baae9a8d77178ba086766f7e1d095c7bac77fc55
|
|
BLAKE2b-256 checksum How to use checksums |
14e869669de42868cda2f93df5c285ad03badaec707886842073203761480d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency log