An OpenCode TUI plugin that live-displays running subagents (sub-agents/tasks) in the sidebar — name, owning agent, busy/idle status, and elapsed time. Coexists with oh-my-opencode-slim (OMO-Slim) without interfering.
- TUI only (OpenCode has no
webview/activityBar; Web/desktop is unsupported). - Data sources:
session.created(identify sub-sessions viaproperties.info.parentID) +session.status(busy/idle/retry) +message.part.updated(task tool part determines completion) +session.deleted/session.error. - Collapsible sidebar section: a small
▸/▾arrow in the header toggles it on click, matching the built-in MCP/TODO sections (collapse state is driven by a solid signal for reactive re-rendering, same as the built-in sections). - Click-through: left-click a row to jump into that sub-session's context view.
- Notifications (see below): subagent-batch completion, main-session turn completion, and interview waits (question / permission), each independently toggleable, with an optional "only when unfocused" gate and Windows Action Center toast support.
- Internationalization: notification messages and the section title are localized — English (
en, default) and Simplified Chinese (zh). - Multi-plugin stacking: only uses the
sidebar_contentslot (order: 950, after OMO-Slim's 900) and never touches the single-winner slotssidebar_title/sidebar_footer.
bun install
bun run build # produces dist/index.js and dist/tui.js-
Add the dependency in
~/.config/opencode/package.json(choose one):Then run
bun install(or usebun link). -
Add the package name to the
"plugin": [...]array inopencode.json:"plugin": ["opencode-agent-pulse"]
-
Also add it to the
"plugin": [...]array intui.json(matches OMO-Slim's dual registration; ifexports["./tui"]already takes effect, the entry in tui.json can be removed). -
Restart
opencode.
The plugin can notify when a whole batch of subagents finishes and/or when the main session completes a turn. On Windows it posts a real Action Center toast via node-notifier (Windows Terminal cannot show api.attention.notify notifications — OSC 99/DEC 1004 unsupported, issue #35055); on other platforms it uses the built-in api.attention.notify with the done/subagent_done sounds.
Both notifications are enabled by default and can be toggled via plugin options (tuple form in the plugin array):
// opencode.json and/or tui.json
"plugin": [
"oh-my-opencode-slim",
["opencode-agent-pulse", { "notifications": { "subagents": true, "mainSession": false } }]
]| Option | Default | Effect |
|---|---|---|
notifications.subagents |
true |
Notify when all delegated subagents of a batch have finished |
notifications.mainSession |
true |
Notify when the main (top-level) session finishes a conversation turn |
notifications.interview |
true |
Notify when the main session is blocked waiting for user input (question / permission approval) |
notifications.onlyWhenUnfocused |
false |
Only send notifications while the terminal window is unfocused (suppresses them while you are watching). On non-Windows terminals it relies on DEC 1004 focus reporting via the renderer. On Windows, where DEC 1004 blur events are unreliable, it instead checks the Win32 foreground window (GetForegroundWindow) against the plugin's process ancestry — the terminal is focused when the foreground window belongs to an ancestor process. When focus cannot be determined (Win32 unavailable), notifications are sent as usual so nothing is silently lost |
locale |
"en" |
Language for user-facing strings (notification messages + sidebar section title). Supported values: "en" and "zh" (Simplified Chinese) |
sidebar.showFocus |
false |
Show a small diagnostic line in the sidebar section with the current focus state (focus[backend] ●focused / ○blurred fg=<pid>) — handy for verifying the onlyWhenUnfocused gate |
Set the language with the top-level locale option (it applies to both notifications and the sidebar title):
["opencode-agent-pulse", { "locale": "zh" }] // Chinese notifications + sidebar titleAfter starting opencode, trigger a subagent delegation (/agent or the Task tool) and the "Subagents" section appears in the sidebar, showing each subagent's agent, status (busy/idle/retry/done), and elapsed time in real time. Click the section header to collapse/expand it.
├── package.json # exports: "." -> server plugin, "./tui" -> TUI plugin
├── tsconfig.json # strict + @opentui/solid JSX config
├── src/
│ ├── index.ts # server plugin (placeholder; TUI side already subscribes, no duplicate state)
│ ├── tui.ts # TUI plugin: sidebar_content slot + session event subscriptions
│ ├── notification.ts # notification dispatch (non-Windows built-in vs Windows node-notifier toast)
│ ├── i18n.ts # locale strings ("en" / "zh")
│ └── windows-focus.ts # Windows-only foreground-window focus detection (bun:ffi + PowerShell fallback)
└── dist/ # bun build output
- The TUI plugin module only does
default export { id, tui }; it does not exportserverfrom the same module (the loader rejects it). - Rendering follows the same approach as OMO-Slim: local
box/texthelper functions (wrapping@opentui/solid'screateElement/insert/setProp), so no JSX/babel plugin is needed; the build uses--external @opentui/core --external @opentui/solid --external solid-jsto reuse the instances provided by the host runtime (solid-jsprovidescreateSignal, ensuring the same reactive runtime is shared with the host's@opentui/solid). - Windows notification delivery:
api.attention.notifyon Windows Terminal only plays a sound without showing a system notification (OSC 99/DEC 1004 unsupported, issue #35055). To still post a real Action Center toast on Windows, this plugin routes throughnode-notifier(which uses the bundled SnoreToast.exe) — seenotification.ts.