From 715b86a3663648211347d2bb0cf3beb8fc057f2b Mon Sep 17 00:00:00 2001 From: Xuan-Son Nguyen Date: Mon, 8 Jun 2026 11:11:45 +0200 Subject: [PATCH] cli: fix spinner not show during prompt processing (#24283) --- tools/cli/cli.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/cli/cli.cpp b/tools/cli/cli.cpp index e830f262de..a164b3bb91 100644 --- a/tools/cli/cli.cpp +++ b/tools/cli/cli.cpp @@ -128,7 +128,18 @@ struct cli_context { console::spinner::start(); server_task_result_ptr result = rd.next(should_stop); - console::spinner::stop(); + while (true) { + auto res_partial = dynamic_cast(result.get()); + if (res_partial && res_partial->is_begin) { + // this is the "send 200 status to client" signal in streaming mode + // skip, do not stop the spinner + result = rd.next(should_stop); + } else { + console::spinner::stop(); + break; + } + } + std::string curr_content; bool is_thinking = false;