diff --git a/run_agent.py b/run_agent.py index f5834867a9c..d35857cc3f2 100644 --- a/run_agent.py +++ b/run_agent.py @@ -66,6 +66,8 @@ from hermes_constants import get_hermes_home # OpenAI lazy proxy + safe stdio + proxy URL helpers — see agent/process_bootstrap.py. # `OpenAI` is re-exported here so `patch("run_agent.OpenAI", ...)` in tests works. from agent.process_bootstrap import ( + OpenAI, # noqa: F401 # re-exported for tests that mock.patch("run_agent.OpenAI") + _SafeWriter, # noqa: F401 # re-exported for tests that `from run_agent import _SafeWriter` _get_proxy_for_base_url, ) from agent.iteration_budget import IterationBudget @@ -89,7 +91,10 @@ else: # Import our tool system from model_tools import ( + get_tool_definitions, # noqa: F401 # re-exported for tests that mock.patch("run_agent.get_tool_definitions") get_toolset_for_tool, + handle_function_call, # noqa: F401 # re-exported for tests that mock.patch("run_agent.handle_function_call") + check_toolset_requirements, # noqa: F401 # re-exported for tests that mock.patch("run_agent.check_toolset_requirements") ) from tools.terminal_tool import cleanup_vm from tools.interrupt import set_interrupt as _set_interrupt @@ -101,13 +106,21 @@ from agent.memory_manager import sanitize_context from agent.error_classifier import FailoverReason from agent.redact import redact_sensitive_text from agent.model_metadata import ( + estimate_request_tokens_rough, # noqa: F401 # re-exported for tests that mock.patch("run_agent.estimate_request_tokens_rough") is_local_endpoint, ) from agent.usage_pricing import normalize_usage # Re-exported for tests that monkeypatch these symbols on run_agent. from agent.context_compressor import ContextCompressor # noqa: F401 from agent.retry_utils import jittered_backoff # noqa: F401 -from agent.prompt_builder import build_skills_system_prompt, load_soul_md # noqa: F401 +from agent.prompt_builder import ( # noqa: F401 # re-exported via _ra() / mock.patch("run_agent.") / from run_agent import + DEFAULT_AGENT_IDENTITY, + build_skills_system_prompt, + build_context_files_prompt, + build_environment_hints, + build_nous_subscription_prompt, + load_soul_md, +) from agent.process_bootstrap import _get_proxy_from_env # noqa: F401 from agent.message_sanitization import ( # noqa: F401 _SURROGATE_RE, @@ -143,10 +156,15 @@ from agent.trajectory import ( ) from agent.tool_dispatch_helpers import ( _should_parallelize_tool_batch, + _is_destructive_command, # noqa: F401 # re-exported for tests that access `run_agent._is_destructive_command` + _extract_parallel_scope_path, # noqa: F401 # re-exported for tests that `from run_agent import _extract_parallel_scope_path` + _paths_overlap, # noqa: F401 # re-exported for tests that `from run_agent import _paths_overlap` _is_multimodal_tool_result, _multimodal_text_summary, + _append_subdir_hint_to_multimodal, # noqa: F401 # re-exported for tests that `from run_agent import _append_subdir_hint_to_multimodal` _extract_file_mutation_targets, _extract_error_preview, + _trajectory_normalize_msg, # noqa: F401 # re-exported for tests that `from run_agent import _trajectory_normalize_msg` ) from utils import atomic_json_write, base_url_host_matches, base_url_hostname diff --git a/tools/web_tools.py b/tools/web_tools.py index 33dbd39c9e6..36440b97844 100644 --- a/tools/web_tools.py +++ b/tools/web_tools.py @@ -51,7 +51,9 @@ import httpx # noqa: F401 — kept at module top so tests can patch tools.web_t if TYPE_CHECKING: from firecrawl import Firecrawl # noqa: F401 — type hints only from plugins.web.firecrawl.provider import ( + Firecrawl, # noqa: F401 # re-exported for tests that mock.patch("tools.web_tools.Firecrawl") _firecrawl_backend_help_suffix, + _get_firecrawl_client, # noqa: F401 # re-exported for tests that `from tools.web_tools import _get_firecrawl_client` _get_firecrawl_gateway_url, _is_tool_gateway_ready, check_firecrawl_api_key,