@@ -28,6 +28,8 @@ def create_security_expert(llm):
2828from threading import RLock
2929from typing import TYPE_CHECKING , NamedTuple
3030
31+ from pydantic import SecretStr
32+
3133from openhands .sdk .logger import get_logger
3234from openhands .sdk .subagent .load import (
3335 load_project_agents ,
@@ -60,18 +62,18 @@ def _definition_from_factory(
6062 factory_func : Callable [["LLM" ], "Agent" ],
6163 description : str ,
6264) -> AgentDefinition :
63- """Introspect *factory_func* with a TestLLM to build a full AgentDefinition.
65+ """Introspect *factory_func* with a dummy LLM to build a full AgentDefinition.
6466
6567 This lets register_agent() accept just (name, factory_func, description)
6668 while still producing a complete definition (tools, system_prompt, model)
6769 that can be forwarded to a remote server. Falls back to a minimal
6870 definition if the factory raises.
6971 """
70- _model_placeholder = "test-model "
72+ _model_placeholder = "__introspect__ "
7173 try :
72- from openhands .sdk .testing import TestLLM
74+ from openhands .sdk .llm . llm import LLM as _LLM
7375
74- agent = factory_func (TestLLM (model = _model_placeholder ))
76+ agent = factory_func (_LLM (model = _model_placeholder , api_key = SecretStr ( "n/a" ) ))
7577 tools = [t .name for t in agent .tools ]
7678 system_prompt = ""
7779 if agent .agent_context and agent .agent_context .system_message_suffix :
0 commit comments