From ae030c32dacdaafeb58147571a1c2e9dbc1d5c03 Mon Sep 17 00:00:00 2001 From: Ross Morsali Date: Sun, 25 Jan 2026 20:11:57 +0100 Subject: [PATCH] fix: emit assistant event for CLI backend responses in TUI CLI backends (claude-cli etc) don't emit streaming assistant events, causing TUI to show "(no output)" despite correct processing. Now emits assistant event with final text before lifecycle end so server-chat buffer gets populated for WebSocket clients. --- src/auto-reply/reply/agent-runner-execution.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/auto-reply/reply/agent-runner-execution.ts b/src/auto-reply/reply/agent-runner-execution.ts index a428aa6da..47c45b09d 100644 --- a/src/auto-reply/reply/agent-runner-execution.ts +++ b/src/auto-reply/reply/agent-runner-execution.ts @@ -179,6 +179,17 @@ export async function runAgentTurnWithFallback(params: { images: params.opts?.images, }) .then((result) => { + // CLI backends don't emit streaming assistant events, so we need to + // emit one with the final text so server-chat can populate its buffer + // and send the response to TUI/WebSocket clients. + const cliText = result.payloads?.[0]?.text?.trim(); + if (cliText) { + emitAgentEvent({ + runId, + stream: "assistant", + data: { text: cliText }, + }); + } emitAgentEvent({ runId, stream: "lifecycle",