]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cli: fix spinner not show during prompt processing (#24283)
authorXuan-Son Nguyen <redacted>
Mon, 8 Jun 2026 09:11:45 +0000 (11:11 +0200)
committerGitHub <redacted>
Mon, 8 Jun 2026 09:11:45 +0000 (11:11 +0200)
tools/cli/cli.cpp

index e830f262de2b77859c50d9f1083dded3e9105ec7..a164b3bb910c336a51deca5200f9e64c7ffd7906 100644 (file)
@@ -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<server_task_result_cmpl_partial *>(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;