Agents: summarize dropped messages during compaction safeguard pruning (#2418)

This commit is contained in:
jigar
2026-01-27 07:35:54 +05:30
committed by Shadow
parent 7d5221bcb2
commit dde9605874
9 changed files with 177 additions and 3 deletions

View File

@@ -244,6 +244,8 @@ export type AgentCompactionConfig = {
mode?: AgentCompactionMode;
/** Minimum reserve tokens enforced for Pi compaction (0 disables the floor). */
reserveTokensFloor?: number;
/** Max share of context window for history during safeguard pruning (0.10.9, default 0.5). */
maxHistoryShare?: number;
/** Pre-compaction memory flush (agentic turn). Default: enabled. */
memoryFlush?: AgentCompactionMemoryFlushConfig;
};

View File

@@ -90,6 +90,7 @@ export const AgentDefaultsSchema = z
.object({
mode: z.union([z.literal("default"), z.literal("safeguard")]).optional(),
reserveTokensFloor: z.number().int().nonnegative().optional(),
maxHistoryShare: z.number().min(0.1).max(0.9).optional(),
memoryFlush: z
.object({
enabled: z.boolean().optional(),