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.
This commit is contained in:
committed by
Peter Steinberger
parent
ffaeee4c39
commit
ae030c32da
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user