Skip to content

Commit f564705

Browse files
committed
correct prompt and resource reload
1 parent 3b3e312 commit f564705

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hud/environment/environment.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ async def _execute_tool(self, name: str, arguments: dict[str, Any]) -> MCPToolRe
539539

540540
async def list_resources(self) -> list[mcp_types.Resource]:
541541
"""Refresh resources from all connections and rebuild resource routing."""
542+
if self._connections:
543+
await asyncio.gather(*[c.list_resources(refresh=True) for c in self._connections.values()])
542544
await self._build_resource_routing()
543545
return self._router.resources
544546

@@ -585,6 +587,8 @@ async def read_resource(
585587

586588
async def list_prompts(self) -> list[mcp_types.Prompt]:
587589
"""Refresh prompts from all connections and rebuild prompt routing."""
590+
if self._connections:
591+
await asyncio.gather(*[c.list_prompts(refresh=True) for c in self._connections.values()])
588592
await self._build_prompt_routing()
589593
return self._router.prompts
590594

0 commit comments

Comments
 (0)