mirror of
https://github.com/obra/superpowers.git
synced 2026-11-06 15:16:30 +00:00
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 |
||
|---|---|---|
| .. | ||
| test-pi-extension.mjs | ||