← Back to PRs

#10220: feat: register compaction retry hook to prevent cascade overflow

by 1kuna open 2026-02-06 07:12 View on GitHub →
agents
## Summary Fixes #10613. Implements a compaction retry hook that prevents cascade overflow loops. When auto-compaction fires during context overflow, the retry can immediately overflow again. This hook: - Intercepts the retry before it fires - Calculates a safe token budget - Downgrades the prompt to a slim one-shot version if needed - Cancels the retry if even the slim prompt won't fit ## Dependencies Requires `setAutoCompactionRetryHook` from pi-coding-agent (PR badlogic/pi-mono#1318). ## Verification - `pnpm tsgo` passes clean with local pi-mono build - Tests included

Most Similar PRs