mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
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:
+5
-4
@@ -64,10 +64,11 @@ type OutboundScope struct {
|
||||
// ContextUsage describes how much of the model's context window the current
|
||||
// session consumes, and how far it is from triggering compression.
|
||||
type ContextUsage struct {
|
||||
UsedTokens int `json:"used_tokens"`
|
||||
TotalTokens int `json:"total_tokens"` // model context window
|
||||
CompressAtTokens int `json:"compress_at_tokens"` // threshold that triggers compression
|
||||
UsedPercent int `json:"used_percent"` // 0-100
|
||||
UsedTokens int `json:"used_tokens"`
|
||||
TotalTokens int `json:"total_tokens"` // model context window
|
||||
CompressAtTokens int `json:"compress_at_tokens"` // hard budget compression threshold (contextWindow - maxTokens)
|
||||
SummarizeAtTokens int `json:"summarize_at_tokens"` // soft summarization trigger (contextWindow * summarizeTokenPercent / 100)
|
||||
UsedPercent int `json:"used_percent"` // 0-100, relative to compressAt
|
||||
}
|
||||
|
||||
type OutboundMessage struct {
|
||||
|
||||
Reference in New Issue
Block a user