Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions openhands-sdk/openhands/sdk/subagent/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,10 @@ def get_factory_info() -> str:
with _registry_lock:
user_factories = dict(_agent_factories)

info_lines = []
info_lines.append(
"- **default**: Default general-purpose agent (used when no agent type is provided)" # noqa: E501
)

if not user_factories:
info_lines.append(
"- No user-registered agents yet. Call register_agent(...) to add custom agents." # noqa: E501
)
return "\n".join(info_lines)
return "- No user-registered agents yet. Call register_agent(...) to add custom agents." # noqa: E501

info_lines = []
for name, factory in sorted(user_factories.items()):
info_lines.append(f"- **{name}**: {factory.description}")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: default
description: Default general-purpose agent
description: Default general-purpose agent (used when no agent type is provided)
tools:
- terminal
- file_editor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: default cli mode
description: Default general-purpose agent
description: Default general-purpose agent (used when no agent type is provided)
tools:
- terminal
- file_editor
Expand Down
2 changes: 0 additions & 2 deletions tests/sdk/subagent/test_subagent_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def test_agent_definition_to_factory_no_system_prompt() -> None:
def test_factory_info() -> None:
"""get_factory_info returns formatted listing of registered agents."""
info = get_factory_info()
assert "default" in info
assert "No user-registered agents" in info

# Register some agents
Expand All @@ -255,7 +254,6 @@ def factory_b(llm: LLM) -> Agent: # type: ignore[unused-argument]
register_agent(name="beta-agent", factory_func=factory_b, description="Beta desc")

info = get_factory_info()
assert "default" in info
assert "No user-registered agents" not in info
assert "**alpha-agent**: Alpha desc" in info
assert "**beta-agent**: Beta desc" in info
Expand Down
Loading