mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
Rename Conversation to ServerConversation and AppConfig to OpenHandsConfig (#8754)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -7,7 +7,7 @@ import time
|
||||
import pytest
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from openhands.core.config import AppConfig, MCPConfig, load_app_config
|
||||
from openhands.core.config import MCPConfig, OpenHandsConfig, load_openhands_config
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.events import EventStream
|
||||
from openhands.runtime.base import Runtime
|
||||
@@ -218,14 +218,14 @@ def _load_runtime(
|
||||
runtime_startup_env_vars: dict[str, str] | None = None,
|
||||
docker_runtime_kwargs: dict[str, str] | None = None,
|
||||
override_mcp_config: MCPConfig | None = None,
|
||||
) -> tuple[Runtime, AppConfig]:
|
||||
) -> tuple[Runtime, OpenHandsConfig]:
|
||||
sid = 'rt_' + str(random.randint(100000, 999999))
|
||||
|
||||
# AgentSkills need to be initialized **before** Jupyter
|
||||
# otherwise Jupyter will not access the proper dependencies installed by AgentSkills
|
||||
plugins = [AgentSkillsRequirement(), JupyterRequirement()]
|
||||
|
||||
config = load_app_config()
|
||||
config = load_openhands_config()
|
||||
config.run_as_openhands = run_as_openhands
|
||||
config.sandbox.force_rebuild_runtime = force_rebuild_runtime
|
||||
config.sandbox.keep_runtime_alive = False
|
||||
|
||||
@@ -208,7 +208,7 @@ async def test_add_mcp_tools_from_microagents():
|
||||
"""Test that add_mcp_tools_to_agent adds tools from microagents."""
|
||||
# Import ActionExecutionClient for mocking
|
||||
|
||||
from openhands.core.config.app_config import AppConfig
|
||||
from openhands.core.config.openhands_config import OpenHandsConfig
|
||||
from openhands.runtime.impl.action_execution.action_execution_client import (
|
||||
ActionExecutionClient,
|
||||
)
|
||||
@@ -219,8 +219,8 @@ async def test_add_mcp_tools_from_microagents():
|
||||
mock_memory = MagicMock()
|
||||
mock_mcp_config = MCPConfig()
|
||||
|
||||
# Create a mock AppConfig with the MCP config
|
||||
mock_app_config = AppConfig(mcp=mock_mcp_config, search_api_key=None)
|
||||
# Create a mock OpenHandsConfig with the MCP config
|
||||
mock_app_config = OpenHandsConfig(mcp=mock_mcp_config, search_api_key=None)
|
||||
|
||||
# Configure the mock memory to return a microagent MCP config
|
||||
mock_stdio_server = MCPStdioServerConfig(
|
||||
@@ -247,7 +247,7 @@ async def test_add_mcp_tools_from_microagents():
|
||||
'openhands.mcp.utils.fetch_mcp_tools_from_config',
|
||||
new=AsyncMock(return_value=[mock_tool]),
|
||||
):
|
||||
# Call the function with the AppConfig instead of MCPConfig
|
||||
# Call the function with the OpenHandsConfig instead of MCPConfig
|
||||
await add_mcp_tools_to_agent(
|
||||
mock_agent, mock_runtime, mock_memory, mock_app_config
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ from pathlib import Path
|
||||
from conftest import _close_test_runtime, _load_runtime
|
||||
|
||||
from openhands.controller.state.state import State
|
||||
from openhands.core.config.app_config import AppConfig
|
||||
from openhands.core.config.config_utils import OH_DEFAULT_AGENT
|
||||
from openhands.core.config.openhands_config import OpenHandsConfig
|
||||
from openhands.core.main import run_controller
|
||||
from openhands.core.schema.agent import AgentState
|
||||
from openhands.events.action.empty import NullAction
|
||||
@@ -17,7 +17,7 @@ from openhands.events.observation.commands import CmdOutputObservation
|
||||
|
||||
|
||||
def _get_config(trajectory_name: str, agent: str = OH_DEFAULT_AGENT):
|
||||
return AppConfig(
|
||||
return OpenHandsConfig(
|
||||
default_agent=agent,
|
||||
run_as_openhands=False,
|
||||
# do not mount workspace
|
||||
|
||||
@@ -37,8 +37,8 @@ from openhands.agenthub import Agent
|
||||
from openhands.controller.state.state import State
|
||||
from openhands.core.config import (
|
||||
AgentConfig,
|
||||
AppConfig,
|
||||
LLMConfig,
|
||||
OpenHandsConfig,
|
||||
SandboxConfig,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
@@ -60,8 +60,8 @@ AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = {
|
||||
}
|
||||
|
||||
|
||||
def get_config() -> AppConfig:
|
||||
config = AppConfig(
|
||||
def get_config() -> OpenHandsConfig:
|
||||
config = OpenHandsConfig(
|
||||
run_as_openhands=False,
|
||||
runtime=os.environ.get('RUNTIME', 'remote'),
|
||||
sandbox=SandboxConfig(
|
||||
|
||||
Reference in New Issue
Block a user