Skip to content

fix(gateway): add module-level logger to gateway.py (salvage #27154)#27246

Merged
teknium1 merged 3 commits into
mainfrom
hermes/hermes-a449f95f
May 17, 2026
Merged

fix(gateway): add module-level logger to gateway.py (salvage #27154)#27246
teknium1 merged 3 commits into
mainfrom
hermes/hermes-a449f95f

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of #27154 — adds the missing module-level logger in hermes_cli/gateway.py so _all_platforms()'s except block can logger.debug(...) without a NameError when plugin discovery fails.

Changes

  • hermes_cli/gateway.py — add import logging and logger = logging.getLogger(__name__) at module scope.
  • tests/hermes_cli/test_gateway.py — regression smoke test asserting the logger exists.
  • scripts/release.py — AUTHOR_MAP entries for @0xchainer and @kronexoi (used by upcoming salvage PRs too).

Validation

  • scripts/run_tests.sh tests/hermes_cli/test_gateway.py -q → 28/28 pass.

Original PR: #27154 — credit preserved via rebase-merge.

@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-a449f95f vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8349 on HEAD, 8350 on base (✅ -1)

🆕 New issues (3):

Rule Count
invalid-argument-type 3
First entries
run_agent.py:14078: [invalid-argument-type] invalid-argument-type: Argument to function `len` is incorrect: Expected `Sized`, found `(str & ~AlwaysFalsy) | (dict[Unknown, Unknown] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 3 union elements`
run_agent.py:7770: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 3 union elements`
run_agent.py:14075: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 3 union elements`

✅ Fixed issues (4):

Rule Count
invalid-argument-type 3
unresolved-reference 1
First entries
run_agent.py:14075: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `str | dict[Unknown | str, Unknown | str | dict[str, str]] | Any | ... omitted 3 union elements`
run_agent.py:14078: [invalid-argument-type] invalid-argument-type: Argument to function `len` is incorrect: Expected `Sized`, found `(str & ~AlwaysFalsy) | (dict[Unknown | str, Unknown | str | dict[str, str]] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 3 union elements`
hermes_cli/gateway.py:3702: [unresolved-reference] unresolved-reference: Name `logger` used when not defined
run_agent.py:7770: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `str | dict[Unknown | str, Unknown | str | dict[str, str]] | Any | ... omitted 3 union elements`

Unchanged: 4363 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@cardtest15-coder

This comment was marked as spam.

@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 17, 2026
@cardtest15-coder

This comment was marked as spam.

0xchainer and others added 3 commits May 16, 2026 22:41
…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.
…27154)

Verify that the module has a logger instance with the correct name,
preventing regression of the NameError fixed in a31d5af.
@teknium1 teknium1 force-pushed the hermes/hermes-a449f95f branch from 3284c37 to ceeef63 Compare May 17, 2026 05:43
@teknium1 teknium1 merged commit a81cfd0 into main May 17, 2026
16 of 17 checks passed
@teknium1 teknium1 deleted the hermes/hermes-a449f95f branch May 17, 2026 05:43
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