Keep empty response warnings out of history
Log empty-response retries without adding a warning message to model context.
linkliti committed
Aug 24, 2026 at 22:47 UTC
84ed5bfb5cbc450735bda852f4fb4f6e045c2139
3 files changed
+3
-11
extensions/python/message_loop_result/AGENTS.md
+1
-1
@@ -7,7 +7,7 @@
7
## Ownership
8
9
- Extensions receive mutable `result_data` with `llm_result` and may set `skip_default_processing` after fully handling the turn.
10
-- `_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.
10
+- `_20_empty_response.py` retries turns with neither response nor reasoning, using `fw.msg_empty_response.md` for agent-prefixed UI warning text only.
11
- `_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.
12
13
## Local Contracts
extensions/python/message_loop_result/_20_empty_response.py
-2
@@ -29,11 +29,9 @@ class EmptyResponse(Extension):
29
llm_result=llm_result,
30
)
31
self.agent._remember_llm_result_state(llm_result, assistant_message)
32
- warning_message = self.agent.hist_add_warning(message=warning)
32
PrintStyle(font_color="orange", padding=True).print(warning)
33
self.agent.context.log.log(
34
type="warning",
35
content=f"{self.agent.agent_name}: {warning}",
37
- id=warning_message.id,
36
)
37
result_data["skip_default_processing"] = True
tests/test_message_loop_result.py
+2
-8
@@ -53,14 +53,8 @@ def test_empty_result_skips_default_processing():
53
54
assert _run(agent)["skip_default_processing"] is True
55
assert agent.history == [""]
56
- assert agent.warnings == ["empty"]
57
- assert agent.logs == [
58
- {
59
- "type": "warning",
60
- "content": "A0: empty",
61
- "id": "warning",
62
- }
63
- ]
56
+ assert agent.warnings == []
57
+ assert agent.logs == [{"type": "warning", "content": "A0: empty"}]
58
59
60
def test_repeat_skips_default_processing():