Simplify compaction: remove proactive abort, use Agent.continue() for retry
- Add agentLoopContinue() to pi-ai for resuming from existing context - Add Agent.continue() method and transport.continue() interface - Simplify AgentSession compaction to two cases: overflow (auto-retry) and threshold (no retry) - Remove proactive mid-turn compaction abort - Merge turn prefix summary into main summary - Add isCompacting property to AgentSession and RPC state - Block input during compaction in interactive mode - Show compaction count on session resume - Rename RPC.md to rpc.md for consistency Related to #128
This commit is contained in:
@@ -267,7 +267,11 @@ Long sessions can exhaust context windows. Compaction summarizes older messages
|
||||
|
||||
**Manual:** `/compact` or `/compact Focus on the API changes`
|
||||
|
||||
**Automatic:** Enable with `/autocompact`. Triggers when context exceeds threshold.
|
||||
**Automatic:** Enable with `/autocompact`. When enabled, triggers in two cases:
|
||||
- **Overflow recovery**: LLM returns context overflow error. Compacts and auto-retries.
|
||||
- **Threshold maintenance**: Context exceeds `contextWindow - reserveTokens` after a successful turn. Compacts without retry.
|
||||
|
||||
When disabled, neither case triggers automatic compaction (use `/compact` manually if needed).
|
||||
|
||||
**How it works:**
|
||||
1. Cut point calculated to keep ~20k tokens of recent messages
|
||||
|
||||
Reference in New Issue
Block a user