mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
OpenCode: bootstrap injection can reset custom agent to build (possible noReply interaction) #226
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#226
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?
OpenCode + Superpowers: custom agent resets to
buildon first prompt (hypothesis + suggested fix)Summary
After installing the Superpowers plugin (git clone method), OpenCode sometimes appears to ignore a manually selected custom agent and silently revert the session to the default
buildagent on the first prompt of a new session.This document is written as a working hypothesis + proposal for discussion, not a definitive upstream diagnosis.
Symptom
build.Suspected trigger (hypothesis)
Superpowers injects bootstrap instructions early in the session lifecycle using a programmatic prompt insertion:
client.session.prompt({ noReply: true, ... })duringsession.createdThere is active upstream discussion that
noReply: trueprompts can interact with OpenCode’s agent/model selection logic (see anomalyco/opencode#4475). Based on that, it seems plausible that the synthetic bootstrap injection:build, and/orbuild, clobbering a user’s selection for the next turn.(Again: this is a plausible explanation based on observed behavior and upstream chatter, not a confirmed root cause.)
Suggested mitigation (proposal)
Instead of inserting a synthetic
noReplymessage into the chat transcript at session start, consider injecting the Superpowers instructions via OpenCode’s system prompt transform hook (supported in newer OpenCode versions):experimental.chat.system.transformRationale:
noReplymessage insertion for persistence.build.Sketch of the approach
Local experiment
In a local patch of
.opencode/plugin/superpowers.js, disabling thesession.createdbootstrap prompt injection and usingexperimental.chat.system.transforminstead appears to prevent the agent switch in my environment.This likely indicates the bug is tied to the message-insertion approach rather than the Superpowers content itself.
References
In #187 there's an alternative angle of approach
In #187 there's an alternative angle of approach
am i missing something, i do not see how this solves the super power prompt injection? or would we just not add a system level prompt that instruct each agent that he has super powers, without the need for discovering and loading skills ?
am i missing something, i do not see how this solves the super power prompt injection? or would we just not add a system level prompt that instruct each agent that he has super powers, without the need for discovering and loading skills ?
My understanding of superpowers is that this is a set of skills and commands and the OpenCode plugin teaches OpenCode to use the skills (with additional skills usage reinforcement by the system prompt).
If OpenCode supports skills and commands out of the box, I would think that (after necessary changes) OpenCode part of superpowers could turn into a set of files without much else needed, is that right?
My understanding of superpowers is that this is a set of skills and commands and the OpenCode plugin teaches OpenCode to use the skills (with additional skills usage reinforcement by the system prompt).
If OpenCode supports skills and commands out of the box, I would think that (after necessary changes) OpenCode part of superpowers could turn into a set of files without much else needed, is that right?
Yes, this is correct although it is important that skills are not always loaded, so if we want to make sure that superpowers are available one could inject the short description of each skill.
Skills are loaded via the find_skill tool so not always reliable
I think we could also make the plugin announce the skills, without the need for physical files, at least for commands that is possible
Yes, this is correct although it is important that skills are not always loaded, so if we want to make sure that superpowers are available one could inject the short description of each skill.
Skills are loaded via the find_skill tool so not always reliable
I think we could also make the plugin announce the skills, without the need for physical files, at least for commands that is possible
OK, I've had a better look through the repo - I didn't realize that the Claude path of the plugin also injects the "You have superpowers." text. You're right then that while the other issue will make the OpenCode path cleaner and adhering to the standard, your fix will 100% continue to have merit for OpenCode path.
OK, I've had a better look through the repo - I didn't realize that the Claude path of the plugin also injects the "You have superpowers." text. You're right then that while the other issue will make the OpenCode path cleaner and adhering to the standard, your fix will 100% continue to have merit for OpenCode path.
Fixed in PR #330.
The fix uses
experimental.chat.system.transformhook instead ofsession.prompt({ noReply: true }), which avoids the agent reset side effect.