Skip to content

Bug: discover_plugins() exceptions silently swallowed at DEBUG in gateway and CLI startup #28137

@WompaJango

Description

@WompaJango

Description

discover_plugins() exceptions are caught and logged at DEBUG level in two places, both invisible at the default INFO log level (config.yaml logging.level: INFO). If ANY plugin import fails at startup — syntax error, missing dependency, import cycle — the operator gets zero indication unless they bump log level to DEBUG.

Affected locations

1. Gateway startup — gateway/run.py line 3477

try:
    from hermes_cli.plugins import discover_plugins
    discover_plugins()
except Exception:
    logger.debug(
        "plugin discovery failed at gateway startup", exc_info=True,
    )

2. CLI startup — hermes_cli/main.py line 12502

try:
    from hermes_cli.plugins import discover_plugins
    discover_plugins()
except Exception:
    logger.debug(
        "plugin discovery failed at CLI startup",
        exc_info=True,
    )

Reproduce

  1. Install a broken plugin (e.g., one with a syntax error in __init__.py)
  2. Restart gateway or CLI with default logging.level: INFO
  3. Observe: no error in agent.log, gateway.log, errors.log, or stderr
  4. Set HERMES_PLUGINS_DEBUG=1 or bump log level to DEBUG → error appears

Expected behavior

logger.warning(...) — so the failure is visible at default INFO level. Plugin discovery failures should never be silent at production log levels.

Impact

Operators can deploy broken plugins and not know they failed to load. The plugin appears enabled in config but silently does nothing. Diagnosing requires either setting HERMES_PLUGINS_DEBUG=1 (undocumented for most users) or editing config to raise log level.

Suggested fix

Change logger.debug(...)logger.warning(...) in both locations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardcomp/gatewayGateway runner, session dispatch, deliverycomp/pluginsPlugin system and bundled pluginstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions