Skip to content

Agent Zero AI framework

Keep empty response warnings out of history

linkliti84ed5bfb5cbc
diff --git a/extensions/python/message_loop_result/AGENTS.md b/extensions/python/message_loop_result/AGENTS.md
index d07be1e1d..534972d61 100644
--- a/extensions/python/message_loop_result/AGENTS.md
+++ b/extensions/python/message_loop_result/AGENTS.md
@@ -7,7 +7,7 @@
## Ownership
- Extensions receive mutable `result_data` with `llm_result` and may set `skip_default_processing` after fully handling the turn.
-- `_20_empty_response.py` retries turns with neither response nor reasoning, using `fw.msg_empty_response.md` for history and agent-prefixed UI warning text.
+- `_20_empty_response.py` retries turns with neither response nor reasoning, using `fw.msg_empty_response.md` for agent-prefixed UI warning text only.
- `_30_repeat_response.py` retries nonempty response content that exactly matches `loop_data.last_response`, regardless of reasoning, using `fw.msg_repeat.md` for history and `fw.msg_repeat_response.md` for the agent-prefixed UI warning text.
## Local Contracts
diff --git a/extensions/python/message_loop_result/_20_empty_response.py b/extensions/python/message_loop_result/_20_empty_response.py
index 53fdc803d..3e3842911 100644
--- a/extensions/python/message_loop_result/_20_empty_response.py
+++ b/extensions/python/message_loop_result/_20_empty_response.py
@@ -29,11 +29,9 @@ class EmptyResponse(Extension):
llm_result=llm_result,
)
self.agent._remember_llm_result_state(llm_result, assistant_message)
- warning_message = self.agent.hist_add_warning(message=warning)
PrintStyle(font_color="orange", padding=True).print(warning)
self.agent.context.log.log(
type="warning",
content=f"{self.agent.agent_name}: {warning}",
- id=warning_message.id,
)
result_data["skip_default_processing"] = True
diff --git a/tests/test_message_loop_result.py b/tests/test_message_loop_result.py
index 2b32f692f..eb7faec4e 100644
--- a/tests/test_message_loop_result.py
+++ b/tests/test_message_loop_result.py
@@ -53,14 +53,8 @@ def test_empty_result_skips_default_processing():
assert _run(agent)["skip_default_processing"] is True
assert agent.history == [""]
- assert agent.warnings == ["empty"]
- assert agent.logs == [
- {
- "type": "warning",
- "content": "A0: empty",
- "id": "warning",
- }
- ]
+ assert agent.warnings == []
+ assert agent.logs == [{"type": "warning", "content": "A0: empty"}]
def test_repeat_skips_default_processing():