fix(chat): align WebUI context with messaging sessions

This commit is contained in:
AJV20 committed 2026-05-18 14:07:06 -04:00
1 parent 5c1161f84f
commit 540292a7cd
3 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
### Changed ### 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) ## [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)
+5 -4
View File
@@ -173,9 +173,10 @@ def _clarify_timeout_seconds(default: int = 120) -> int:
_CANCEL_MARKER_PATTERNS = ('task cancelled', 'task canceled', 'response interrupted') _CANCEL_MARKER_PATTERNS = ('task cancelled', 'task canceled', 'response interrupted')
_WEBUI_VISIBLE_PROGRESS_PROMPT = """ _WEBUI_PROGRESS_PROMPT = """
WebUI progress contract: WebUI progress guidance:
- For multi-step work that uses tools, provide brief user-visible progress updates as normal assistant content before continuing with tool calls. - 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. - 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. - 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. - 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) surface_prompt = _webui_surface_context_prompt(surface_context)
if surface_prompt: if surface_prompt:
parts.append(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) return "\n\n".join(part for part in parts if part)
+2 -1
View File
@@ -389,7 +389,8 @@ class TestRuntimeRouteInjection(unittest.TestCase):
init_kwargs = captured["init_kwargs"] init_kwargs = captured["init_kwargs"]
self.assertIsNotNone(init_kwargs["interim_assistant_callback"]) self.assertIsNotNone(init_kwargs["interim_assistant_callback"])
self.assertTrue(callable(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) self.assertIn("user-visible progress updates", captured["agent"].ephemeral_system_prompt)
interim_events = [] interim_events = []