Skip to content

Agent Zero AI framework

fix(webui): keep replayed warnings in process groups

Alessandro52421df9ec5b
diff --git a/tests/test_webui_message_window.py b/tests/test_webui_message_window.py
index a7644150f..efe2d416e 100644
--- a/tests/test_webui_message_window.py
+++ b/tests/test_webui_message_window.py
@@ -184,6 +184,18 @@ assert(windowed.newerCount === 1, "an unfollowed live append must remain availab
)
+def test_warning_replay_prefers_classified_process_group():
+ messages = (PROJECT_ROOT / "webui" / "js" / "messages.js").read_text(
+ encoding="utf-8"
+ )
+ warning_handler = messages.split(
+ "export function drawMessageWarning", maxsplit=1
+ )[1].split("export function drawMessageError", maxsplit=1)[0]
+
+ assert "arguments[0][PROCESS_GROUP_RENDER_INFO]" in warning_handler
+ assert "getLastProcessGroup(false)" in warning_handler
+
+
def test_collapsed_process_details_are_deferred_and_discarded():
messages = (PROJECT_ROOT / "webui" / "js" / "messages.js").read_text(
encoding="utf-8"
diff --git a/webui/js/AGENTS.md b/webui/js/AGENTS.md
index 61aac5de1..13bf3da47 100644
--- a/webui/js/AGENTS.md
+++ b/webui/js/AGENTS.md
@@ -56,6 +56,7 @@
- Long histories stay cached as raw log data but render a contiguous tail-first DOM window. The initial base view contains one 60-entry page; after paging, the base window contains two aligned pages, retaining the adjacent page and discarding only the far page in either direction. Visible boundaries expand to whole logical process groups so a page never reconstructs a partial group; the unit classifier must include plugin-backed process steps such as `code_exe`, and oversized groups use their own 50-step incremental window. Paging must preserve a visible anchor and occur at the scroll boundary after user intent, using passive loading indicators rather than count-bearing controls. Live entries and late content growth follow the tail until the reader deliberately moves away; historical window rebuilds must cancel pending auto-scroll effects, render in an off-screen staging history, and atomically swap fully laid-out content into the live scroller before restoring its anchor.
- Message-window cache identity must keep different log types distinct even when they share a backend ID; root-agent GEN and response records intentionally use the same ID and must both survive replay, while same-ID/same-type updates still replace their earlier cached version.
- Utility records join a process render unit only when a substantive process step follows before the next standalone boundary. Group visibility must use that full-log classification rather than infer utility-only state from partially mounted DOM children. Standalone utility-only runs must not wrap root responses or reopen completed groups, and their group chrome stays hidden unless utility messages are enabled.
+- Warnings classified into a full-log process render unit must remain process steps during replay even when the current DOM tail is already complete; use the live DOM tail only when render metadata is unavailable.
- `set_messages_after_loop` receives offscreen live updates as results with `result.virtualized === true` and `result.element === null`; extensions that only need `args` may still react, while DOM-mutating extensions must guard the element.
- Context switches, log GUID resets, and full log snapshots must reset both message DOM and message-window cache state.
- Context switches clear stale history immediately but defer the chat loading splash for 300 ms so fast loads do not flash; slower loads fade it in and dismiss it only after the matching context snapshot finishes rendering. Stale snapshots and timers must not affect a newer switch's splash.
diff --git a/webui/js/messages.js b/webui/js/messages.js
index 12ad5aff7..580a6635f 100644
--- a/webui/js/messages.js
+++ b/webui/js/messages.js
@@ -2534,9 +2534,11 @@ export function drawMessageWarning({
].filter(Boolean)
: [];
- //if process group is running, append there
- const group = getLastProcessGroup(false);
- if (group) {
+ // Keep replayed warnings in their classified process group.
+ if (
+ arguments[0][PROCESS_GROUP_RENDER_INFO] ||
+ getLastProcessGroup(false)
+ ) {
return drawProcessStep({
id,
title,