Commit Graph

2 Commits

Author SHA1 Message Date
Viktor Bozhkov
399aa8daa4 fix: remove unused imports in test file 2026-01-28 22:33:06 +00:00
Viktor Bozhkov
56170cf492 feat: auto-recover context from session history after compaction
Implements context recovery feature that automatically injects recent
messages from session history into the system prompt after a compaction
event. This makes context transitions smoother as the agent maintains
awareness of recent conversation.

Configuration:
- agents.defaults.compaction.contextRecovery.messages: number (0-50)
  Default: 0 (disabled)

When enabled:
1. After compaction, the next turn checks if recovery is needed
2. Fetches the configured number of recent messages from session transcript
3. Formats them as a 'Recent Conversation' block in the system prompt
4. Tracks which compaction was recovered to avoid duplicate recovery

Closes #3593
2026-01-28 22:06:49 +00:00