fix: warn instead of failing on oversized compact results

This commit is contained in:
2026-10-03 21:56:58 +09:00
parent 13bce155aa
commit 75fc7c921b
6 changed files with 180 additions and 14 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ pub const COMPACT_SUMMARY_TARGET_TOKENS: u64 = 2_000;
/// See [`crate::CompactionConfig::summary_max_tokens`].
pub const COMPACT_SUMMARY_MAX_TOKENS: u64 = 4_000;
/// Dry-run cap for the compacted session's initial request context.
/// Warning threshold for the assembled compacted history. Compaction continues.
/// See [`crate::CompactionConfig::result_context_max_tokens`].
pub const COMPACT_RESULT_CONTEXT_MAX_TOKENS: u64 = 60_000;
+3 -1
View File
@@ -965,7 +965,9 @@ pub struct CompactionConfig {
)]
pub auto_read_budget_tokens: u64,
/// Dry-run cap for the compacted session's initial request context.
/// Warning threshold for the assembled compacted history estimate, including
/// retained items and auto-read files. Exceeding it does not abort compaction;
/// request-time context safety checks still apply. `0` disables this warning.
#[serde(default = "default_result_context_max_tokens")]
pub result_context_max_tokens: u64,