hermes-bsd/hermes_cli
Teknium dd789a4fdf
fix(mcp): move discovery out of model_tools import side effect (#16856) (#16899)
model_tools.py ran discover_mcp_tools() as a module-level side effect.
discover_mcp_tools() uses a blocking 120s wait internally (via
_run_on_mcp_loop -> future.result(timeout=120)).

The gateway lazy-imports run_agent -> model_tools on the first user
message, which happens inside the asyncio event loop thread.  A slow or
unreachable MCP server therefore froze Discord shard heartbeats and
Telegram polling for up to 120s on the first message after gateway
start.

Fix: remove the module-level call.  Every entry point now runs
discovery explicitly at its own startup, using the context-appropriate
blocking/non-blocking pattern:

- gateway/run.py:       loop.run_in_executor(None, discover_mcp_tools)
                        before platforms start accepting traffic
- hermes_cli/main.py:   inline (no event loop at CLI startup)
- tui_gateway/entry.py: inline (sync stdin loop, no event loop)
- acp_adapter/entry.py: inline before asyncio.run()

Closes #16856.
2026-04-28 01:17:58 -07:00
..
__init__.py
auth.py feat(providers): add GMI Cloud as a first-class API-key provider (#11955) 2026-04-27 11:17:59 -07:00
auth_commands.py
azure_detect.py feat(azure-foundry): auto-detect transport, models, context length 2026-04-25 18:48:43 -07:00
backup.py feat(backup): exclude SQLite WAL/SHM/journal sidecars (#16576) 2026-04-27 06:43:52 -07:00
banner.py
callbacks.py
claw.py
cli_output.py
clipboard.py
codex_models.py
colors.py
commands.py fix(cli): eliminate ghost status-bar + DSR input leaks from terminal drift 2026-04-27 05:31:47 -07:00
completion.py
config.py fix(gateway): persist /sethome home channel to .env across all platforms 2026-04-28 01:17:17 -07:00
copilot_auth.py
cron.py
curses_ui.py
debug.py fix(debug): sweep expired paste.rs uploads on a real timer (#16431) 2026-04-27 00:36:33 -07:00
default_soul.py
dingtalk_auth.py
doctor.py feat(providers): add GMI Cloud as a first-class API-key provider (#11955) 2026-04-27 11:17:59 -07:00
dump.py
env_loader.py
fallback_cmd.py feat(cli): add 'hermes fallback' command to manage fallback providers (#16052) 2026-04-26 06:19:04 -07:00
gateway.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
hooks.py feat(hooks): add duration_ms to post_tool_call + transform_tool_result (#15429) 2026-04-25 22:13:12 -07:00
logs.py
main.py fix(mcp): move discovery out of model_tools import side effect (#16856) (#16899) 2026-04-28 01:17:58 -07:00
mcp_config.py
memory_setup.py
model_catalog.py feat(models): remote model catalog manifest for OpenRouter + Nous Portal (#16033) 2026-04-26 05:46:43 -07:00
model_normalize.py
model_switch.py fix(context): honor custom_providers context_length on /model switch + bump probe tier to 256K (#15844) 2026-04-25 18:47:53 -07:00
models.py feat(alibaba): add qwen3.6-plus to supported models 2026-04-28 01:14:31 -07:00
nous_subscription.py fix(cli): coerce use_gateway config flags in tool routing 2026-04-26 19:02:55 -07:00
oneshot.py feat(oneshot): add --model / --provider / HERMES_INFERENCE_MODEL (#15704) 2026-04-25 08:55:36 -07:00
pairing.py
platforms.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
plugins.py feat(plugins): add pre_approval_request / post_approval_response hooks (#16776) 2026-04-27 20:08:33 -07:00
plugins_cmd.py
profiles.py
providers.py feat(providers): add GMI Cloud as a first-class API-key provider (#11955) 2026-04-27 11:17:59 -07:00
pty_bridge.py fix: mobile chat in new layout 2026-04-24 12:07:46 -04:00
runtime_provider.py fix(opencode): re-derive api_mode per target model on /model switch 2026-04-28 01:14:35 -07:00
setup.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
skills_config.py
skills_hub.py feat(skills): install skills from a direct HTTP(S) URL (#16323) 2026-04-26 20:57:10 -07:00
skin_engine.py
slack_cli.py feat(slack): register every gateway command as a native slash (Discord/Telegram parity) (#16164) 2026-04-26 11:38:32 -07:00
status.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
timeouts.py refactor(timeouts): drop redundant ImportError in except clause 2026-04-26 20:48:20 -07:00
tips.py feat(busy): add 'steer' as a third display.busy_input_mode option (#16279) 2026-04-26 18:21:29 -07:00
tools_config.py fix(tools): coerce quoted use_gateway in image_gen UI detection 2026-04-26 19:02:55 -07:00
uninstall.py
voice.py
web_server.py fix(tui): run built TUI with production React by default 2026-04-26 21:34:31 -05:00
webhook.py