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

Method activeContextSize

internal/tui/model.go:317–325  ·  view source on GitHub ↗

activeContextSize returns the context window the packer should aim at: the live server-reported value for the active profile if known, else the on-disk ContextSize, else defaultPackFallback, so cloud profiles before their first response (and any missing/zero value) still get a sensible budget.

()

Source from the content-addressed store, hash-verified

315
316func New(cfg *config.Config, cli *llm.Client, projectDir, version string) Model {
317 ta := newPromptInput()
318
319 // Fixed dark style: WithAutoStyle queries the terminal (OSC 11) before
320 // bubbletea grabs raw stdin, so the reply bytes leak into the textarea as
321 // "1;rgb:1e1e/1e1e/1e1e" garbage. Dev containers are dark: no query, no leak.
322 r, _ := glamour.NewTermRenderer(glamour.WithStandardStyle("dark"), glamour.WithWordWrap(defaultWidth-4))
323
324 sp := spinner.New()
325 sp.Spinner = spinner.MiniDot
326 sp.Style = styleSpinner
327
328 m := Model{

Callers 4

NewFunction · 0.95
buildMessagesMethod · 0.95
applyDoneMethod · 0.95

Calls 1

ActiveProfileMethod · 0.80

Tested by 1