# Upgrade Guide — v0.28.40

<!-- bump: patch -->

## What Changed

**Injected recovery prompt now instructs the agent to re-orient on topic history first, inform the user that compaction occurred, and then continue.**

The prompt the CompactionSentinel injects after detection was previously:

    please read the previous messages in this topic and continue

That got the agent reading history but left two gaps: (a) the user never learned that a compaction happened — the agent would appear to mysteriously shift tone/awareness with no explanation, and (b) the single-sentence instruction didn't make the re-orient-first ordering explicit, so the agent sometimes replied from a blank slate before reading history.

New prompt:

    Your session just went through context compaction. Read the recent messages in this topic to re-orient, briefly let the user know compaction occurred, then continue where you left off.

Three explicit steps in order: orient (read history), acknowledge (tell the user), continue (pick up the thread). The user-facing acknowledgment is explicit — if an invisible context wipe happens, the user should know.

Applies to all three recovery trigger paths (PreCompact hook event, watchdog compaction-idle poll, recovery-hook endpoint) via the shared `COMPACTION_RESUME_PROMPT` constant in `server.ts`.

## What to Tell Your User

- **You'll know when my context gets compressed now**: "If my conversation hits the context limit and gets auto-summarized mid-thread, I'll briefly tell you that happened when I pick back up — instead of just silently continuing like nothing changed."

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| User notification on compaction recovery | automatic — the agent announces when compaction occurred on its next response |
| Explicit re-orient-first ordering | automatic — the injected prompt tells the agent to read history before replying |
