mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
[Fix]: make mcp config optional in settings (#8622)
This commit is contained in:
parent
5b021ad1bb
commit
8b08958efe
@ -12,7 +12,7 @@ from openhands.core.config.condenser_config import (
|
||||
CondenserPipelineConfig,
|
||||
LLMSummarizingCondenserConfig,
|
||||
)
|
||||
from openhands.core.config.mcp_config import OpenHandsMCPConfigImpl
|
||||
from openhands.core.config.mcp_config import MCPConfig, OpenHandsMCPConfigImpl
|
||||
from openhands.core.exceptions import MicroagentValidationError
|
||||
from openhands.core.logger import OpenHandsLoggerAdapter
|
||||
from openhands.core.schema import AgentState
|
||||
@ -116,7 +116,7 @@ class Session:
|
||||
or settings.sandbox_runtime_container_image
|
||||
else self.config.sandbox.runtime_container_image
|
||||
)
|
||||
self.config.mcp = settings.mcp_config
|
||||
self.config.mcp = settings.mcp_config or MCPConfig(sse_servers=[], stdio_servers=[])
|
||||
# Add OpenHands' MCP server by default
|
||||
openhands_mcp_server = OpenHandsMCPConfigImpl.create_default_mcp_server_config(self.config.mcp_host, self.user_id)
|
||||
if openhands_mcp_server:
|
||||
|
||||
@ -38,7 +38,7 @@ class Settings(BaseModel):
|
||||
user_consents_to_analytics: bool | None = None
|
||||
sandbox_base_container_image: str | None = None
|
||||
sandbox_runtime_container_image: str | None = None
|
||||
mcp_config: MCPConfig = Field(default_factory=MCPConfig)
|
||||
mcp_config: MCPConfig | None = None
|
||||
|
||||
|
||||
model_config = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user