mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-11 10:01:27 -10:00
Every compaction decision divides by the context window, so a window that is too small is indistinguishable from a context that is genuinely full: both just compact. Nothing exposed the number, and nothing exposed why a maintenance pass did or did not run. /context reports the window and its usable ceiling, the latest prompt (the last request's shape, never the billable retry aggregate), canonical vs model-visible size, the snip/fold/force thresholds as absolute tokens, the last pass's mode and what it reclaimed, and the blocked reason when one is recorded. The one-line summary names what happens next rather than only how full the context is. Thresholds come from compactThresholds and forceCompactThreshold, the same helpers the decision uses, so the report cannot drift from the behavior. Adding a command to two files already at their size budget would have widened the baseline, so the routing pays for itself: /new and /clear were two copies of the same goroutine-and-report block and now share runSessionVerb, and /remember moves out of the switch alongside the new /context handler. Notice texts are unchanged.
34 lines
793 B
Go
34 lines
793 B
Go
package cli
|
|
|
|
import (
|
|
tea "charm.land/bubbletea/v2"
|
|
|
|
"reasonix/internal/memory"
|
|
)
|
|
|
|
// showContextReport prints the window, the thresholds derived from it, and how
|
|
// the last maintenance pass ended. It commits a block rather than a notice
|
|
// because the numbers are meant to be compared with each other.
|
|
func (m *chatTUI) showContextReport(input string) tea.Cmd {
|
|
m.echoLocalCommand(input)
|
|
summary, detail := m.ctrl.ContextReport()
|
|
if detail != "" {
|
|
summary += "\n" + detail
|
|
}
|
|
m.commitLine(summary)
|
|
return nil
|
|
}
|
|
|
|
func (m *chatTUI) rememberNote(note string) {
|
|
if note == "" {
|
|
m.notice("nothing to remember")
|
|
return
|
|
}
|
|
path, err := m.ctrl.QuickAdd(memory.ScopeProject, note)
|
|
if err != nil {
|
|
m.notice("memory: " + err.Error())
|
|
return
|
|
}
|
|
m.notice("remembered → " + path)
|
|
}
|