claude_cli: request summarized thinking, skip empty thinking deltas

claude -p defaults to thinking display 'omitted' on new models, so the
thinking text was empty and the TUI showed 'thought · 0 words'. Pass
--thinking-display summarized (verified on claude 2.1.295) and drop empty
deltas.
This commit is contained in:
hermes committed 2026-10-17 09:45:20 +00:00
1 parent d69c56b3c8
commit ca819f8c90
1 file changed
+8
+8
View File
@@ -142,6 +142,10 @@ impl Provider for ClaudeCli {
"stream-json",
"--verbose",
"--include-partial-messages",
// print mode defaults to display "omitted" (empty thinking text) on new models
// ponytail: hidden flag; an older claude that rejects it needs a version probe
"--thinking-display",
"summarized",
"--model",
&req.model,
]);
@@ -199,6 +203,10 @@ impl Provider for ClaudeCli {
}
Some("thinking_delta") => {
let t = e["delta"]["thinking"].as_str().unwrap_or_default();
// omitted thinking: claude sends empty deltas (signature only)
if t.trim().is_empty() {
continue;
}
think += t;
let _ =
tx.send(Ok(StreamEvent::ThinkingDelta { text: t.into() }));