Update str_replace_editor tool to use dynamic workspace path from SANDBOX_VOLUMES (#10965)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Boxuan Li
2025-09-15 17:46:54 -07:00
committed by GitHub
parent d3f3378a4c
commit 0f1780728e
6 changed files with 279 additions and 2 deletions

View File

@@ -62,6 +62,8 @@ class AgentConfig(BaseModel):
"""Model routing configuration settings."""
extended: ExtendedConfig = Field(default_factory=lambda: ExtendedConfig({}))
"""Extended configuration for the agent."""
runtime: str | None = Field(default=None)
"""Runtime type (e.g., 'docker', 'local', 'cli') used for runtime-specific tool behavior."""
model_config = ConfigDict(extra='forbid')

View File

@@ -202,6 +202,8 @@ def create_memory(
def create_agent(config: OpenHandsConfig, llm_registry: LLMRegistry) -> Agent:
agent_cls: type[Agent] = Agent.get_cls(config.default_agent)
agent_config = config.get_agent_config(config.default_agent)
# Pass the runtime information from the main config to the agent config
agent_config.runtime = config.runtime
config.get_llm_config_from_agent(config.default_agent)
agent = agent_cls(config=agent_config, llm_registry=llm_registry)
return agent