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

Struct Event

internal/llm/llm.go:123–143  ·  view source on GitHub ↗

Event is what the TUI consumes. One event per stream update.

Source from the content-addressed store, hash-verified

121 // round-trips into the assistant message: it has no place in history.
122 Reasoning string `json:"reasoning,omitempty"`
123 ToolCalls []toolCall `json:"tool_calls,omitempty"`
124}
125
126// Event is what the TUI consumes. One event per stream update.
127type Event struct {
128 Kind EventKind
129 Content string
130 // ContextWindow is the server-authoritative context size from the
131 // X-Context-Window header, set only on EventDone when the server sent it.
132 // The TUI records it in a runtime-only per-profile map (tui.Model's
133 // liveContextSize) that outranks the profile's on-disk ContextSize, so the
134 // next ctx.Pack uses what the server allows without the live value ever
135 // reaching config.yaml. Zero means no live value in this response.
136 ContextWindow int
137 ToolCall *chmctx.ToolCall
138 Final *chmctx.Message
139 Budget cloud.BudgetStatus
140 Tokens int
141 // PromptTokens is the server-counted prompt size from usage.prompt_tokens,
142 // set only on EventDone when the server reported usage. Debug-log
143 // calibration only (actual vs the char/4 packing estimate); it drives no
144 // behavior. Zero means the server didn't report it.
145 PromptTokens int
146 Elapsed time.Duration

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected