diff --git a/api/streaming.py b/api/streaming.py index 6c70234dbb..9656399241 100644 --- a/api/streaming.py +++ b/api/streaming.py @@ -194,8 +194,12 @@ def _clarify_timeout_seconds(default: int = 120) -> int: _WEBUI_PROGRESS_PROMPT = """ WebUI progress guidance: -- Match the normal Hermes messaging style; do not add extra status updates solely because this is a browser session. -- For long multi-step work that uses tools, you may provide brief user-visible progress updates before continuing with tool calls. +- Match the normal Hermes messaging style, but do not let long tool-running WebUI turns appear silent. +- For long multi-step work that uses tools, emit brief user-visible progress updates as normal assistant content, not only as hidden reasoning. +- Before the first tool batch in a long task, say what you are about to inspect. +- After each meaningful batch of tool calls, say what you just confirmed and what you will check next before continuing with more tools. +- Do not run many independent tool batches back-to-back without visible assistant text between them when the task is still ongoing. +- Do not keep progress only in reasoning, thinking, or tool-result channels; those are not a substitute for visible interim updates. - Each update should say what you are about to check, what you just confirmed, or why the next tool call is needed. - Keep updates concise, factual, and in the user's language. One or two short sentences are enough. - Do not reveal hidden reasoning, chain-of-thought, private scratchpads, secrets, raw logs, or long tool output. diff --git a/tests/test_sprint42.py b/tests/test_sprint42.py index 752c1184ea..2c6536963f 100644 --- a/tests/test_sprint42.py +++ b/tests/test_sprint42.py @@ -396,7 +396,34 @@ def path(self): self.assertTrue(callable(init_kwargs["interim_assistant_callback"])) self.assertIn("WebUI progress guidance", captured["agent"].ephemeral_system_prompt) self.assertIn("Match the normal Hermes messaging style", captured["agent"].ephemeral_system_prompt) - self.assertIn("user-visible progress updates", captured["agent"].ephemeral_system_prompt) + self.assertIn( + "do not let long tool-running WebUI turns appear silent", + captured["agent"].ephemeral_system_prompt, + ) + self.assertIn( + "emit brief user-visible progress updates as normal assistant content", + captured["agent"].ephemeral_system_prompt, + ) + self.assertIn( + "Before the first tool batch in a long task, say what you are about to inspect", + captured["agent"].ephemeral_system_prompt, + ) + self.assertIn( + "After each meaningful batch of tool calls, say what you just confirmed", + captured["agent"].ephemeral_system_prompt, + ) + self.assertIn( + "Do not run many independent tool batches back-to-back without visible assistant text between them", + captured["agent"].ephemeral_system_prompt, + ) + self.assertIn( + "Do not keep progress only in reasoning, thinking, or tool-result channels", + captured["agent"].ephemeral_system_prompt, + ) + self.assertNotIn( + "you may provide brief user-visible progress updates", + captured["agent"].ephemeral_system_prompt, + ) interim_events = [] while not fake_queue.empty():