Skip to content
Closed
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
12 changes: 12 additions & 0 deletions acp_adapter/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,18 @@ def main(argv: list[str] | None = None) -> None:
except Exception:
logger.debug("MCP tool discovery failed at ACP startup", exc_info=True)

# Register shell hooks from config (pre_tool_call blockers, etc.).
# Failures are logged but must never block ACP startup.
try:
from hermes_cli.config import load_config
from agent.shell_hooks import register_from_config
register_from_config(load_config(), accept_hooks=False)
except Exception:
logger.debug(
"shell-hook registration failed at ACP startup",
exc_info=True,
)

agent = HermesACPAgent()
try:
asyncio.run(acp.run_agent(agent, use_unstable_protocol=True))
Expand Down
12 changes: 12 additions & 0 deletions tui_gateway/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ def wait_for_mcp_discovery(timeout: float = 0.75) -> None:
def main():
_install_sidecar_publisher()

# Register shell hooks from config (pre_tool_call blockers, etc.).
# Failures are logged but must never block gateway startup.
try:
from hermes_cli.config import load_config
from agent.shell_hooks import register_from_config
register_from_config(load_config(), accept_hooks=False)
except Exception:
logger.debug(
"shell-hook registration failed at TUI gateway startup",
exc_info=True,
)

# MCP tool discovery — runs in a background daemon thread so a slow or
# unreachable MCP server can't freeze TUI startup. Previously this ran
# inline before ``gateway.ready``, which meant any configured-but-down
Expand Down