Skip to content

Commit cda77d7

Browse files
authored
Merge pull request #219 from hud-evals/g/codex-support
Add support for `shell` and `agent_patch` and generally reorganize openai agent
2 parents ee8e107 + 46a3a6a commit cda77d7

File tree

10 files changed

+800
-403
lines changed

10 files changed

+800
-403
lines changed

hud/agents/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ async def initialize(self, task: str | Task | None = None) -> None:
148148
try:
149149
await self.mcp_client.initialize()
150150
except Exception as e:
151+
self.console.error_log(f"Failed to initialize MCP client: {e}")
151152
self._handle_connection_error(e)
152153

153154
# If task is provided, apply agent_config and add lifecycle tools
@@ -201,6 +202,15 @@ async def initialize(self, task: str | Task | None = None) -> None:
201202
continue
202203
self._available_tools.append(tool)
203204

205+
# Validate required tools are present
206+
available_tool_names = {t.name for t in self._available_tools}
207+
missing_tools = [tool for tool in self.required_tools if tool not in available_tool_names]
208+
if missing_tools:
209+
raise ValueError(
210+
f"Required tools are missing: {missing_tools}. "
211+
f"Available tools: {sorted(available_tool_names)}"
212+
)
213+
204214
self.console.info(
205215
f"Agent initialized with {len(self.get_available_tools())} tools: {', '.join([t.name for t in self.get_available_tools()])}" # noqa: E501
206216
)

0 commit comments

Comments
 (0)