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:
@@ -110,6 +110,10 @@ export const ExperimentalConfigSchema = z.object({
|
||||
aggressive_truncation: z.boolean().optional(),
|
||||
empty_message_recovery: z.boolean().optional(),
|
||||
auto_resume: z.boolean().optional(),
|
||||
/** Enable preemptive compaction at threshold (default: true) */
|
||||
preemptive_compaction: z.boolean().optional(),
|
||||
/** Threshold percentage to trigger preemptive compaction (default: 0.80) */
|
||||
preemptive_compaction_threshold: z.number().min(0.5).max(0.95).optional(),
|
||||
})
|
||||
|
||||
export const OhMyOpenCodeConfigSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user