mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 09:28:56 +00:00
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
22 lines
815 B
Python
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"
|