Add previousSummary to before_compact hook event

This commit is contained in:
Mario Zechner 2025-12-24 12:47:12 +01:00
parent 97bbd7a642
commit 403faafdbe
5 changed files with 29 additions and 2 deletions

View file

@ -5,6 +5,7 @@
### Added
- **Compaction hook improvements**: The `before_compact` session event now includes:
- `previousSummary`: Summary from the last compaction (if any), so hooks can preserve accumulated context
- `messagesToKeep`: Messages that will be kept after the summary (recent turns), in addition to `messagesToSummarize`
- `resolveApiKey`: Function to resolve API keys for any model (checks settings, OAuth, env vars)
- Removed `apiKey` string in favor of `resolveApiKey` for more flexibility