Skip to content

DebugCapture

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/core/debugCapture.d.ts:62

Debug-capture sink for the TUI’s /debug panel.

A DebugCapture is an OPT-IN callback the TUI sets on a live agent after init (on the shared import(‘#src/core/GthAbstractAgent.js’).GthAbstractAgent base, so both the lean and deep backends support it). When present, the agent’s wrapModelCall middleware reports, per model call:

  • requestrequest.messages: BaseMessage[], the real history sent to the model at call time (post-summarization / post-middleware), plus the DebugRequestExtras (tools, system prompt, model params) that also shape the turn. This is exactly what the model saw.
  • response — the resolved AIMessage returned by the handler, captured as a whole (resolved message, not per-chunk frames; keeps the streaming core untouched).

The sink is read lazily inside the middleware (per call), so when no TUI debug panel is attached the middleware is a transparent pass-through and the normal path pays nothing.

optional onRequest(messages, extras?): void

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/core/debugCapture.d.ts:64

The full message history sent to the model for this call, plus the request extras.

BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]

DebugRequestExtras

void


optional onResponse(response): void

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/core/debugCapture.d.ts:66

The resolved model response for this call (an AIMessage).

unknown

void