feat(preemptive-compaction): implement automatic session compaction at token threshold

Monitor token usage after assistant responses and automatically trigger session
compaction when exceeding configured threshold (default 80%). Toast notifications
provide user feedback on compaction status.

Controlled via experimental.preemptive_compaction config option.

🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-20 13:19:32 +09:00
parent 6e72173cde
commit 3c039cba49
6 changed files with 236 additions and 0 deletions
@@ -0,0 +1,3 @@
export const DEFAULT_THRESHOLD = 0.80
export const MIN_TOKENS_FOR_COMPACTION = 50_000
export const COMPACTION_COOLDOWN_MS = 60_000