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)
| 105 | // PROMPT_SYS.md plus the working-dir anchor, both reconstructable from the repo; |
| 106 | // only its size (which feeds the packing budget) is worth recording. |
| 107 | func dbgWriteSession(version, profile, model, url string, ctxSize, sysTokens int, tools []string) { |
| 108 | dbgWritef("session", |
| 109 | "codehamr %s · profile=%s · model=%s @ %s\ncontext_size=%d tokens · system_prompt≈%d tokens · tools=[%s]", |
| 110 | version, profile, model, url, ctxSize, sysTokens, strings.Join(tools, ", ")) |
| 111 | } |
| 112 | |
| 113 | // dbgWriteRequest records, per LLM round, what newest-first packing actually |
| 114 | // sent: how much of history survived the budget and how many tool outputs are |