Skip to content

Commit 0d6d277

Browse files
committed
fixes
1 parent 69d39fd commit 0d6d277

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

openhands-sdk/openhands/sdk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
create_mcp_tools,
4848
)
4949
from openhands.sdk.plugin import Plugin
50+
from openhands.sdk.subagent import (
51+
register_agent,
52+
)
5053
from openhands.sdk.tool import (
5154
Action,
5255
Observation,
@@ -113,6 +116,7 @@
113116
"Workspace",
114117
"LocalWorkspace",
115118
"RemoteWorkspace",
119+
"register_agent",
116120
"load_project_skills",
117121
"load_skills_from_dir",
118122
"load_user_skills",

openhands-sdk/openhands/sdk/subagent/schema.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ class AgentDefinition(BaseModel):
3434
default_factory=list, description="List of allowed tools for this agent"
3535
)
3636
system_prompt: str = Field(default="", description="System prompt content")
37-
allowed_commands: list[str] = Field(
38-
default_factory=list,
39-
description="List of allowed shell commands for this agent",
40-
)
4137
source: str | None = Field(
4238
default=None, description="Source file path for this agent"
4339
)
@@ -93,18 +89,6 @@ def load(cls, agent_path: Path) -> AgentDefinition:
9389
else:
9490
tools = []
9591

96-
# Parse allowed_commands (supports both snake_case and kebab-case)
97-
allowed_commands_raw = (
98-
fm.get("allowed_commands") or fm.get("allowed-commands") or []
99-
)
100-
allowed_commands: list[str]
101-
if isinstance(allowed_commands_raw, str):
102-
allowed_commands = [allowed_commands_raw]
103-
elif isinstance(allowed_commands_raw, list):
104-
allowed_commands = [str(c) for c in allowed_commands_raw]
105-
else:
106-
allowed_commands = []
107-
10892
# Extract whenToUse examples from description
10993
when_to_use_examples = _extract_examples(description)
11094

@@ -115,8 +99,6 @@ def load(cls, agent_path: Path) -> AgentDefinition:
11599
"model",
116100
"color",
117101
"tools",
118-
"allowed_commands",
119-
"allowed-commands",
120102
}
121103
metadata = {k: v for k, v in fm.items() if k not in known_fields}
122104

@@ -126,7 +108,6 @@ def load(cls, agent_path: Path) -> AgentDefinition:
126108
model=model,
127109
color=color,
128110
tools=tools,
129-
allowed_commands=allowed_commands,
130111
system_prompt=content,
131112
source=str(agent_path),
132113
when_to_use_examples=when_to_use_examples,

0 commit comments

Comments
 (0)