mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
OpenCode: Superpowers bootstrap is injected into task subagents, causing them to restart controller workflows #2160
Labels
No labels
antigravity
automated-issue-report
brainstorming
bug
claude-code
codex
copilot
cursor
documentation
duplicate
enhancement
factory
gemini-cli
good first issue
help wanted
hermes
hooks
invalid
kiro
needs-categorization
needs-rebase-to-dev-branch
needs-repro-case
new-harness
no-obvious-human-review
opencode
pi
plans
pr-template-rules-ignored
question
skill:brainstorming
skill:diagnosing-superpowers
skill:dispatching-parallel-agents
skill:executing-plans
skill:finishing-a-development-branch
skill:receiving-code-review
skill:requesting-code-review
skills
skill:subagent-driven-development
skill:systematic-debugging
skill:test-driven-development
skill:using-git-worktrees
skill:using-superpowers
skill:verification-before-completion
skill:writing-plans
skill:writing-skills
stale
subagents
tdd
trae
triage
upstream-bug
windows
wontfix
worktrees
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
skills/obra-superpowers#2160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The OpenCode Superpowers plugin injects the complete
using-superpowersbootstrap into task subagent sessions as well as the primary session.
using-superpowerscontains a<SUBAGENT-STOP>instruction telling adispatched subagent to ignore the skill, but this relies on the model correctly
recognising and prioritising that instruction.
In practice this is not reliable.
I have reproduced a worker subagent receiving an already-approved, atomic
implementation task and then invoking
brainstorminginstead of executing thetask. The worker subsequently started a new design/approval cycle.
Environment
This is not specific to the models above; the issue is that correct behaviour
currently depends on model interpretation of
<SUBAGENT-STOP>.Reproduction
mechanism.
The worker receives the Superpowers bootstrap containing both:
using-superpowerswhen dispatched as a subagent;invoked before any action.
In my reproduction, the worker reasoned that implementation implied
brainstorming/test-driven-development, invoked brainstorming, and begananother design/approval cycle instead of performing the bounded task.
The parent had already completed process selection and explicitly authorised
the implementation.
Why the existing SUBAGENT-STOP is insufficient
The current OpenCode plugin injects the bootstrap through:
experimental.chat.messages.transformand does so for the first user message without structurally distinguishing a
top-level session from a task subagent.
This leaves enforcement to the LLM:
<SUBAGENT-STOP>;skill-first instructions.
That works for some models but demonstrably fails for others.
OpenCode exposes enough information to avoid model-dependent detection
OpenCode
UserMessagemetadata includes:sessionIDagentTask subagents are also created as child sessions with:
parentID: ctx.sessionIDTherefore the OpenCode adapter should be able to determine structurally whether
the current session is a child/task session rather than asking the model to
infer it.
Expected behaviour
For a task subagent executing an already-bounded assignment, Superpowers should
not inject the controller/bootstrap workflow that can restart brainstorming,
planning, approval, or other parent-level process selection.
The worker should still retain access to ordinary skills so that appropriate
execution-oriented skills can be explicitly selected or used.
This is important: simply denying the
skilltool to worker agents is not agood general workaround because useful implementation skills may be needed by
workers.
Suggested direction
In the OpenCode plugin, detect whether the message belongs to a child session
before prepending the
using-superpowersbootstrap.Conceptually:
sessionIDfrom the message;parentID, do not inject the controller bootstrap;Alternatively, inject a purpose-built worker bootstrap for child sessions
rather than the full
using-superpowerscontroller bootstrap.The important part is that subagent detection should be structural rather than
dependent on the model obeying
<SUBAGENT-STOP>.Current workaround
A local modification to the OpenCode Superpowers plugin can skip bootstrap
injection for child sessions, but this is not a sustainable workaround because
the cached plugin is replaced by normal Superpowers updates.
Confirmed — the OpenCode plugin injects the bootstrap into every session, including task children, which is what restarts controller workflows inside subagents. Fix queued on our side, coordinated with the v2 plugin work in #2106. Thanks for the report.
Confirmed — the OpenCode plugin injects the bootstrap into every session, including task children, which is what restarts controller workflows inside subagents. Fix queued on our side, coordinated with the v2 plugin work in #2106. Thanks for the report.