Skip to content

The agent that grows with you

fix: give plugins the CLI reference in `hermes chat -q/-Q` too

teknium1069d6a1f9e76
diff --git a/hermes_cli/cli_single_query.py b/hermes_cli/cli_single_query.py
index f1a06dfbc03..ed35d53ee5d 100644
--- a/hermes_cli/cli_single_query.py
+++ b/hermes_cli/cli_single_query.py
@@ -436,6 +436,10 @@ def _run_single_query_mode(cli, query, image, quiet, oneshot, stream_json: bool
cli._seeded_first_message = _SeededQueryMessage(seeded_query, seeded_images)
return cli.run()
cli._single_query_mode = True # agent waits the full MCP cold-start before its only tool snapshot
+ # Only the interactive run loop set this, so plugin tools dispatched from a `-q`/`-Q` turn got no
+ # parent_agent (PluginContext.dispatch_tool reads it) — #67597.
+ from hermes_cli.plugins import get_plugin_manager
+ get_plugin_manager()._cli_ref = cli
# No user can answer approval prompts: the approval gate takes the deterministic path.
# One-shot mode: no between-turns MCP late-binding refresh, so the agent must wait the full MCP
# cold-start bound before its first (and only) tool snapshot. See #51316.