-
-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Closed
Description
Summary
When auto-compaction fires during a context overflow, the retry can immediately overflow again because the compaction summary + original prompt exceed the context window. This creates a cascade loop: overflow → compact → retry → overflow → compact → retry.
Expected Behavior
After compaction, the retry should use a slim prompt that fits within the remaining budget, preventing the cascade.
Actual Behavior
The retry reuses the full original prompt, which may exceed the post-compaction context budget, triggering another compaction immediately.
Fix
PR #10220 implements a compaction retry hook that:
- 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
Depends on setAutoCompactionRetryHook being exposed by pi-coding-agent (PR badlogic/pi-mono#1318).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels