MCPcopy Create free account
hub / github.com/codehamr/codehamr / Init

Method Init

internal/tui/model.go:359–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357 // appears uncollapsed, the right tradeoff for a cat-friendly history file.
358 m.promptHistory = loadPromptHistory(cfg.Dir)
359 return m
360}
361
362// activeContextSize returns the context window the packer should aim at: the
363// live server-reported value for the active profile if known, else the on-disk
364// ContextSize, else defaultPackFallback, so cloud profiles before their first
365// response (and any missing/zero value) still get a sensible budget.
366func (m *Model) activeContextSize() int {
367 if v, ok := m.liveContextSize[m.cfg.Active]; ok && v > 0 {
368 return v
369 }
370 if v := m.cfg.ActiveProfile().ContextSize; v > 0 {
371 return v
372 }
373 return defaultPackFallback
374}
375
376// defaultPackFallback is the conservative window used until the server reports

Callers

nothing calls this directly

Calls 4

pingBackendFunction · 0.85
probeBackendFunction · 0.85
ActiveProfileMethod · 0.80
ResolvedKeyMethod · 0.80

Tested by

no test coverage detected