()
| 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. |
| 366 | func (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 |
nothing calls this directly
no test coverage detected