Skip to content

fix(gateway): add missing logger definition to prevent NameError in _all_platforms#27154

Closed
0xchainer wants to merge 2 commits into
NousResearch:mainfrom
0xchainer:fix/undefined-logger-gateway
Closed

fix(gateway): add missing logger definition to prevent NameError in _all_platforms#27154
0xchainer wants to merge 2 commits into
NousResearch:mainfrom
0xchainer:fix/undefined-logger-gateway

Conversation

@0xchainer

Copy link
Copy Markdown
Contributor

Summary

hermes_cli/gateway.py:3702 referenced logger.debug() but logger was never defined anywhere in the module. This causes a NameError at runtime whenever the try/except block around discover_plugins() in the _all_platforms() function catches an exception.

Root Cause

The _all_platforms() function (line 3674) is responsible for enumerating all available messaging platforms for the hermes setup gateway menu. It combines built-in platforms with plugin-registered ones by calling discover_plugins().

If discover_plugins() fails — for example, due to a corrupted plugin directory, a missing dependency, or a user-installed platform plugin with a syntax error — the except Exception as e: block at line 3703 attempts to log the failure:

except Exception as e:
    logger.debug("plugin discovery failed during platform enumeration: %s", e)

…all_platforms

hermes_cli/gateway.py:3702 referenced logger.debug() but 'logger' was
never defined in the module, causing a NameError at runtime if the
try/except around discover_plugins() caught an exception.

Added import logging and logger = logging.getLogger(__name__)
at module level to resolve the undefined name.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins labels May 16, 2026
@cardtest15-coder

This comment was marked as spam.

…ousResearch#27154)

Verify that the module has a logger instance with the correct name,
preventing regression of the NameError fixed in a31d5af.
teknium1 pushed a commit that referenced this pull request May 17, 2026
…27154)

Verify that the module has a logger instance with the correct name,
preventing regression of the NameError fixed in a31d5af.
teknium1 pushed a commit that referenced this pull request May 17, 2026
…27154)

Verify that the module has a logger instance with the correct name,
preventing regression of the NameError fixed in a31d5af.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #27246 with your authorship preserved on the substantive commits via rebase-merge. Commit a81cfd0a0 is on main.

Salvage notes: cherry-picked your fix + smoke test onto current main, re-authored to your GitHub noreply email so the AUTHOR_MAP check sees you, added the AUTHOR_MAP entry for future salvages too. Thanks for the fix!

@teknium1 teknium1 closed this May 17, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for 9 contributors from group 3:
- @darvsum (PR #26766)
- @hueilau (PR #26498)
- @Timur00Kh (PR #27114)
- @Grogger (PR #27061)
- @lemassykoi (PR #27042)
- @draplater (PR #26707)
- @pr7426 (PR #27048)
- @therahul-yo (PR #26215)
- @flamiinngo (PR #27205)

#27154 dropped from this batch — already landed on main as 4e9cedc.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ousResearch#27154)

Verify that the module has a logger instance with the correct name,
preventing regression of the NameError fixed in a31d5af.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants