1
0

[loop-cycle-2] fix: suppress confirmation tool WARNING spam (#79) (#89)

This commit is contained in:
2026-03-14 17:54:58 -04:00
parent 09fcf956ec
commit 74e426c63b
2 changed files with 39 additions and 1 deletions

View File

@@ -194,3 +194,38 @@ class TestAiderTool:
catalog = get_all_available_tools()
assert "aider" in catalog
assert "forge" in catalog["aider"]["available_in"]
class TestFullToolkitConfirmationWarning:
"""Regression tests for issue #79 — confirmation tool WARNING spam."""
def test_create_full_toolkit_no_confirmation_warning(self, caplog):
"""create_full_toolkit should not emit 'Requires confirmation tool(s)' warnings.
Agno's Toolkit.__init__ validates requires_confirmation_tools against the
initial (empty) tool list. We set the attribute *after* construction to
avoid the spurious warning while keeping per-tool confirmation checks.
"""
import logging
from timmy.tools import create_full_toolkit
with caplog.at_level(logging.WARNING):
create_full_toolkit()
warning_msgs = [
r.message for r in caplog.records if "Requires confirmation tool" in r.message
]
assert warning_msgs == [], f"Unexpected confirmation warnings: {warning_msgs}"
def test_dangerous_tools_listed_for_confirmation(self):
"""After the fix, the toolkit still carries the full DANGEROUS_TOOLS list
so Agno can gate execution at runtime."""
from timmy.tool_safety import DANGEROUS_TOOLS
from timmy.tools import create_full_toolkit
toolkit = create_full_toolkit()
if toolkit is None:
pytest.skip("Agno tools not available")
assert set(toolkit.requires_confirmation_tools) == set(DANGEROUS_TOOLS)