Bug
npm run chats -- --view=N and chats-tui.ts always show 0 messages for every conversation, even successful ones. The summary list works (it reads from trace metadata), but the full conversation view is broken.
Root cause
In api/chat.js, the generationSpan is ended without logging input or output:
generationSpan?.end({
metadata: { outputTokens, inputTokens, latencyMs, cost },
})
chats.ts reads conversation content from trace.observations[0].input and trace.observations[0].output, but these are never written, so observations are always empty.
Fix
Add input and output to all three generationSpan?.end() calls (precomputed path, streaming path, and error path):
generationSpan?.end({
input: messages,
output: fullOutput,
metadata: { ... },
})
For the error path, use output: fullOutput || null since the output may be partial or empty.
Impact
The full conversation viewer (--view=N, TUI) is non-functional for all conversations. Only the one-line summary preview works.
Bug
npm run chats -- --view=Nandchats-tui.tsalways show 0 messages for every conversation, even successful ones. The summary list works (it reads from trace metadata), but the full conversation view is broken.Root cause
In
api/chat.js, thegenerationSpanis ended without logginginputoroutput:chats.tsreads conversation content fromtrace.observations[0].inputandtrace.observations[0].output, but these are never written, so observations are always empty.Fix
Add
inputandoutputto all threegenerationSpan?.end()calls (precomputed path, streaming path, and error path):For the error path, use
output: fullOutput || nullsince the output may be partial or empty.Impact
The full conversation viewer (
--view=N, TUI) is non-functional for all conversations. Only the one-line summary preview works.