fix(context): show both summarize and compress thresholds in /context

The /context command previously showed only the hard budget compression
threshold (contextWindow - maxTokens), which confused users who expected
to see the soft summarization trigger from summarize_token_percent.

This commit adds SummarizeAtTokens alongside the existing CompressAtTokens
so that both thresholds are visible:

- Compress at: contextWindow - maxTokens (hard budget, triggers proactive
  compression when exceeded)
- Summarize at: contextWindow * summarizeTokenPercent / 100 (soft trigger,
  matches maybeSummarize's threshold)

The fix updates the /context command output, the Web UI popover, and the
pico channel WebSocket payload.

Fixes #2968
This commit is contained in:
程智超0668000959 committed 2026-06-04 11:03:16 +08:00
1 parent 709c8b2b52
commit 5f826f4448
9 files changed
+57 -24

No files matched your search

@@ -79,6 +79,7 @@ function parseContextUsage(
used_tokens: used,
total_tokens: total,
compress_at_tokens: Number(obj.compress_at_tokens) || 0,
summarize_at_tokens: obj.summarize_at_tokens != null ? Number(obj.summarize_at_tokens) : undefined,
used_percent: Number(obj.used_percent) || 0,
}
}