mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-23 07:12:21 +02:00
Squash Odysseus development history
This commit is contained in:
+15
-45
@@ -12,15 +12,15 @@ Sub-modules:
|
||||
"""
|
||||
|
||||
import logging
|
||||
from collections import namedtuple
|
||||
|
||||
from src.tool_security import BUILTIN_EMAIL_TOOLS
|
||||
from src.tool_utils import _truncate, get_mcp_manager, set_mcp_manager
|
||||
from src.tool_types import TOOL_TAGS, ToolBlock
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from .subprocess_tools import BashTool, PythonTool
|
||||
from .web_tools import WebSearchTool, WebFetchTool
|
||||
from .subprocess_tools import BashTool, HostShellTool, PythonTool
|
||||
from .web_tools import WebSearchTool, WebFetchTool, PdfExtractTool, PrivateBrowserTool, YouTubeTool
|
||||
from .media_tools import ExtractTextTool, InspectMediaTool, TranscribeMediaTool
|
||||
from .filesystem_tools import ReadFileTool, WriteFileTool, EditFileTool, ApplyPatchTool, LsTool, GlobTool, GrepTool, GetWorkspaceTool
|
||||
from .coding_tools import TodoWriteTool
|
||||
from .document_tools import CreateDocumentTool, UpdateDocumentTool, EditDocumentTool, SuggestDocumentTool, ManageDocumentTool
|
||||
@@ -36,9 +36,16 @@ from .admin_tools import (
|
||||
|
||||
TOOL_HANDLERS = {
|
||||
"bash": BashTool().execute,
|
||||
"host_shell": HostShellTool().execute,
|
||||
"python": PythonTool().execute,
|
||||
"web_search": WebSearchTool().execute,
|
||||
"web_fetch": WebFetchTool().execute,
|
||||
"pdf_extract": PdfExtractTool().execute,
|
||||
"youtube_tool": YouTubeTool().execute,
|
||||
"private_browser": PrivateBrowserTool().execute,
|
||||
"inspect_media": InspectMediaTool().execute,
|
||||
"extract_text": ExtractTextTool().execute,
|
||||
"transcribe_media": TranscribeMediaTool().execute,
|
||||
"read_file": ReadFileTool().execute,
|
||||
"write_file": WriteFileTool().execute,
|
||||
"edit_file": EditFileTool().execute,
|
||||
@@ -71,50 +78,13 @@ TOOL_HANDLERS.update(ADMIN_TOOL_HANDLERS)
|
||||
# Constants (re-exported for backward compatibility — single source of truth
|
||||
# is src.constants; always prefer importing from there for new code)
|
||||
# ---------------------------------------------------------------------------
|
||||
MAX_AGENT_ROUNDS = 50
|
||||
# Keep an agent turn bounded by default. Callers can still opt into a higher
|
||||
# limit explicitly, but a stale/repeating tool loop must not consume a whole
|
||||
# session before the user gets control back.
|
||||
MAX_AGENT_ROUNDS = 20
|
||||
SHELL_TIMEOUT = 60
|
||||
PYTHON_TIMEOUT = 30
|
||||
|
||||
# Tool types that trigger execution
|
||||
TOOL_TAGS = {"bash", "python", "web_search", "web_fetch", "read_file", "write_file", "edit_file",
|
||||
"apply_patch", "todowrite",
|
||||
"grep", "glob", "ls", "get_workspace", "manage_bg_jobs",
|
||||
"create_document", "update_document", "edit_document",
|
||||
"search_chats",
|
||||
"chat_with_model", "create_session", "list_sessions",
|
||||
"send_to_session",
|
||||
"pipeline",
|
||||
"manage_session", "manage_memory", "list_models",
|
||||
"ui_control", "generate_image", "ask_user", "update_plan",
|
||||
"manage_tasks", "api_call", "ask_teacher", "manage_skills",
|
||||
"suggest_document",
|
||||
"manage_endpoints", "manage_mcp", "manage_webhooks",
|
||||
"manage_tokens", "manage_documents", "manage_settings",
|
||||
"manage_notes", "manage_calendar",
|
||||
"resolve_contact", "manage_contact",
|
||||
# Email tool names come from BUILTIN_EMAIL_TOOLS (unioned below)
|
||||
# so the fence regex, dispatch, and non-admin blocklist all cover
|
||||
# the same set.
|
||||
# Cookbook tools (LLM serving + downloads). Without these
|
||||
# entries, native function calls to e.g. list_served_models
|
||||
# are rejected as "Unknown function call" before reaching
|
||||
# the dispatcher — silent failure for the whole cookbook
|
||||
# surface.
|
||||
"download_model", "serve_model",
|
||||
"list_served_models", "stop_served_model",
|
||||
"list_downloads", "cancel_download",
|
||||
"search_hf_models", "list_cached_models",
|
||||
"list_serve_presets", "serve_preset", "adopt_served_model",
|
||||
"list_cookbook_servers",
|
||||
# Other tools the agent reaches for that were also missing.
|
||||
"edit_image", "trigger_research", "manage_research",
|
||||
# Generic loopback to any UI-button endpoint (cookbook,
|
||||
# gallery, email folders, etc.) — agent uses this when
|
||||
# there's no named tool wrapper for the action.
|
||||
"app_api"} | BUILTIN_EMAIL_TOOLS
|
||||
|
||||
ToolBlock = namedtuple("ToolBlock", ["tool_type", "content"])
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Re-exports from sub-modules
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user