From a89005768b14dff5aa2fa4e0e2f8aea0ea601674 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Thu, 4 Dec 2025 20:40:39 +0000 Subject: [PATCH] Tweak flushing --- trustgraph-cli/trustgraph/cli/invoke_agent.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trustgraph-cli/trustgraph/cli/invoke_agent.py b/trustgraph-cli/trustgraph/cli/invoke_agent.py index 6af12cd5..de70021b 100644 --- a/trustgraph-cli/trustgraph/cli/invoke_agent.py +++ b/trustgraph-cli/trustgraph/cli/invoke_agent.py @@ -161,6 +161,11 @@ def question( # Output the chunk if current_outputter: current_outputter.output(content) + # Flush word buffer after each chunk to avoid delay + if current_outputter.word_buffer: + print(current_outputter.word_buffer, end="", flush=True) + current_outputter.column += len(current_outputter.word_buffer) + current_outputter.word_buffer = "" elif chunk_type == "final-answer": print(content, end="", flush=True)