diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-10-22 20:52:53 +0000 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-10-22 22:56:05 +0000 |
| commit | 5802204a180e576f81a26e6c3dd2bd0b5ea675c6 (patch) | |
| tree | 674f35dffd47040abf25d4ddd6193d163d339fa1 /docs/README.opencode.md | |
| parent | b58deb3b948d4c305feeac122700100419ee2777 (diff) | |
fix(pi): inject the bootstrap on every prompt, not just the first (#2083)fix/2083-pi-bootstrap-every-turn
The pi extension cleared injectBootstrap on agent_end, assuming it marked
the end of a session. pi emits agent_end at the end of every agent run,
which is once per user prompt, so from the second prompt on no provider
request carried the using-superpowers bootstrap.
The messages a context handler returns are sent to the provider but are
not written to session history, so the bootstrap is never in
event.messages on a later call and the existing marker check cannot see
an earlier injection. The bootstrap therefore has to be injected into
every provider request. Removing the agent_end disarm does exactly that,
one copy per request at a stable position at the start of the messages.
Observed against pi 0.85.1 with a local stub OpenAI-compatible provider,
one session of three prompts (the second makes a tool call): before, only
request 1 of 4 carried the bootstrap; after, all 4 carry exactly one copy.
The test that asserted the disarm as intended behaviour is replaced by
one that drives pi's per-prompt lifecycle events across several prompts
and provider requests. The porting guide described the agent_end reset
as the pattern to copy and now describes the failure instead.
Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
Diffstat (limited to 'docs/README.opencode.md')
0 files changed, 0 insertions, 0 deletions
