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

Function dbgWriteSession

internal/tui/debuglog.go:107–111  ·  view source on GitHub ↗

dbgWriteSession records the active backend and context budget once at startup. Behaviour differs sharply by model (different model families fail in different ways) and by context window, so a shared log must name exactly what produced it. The system prompt itself isn't dumped: it's the embedded PROM

(version, profile, model, url string, ctxSize, sysTokens int, tools []string)

Source from the content-addressed store, hash-verified

105 // msgs" line would read as if that one history message were 3k tokens.
106 tokens, truncated := 0, 0
107 for _, msg := range packed[1:] {
108 tokens += msg.Tokens()
109 if strings.Contains(msg.Content, "───── truncated:") {
110 truncated++
111 }
112 }
113 note := ""
114 if truncated > 0 {

Callers 1

NewFunction · 0.85

Calls 1

dbgWritefFunction · 0.85

Tested by

no test coverage detected