mirror of
https://github.com/obra/superpowers.git
synced 2026-08-05 21:58:46 +08:00
fix(codex): restore Superpowers after compaction
Codex re-fires SessionStart with source "compact" after every context compaction; the summary keeps progress but sheds the bootstrap and any active skill's instructions — measured July cause of post-compaction dispatch drift in long SDD runs (with re-injection: 18/18 hook fires, 66/66 post-compaction dispatch tuples correct in a 12.4h stress run). Codex discovers skills natively at startup, so the hook is silent there: the compact re-fire is the one unowned lifecycle point. Adds the plugin-provided hook (hooks-codex.json + session-start-codex, compact-only, fails open), wires it into the manifest and package, documents install/trust behavior, updates codex-tools.md with the re-grounding fallback, and tests the hook lifecycle, manifest, and archive contents. Rebuilt from the July codex-spinout-fixes branch, pared to the hook core: the dispatch-hints layer it used to ride with is superseded by the merged 2059-2062/2077-2080 stack and is dropped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,22 @@ default_subagent_model = "<a mid-tier model from your spawn allowlist>"
|
||||
default_subagent_reasoning_effort = "medium"
|
||||
```
|
||||
|
||||
## Compaction sheds these instructions
|
||||
|
||||
Context compaction replaces your transcript with a summary that keeps
|
||||
your progress but not your working instructions — the first
|
||||
post-compaction dispatch is where routing drift starts, and once one
|
||||
bare spawn lands, the broken pattern becomes its own precedent. The
|
||||
plugin ships a compaction re-injection hook (`hooks/hooks-codex.json`,
|
||||
Codex 0.145+) that restores the bootstrap after every compaction; it
|
||||
needs one-time trust approval, so if you never see a
|
||||
`<CONTEXT_RESTORED>` block after a compaction, tell your human partner
|
||||
the hook may be untrusted or unsupported on this version. Without it,
|
||||
re-ground yourself: when a summary appears in your context, re-read
|
||||
this file and the SKILL.md of the skill you are mid-way through
|
||||
executing before your next dispatch, and trust the ledger over your
|
||||
summarized memory of what happened.
|
||||
|
||||
## Environment Detection
|
||||
|
||||
Skills that create worktrees or finish branches should detect their
|
||||
|
||||
Reference in New Issue
Block a user