@madsoftwaredev/opencode-background-subagent
v0.1.2
Published
OpenCode V2 plugin that makes omitted subagent.background calls run in the background.
Maintainers
Readme
@madsoftwaredev/opencode-background-subagent
opencode plugin add @madsoftwaredev/opencode-background-subagentbackground-subagent makes the native V2 subagent tool run in the
background when the caller omits background. This is a dispatch default, not
a new subagent implementation.
Behavior
- Omitted
backgroundbecomestrue. - Explicit
background: falseremains foreground for dependent work. - Explicit
background: trueremains unchanged. - The wrapper does not change the child agent, prompt, permissions, or tool result. OpenCode still returns and tracks the native child session ID.
- The tool description tells agents to use foreground execution when the next parent step depends on the child result.
OpenCode V2 has no configuration field for a global background-subagent
default. This plugin uses the supported tool.transform API to wrap the
built-in tool.
Reload
Reload after changing the server entrypoint. The reload endpoint rebuilds every loaded location and cancels pending permission requests and forms; running sessions continue with fresh services at their next step boundary:
opencode api post /api/location/reload
opencode api get /api/pluginLook for background-subagent. A service restart is not required.
Local check
From the repository root:
bun test ./packages/background-subagent/index.test.js
bun build ./packages/background-subagent/index.ts --target=bun --external '@opencode/*'License
MIT
