Files
agent-zero/tests/test_warning_log_prefixes.py
linkliti ebac0eb836 fix(ui): drop agent prefix from warning log rows
Framework warning log rows no longer repeat the agent name before the message text, covering tool and execution errors, the misformat notice, and the truncated, empty, repeat and fallback response warnings. A source-level regression test keeps the warning rows prefix-free, and the message-loop and context-doctor DOX and tests stop expecting the removed prefix.

Validation: pytest tests/test_warning_log_prefixes.py tests/test_tool_action_contracts.py tests/test_message_loop_result.py plugins/_context_doctor/tests/test_context_doctor.py
2026-10-21 23:37:32 +03:00

22 lines
815 B
Python

from pathlib import Path
_FILES = [
"agent.py",
"extensions/python/message_loop_result/_05_truncated_response.py",
"extensions/python/message_loop_result/_20_empty_response.py",
"extensions/python/message_loop_result/_30_repeat_response.py",
"plugins/_context_doctor/extensions/python/message_loop_result/_10_context_doctor.py",
]
def test_warning_log_rows_have_no_agent_prefix():
root = Path(__file__).resolve().parents[1]
for name in _FILES:
lines = (root / name).read_text().splitlines()
for index, line in enumerate(lines):
if 'type="warning"' not in line:
continue
span = lines[index : index + 6]
for entry in span:
assert "agent_name}" not in entry, f"{name}:{index + 1} keeps an agent prefix"