# Pi compaction message loss, issue 24227

Base: 27e0c684c5. Pi 1.4.0, Linux web app, Chromium headless 154, viewport 1280x800, no emulation.

1. Run the real app in isolated worktree state with a Pi provider configured with `--extension /tmp/issue-24227/compact.ts`.
2. Select Pi's `openai/gpt-6.1-sol` in a new thread, full access.
3. Submit `Reply only OK. Ignore fixture context:\n` followed by `Compaction reproduction context. ` repeated 3500 times.
4. Wait for OK. Submit `Reply only OK again. Ignore fixture context:\n` followed by the same text repeated 3500 times.
5. The extension starts native compaction one second after the second agent_end. It writes a compacting marker and holds session_before_compact for 30 seconds.
6. While held, submit `MESSAGE DURING COMPACTION: Reply exactly RECEIVED.` from the composer.
7. Base: the turn fails immediately with `Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.` No RECEIVED response appears after compaction finishes.

The extension only schedules real Pi compaction and widens its window. It does not fake RPC events or provider responses. Initial small-session attempts returned `Nothing to compact (session too small)`; the two long context turns above provide sufficient history. A first overlarge fixture was rejected by the app's 120,000-character limit and was shortened before submission.
