From 540292a7cdd40dbe699de344e686423fb6ae2099 Mon Sep 17 00:00:00 2001 From: AJV20 <24819659+AJV20@users.noreply.github.com> Date: Mon, 18 May 2026 14:07:06 -0400 Subject: [PATCH] fix(chat): align WebUI context with messaging sessions --- CHANGELOG.md | 2 +- api/streaming.py | 9 +++++---- tests/test_sprint42.py | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c639dc4c..4fe24490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ ### Changed -- Add browser-surface session context to WebUI agent turns so the agent can distinguish a WebUI chat from messaging-platform transcripts while keeping the metadata ephemeral and out of saved history. +- Add browser-surface session context to WebUI agent turns so the agent can distinguish a WebUI chat from messaging-platform transcripts while keeping the metadata ephemeral and out of saved history. WebUI progress guidance now explicitly preserves the normal Hermes messaging style instead of encouraging extra browser-only status chatter. ## [v0.51.90] — 2026-05-18 — Release BN (stage-383 — 10-PR full sweep batch — empty-gateway messaging history fix + previous-messaging-sessions setting + Kanban board switcher layout + UI/UX demo theme controls + Slice 3c queue/goal RFC gate + keyless custom endpoints + custom-provider remote model catalog parity + auto-compression elapsed timer + new-conversation cold-start guard + Kanban drag-drop detail open fix) diff --git a/api/streaming.py b/api/streaming.py index a196e288..395e2b4d 100644 --- a/api/streaming.py +++ b/api/streaming.py @@ -173,9 +173,10 @@ def _clarify_timeout_seconds(default: int = 120) -> int: _CANCEL_MARKER_PATTERNS = ('task cancelled', 'task canceled', 'response interrupted') -_WEBUI_VISIBLE_PROGRESS_PROMPT = """ -WebUI progress contract: -- For multi-step work that uses tools, provide brief user-visible progress updates as normal assistant content before continuing with tool calls. +_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. - 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. @@ -224,7 +225,7 @@ def _webui_ephemeral_system_prompt( surface_prompt = _webui_surface_context_prompt(surface_context) if surface_prompt: parts.append(surface_prompt) - parts.append(_WEBUI_VISIBLE_PROGRESS_PROMPT) + parts.append(_WEBUI_PROGRESS_PROMPT) return "\n\n".join(part for part in parts if part) diff --git a/tests/test_sprint42.py b/tests/test_sprint42.py index db92f7ce..919449d9 100644 --- a/tests/test_sprint42.py +++ b/tests/test_sprint42.py @@ -389,7 +389,8 @@ class TestRuntimeRouteInjection(unittest.TestCase): init_kwargs = captured["init_kwargs"] self.assertIsNotNone(init_kwargs["interim_assistant_callback"]) self.assertTrue(callable(init_kwargs["interim_assistant_callback"])) - self.assertIn("WebUI progress contract", captured["agent"].ephemeral_system_prompt) + 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) interim_events = []