fix(web): hide empty assistant boxes for tool-call-only responses

Skip rendering assistant turn when agent.message has empty text
(LLM responded with only tool calls, no message content).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-15 09:56:36 -04:00
parent 3aa5a0c32d
commit 95e7165034
No known key found for this signature in database

View file

@ -39,9 +39,11 @@ function turnsFromEvents(events: RawEvent[], stageId: string): TurnType[] {
case "stage.prompt":
turns.push({ kind: "system", content: e.properties?.text as string ?? e.text ?? "" });
break;
case "agent.message":
turns.push({ kind: "assistant", content: e.properties?.text as string ?? e.text ?? "" });
case "agent.message": {
const msg = e.properties?.text as string ?? e.text ?? "";
if (msg) turns.push({ kind: "assistant", content: msg });
break;
}
case "agent.tool.started": {
const callId = e.properties?.tool_call_id as string ?? e.tool_call_id ?? "";
pendingTools.set(callId, {