diff --git a/agent/conversation_loop.py b/agent/conversation_loop.py index fdf65c0755877..93a25e5fba03b 100644 --- a/agent/conversation_loop.py +++ b/agent/conversation_loop.py @@ -3434,6 +3434,19 @@ def _stop_spinner(): f"⚠️ Tool guardrail halted {decision.tool_name}: {decision.code}" ) messages.append({"role": "assistant", "content": final_response}) + # Emit the halt message to the client so it's not + # indistinguishable from a crash. The stream display + # was flushed (callback(None)) before tool execution, + # but the callback is still alive — fire the text + # through it so SSE/TUI clients see the explanation. + if final_response: + agent._safe_print(f"\n{final_response}\n") + if agent.stream_delta_callback: + try: + agent.stream_delta_callback(final_response) + agent.stream_delta_callback(None) + except Exception: + pass break # Reset per-turn retry counters after successful tool