MCPcopy Create free account
hub / github.com/diillson/chatcli / setCompressionThreshold

Method setCompressionThreshold

cli/config_compression_mutate.go:131–150  ·  view source on GitHub ↗

setCompressionThreshold changes the engage threshold (bytes) on the live layer and mirrors it to the env var for rebuilt layers.

(raw string)

Source from the content-addressed store, hash-verified

129// setCompressionThreshold changes the engage threshold (bytes) on the live
130// layer and mirrors it to the env var for rebuilt layers.
131func (cli *ChatCLI) setCompressionThreshold(raw string) {
132 if cli.compressionLayer == nil {
133 fmt.Println(colorize(" ❌ "+i18n.T("cfg.compression.unavailable"), ColorRed))
134 return
135 }
136 n, err := strconv.Atoi(strings.TrimSpace(raw))
137 if err != nil || n < 0 {
138 fmt.Println(colorize(" ❌ "+i18n.T("cfg.compression.threshold_invalid", raw), ColorRed))
139 return
140 }
141 prev := cli.compressionLayer.Threshold()
142 cli.compressionLayer.SetThreshold(n)
143 _ = os.Setenv("CHATCLI_COMPRESSION_THRESHOLD", strconv.Itoa(n))
144
145 if prev == n {
146 fmt.Println(colorize(" ✔ "+i18n.T("cfg.compression.threshold_noop", n), ColorGray))
147 } else {
148 fmt.Println(colorize(" ✔ "+i18n.T("cfg.compression.threshold_ok", prev, n), ColorGreen))
149 }
150}
151
152// pruneCompressionStore runs an on-demand curation pass over the CCR store
153// (TTL-expired entries + size-cap eviction) and reports what was freed, so the

Callers 1

Calls 4

TFunction · 0.92
colorizeFunction · 0.85
ThresholdMethod · 0.80
SetThresholdMethod · 0.80

Tested by

no test coverage detected