forked from Rockachopa/Timmy-time-dashboard
feat: migrate to Agno native HITL tool confirmation flow (#158)
Replace the homebrew regex-based tool extraction and manual dispatch (tool_executor.py) with Agno's built-in Human-In-The-Loop confirmation: - Toolkit(requires_confirmation_tools=...) marks dangerous tools - agent.run() returns RunOutput with status=paused when confirmation needed - RunRequirement.confirm()/reject() + agent.continue_run() resumes execution Dashboard and Discord vendor both use the native flow. DuckDuckGo import isolated so its absence doesn't kill all tools. Test stubs cleaned up (agno is a real dependency, only truly optional packages stubbed). 1384 tests pass in parallel (~14s). Co-authored-by: Trip T <trip@local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
574031a55c
commit
904a7c564e
@@ -1,13 +1,35 @@
|
||||
"""Shared fixtures for functional/E2E tests."""
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.request
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
# ── Un-stub agno for functional tests ─────────────────────────────────────────
|
||||
# Root conftest stubs agno with MagicMock for unit tests.
|
||||
# Functional tests need real agno (tool execution, agent creation, etc.).
|
||||
_agno_mods = [
|
||||
"agno",
|
||||
"agno.agent",
|
||||
"agno.models",
|
||||
"agno.models.ollama",
|
||||
"agno.db",
|
||||
"agno.db.sqlite",
|
||||
"agno.tools",
|
||||
"agno.tools.shell",
|
||||
"agno.tools.python",
|
||||
"agno.tools.file",
|
||||
]
|
||||
for _mod in _agno_mods:
|
||||
if _mod in sys.modules and isinstance(sys.modules[_mod], MagicMock):
|
||||
del sys.modules[_mod]
|
||||
import agno # noqa: E402 — force real import
|
||||
|
||||
# Default dashboard URL - override with DASHBOARD_URL env var
|
||||
DASHBOARD_URL = os.environ.get("DASHBOARD_URL", "http://localhost:8000")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user