Skip to content

fix(gateway): import RedactingFormatter missing after logging refactor#8273

Open
MaybeRichard wants to merge 1 commit intoNousResearch:mainfrom
MaybeRichard:fix/gateway-redacting-formatter-import
Open

fix(gateway): import RedactingFormatter missing after logging refactor#8273
MaybeRichard wants to merge 1 commit intoNousResearch:mainfrom
MaybeRichard:fix/gateway-redacting-formatter-import

Conversation

@MaybeRichard
Copy link
Copy Markdown
Contributor

Bug

Commit fd73937 refactored the logging setup but accidentally removed the from agent.redact import RedactingFormatter import that was inside the if verbosity is not None: block.

Since verbosity defaults to 0 (not None) — see gateway.py:1537: verbosity = None if quiet else verbose — this block is always entered on a normal gateway start, causing an immediate NameError that prevents the gateway from running at all.

NameError: name 'RedactingFormatter' is not defined
  File ".../gateway/run.py", line 8476, in start_gateway
    _stderr_handler.setFormatter(RedactingFormatter('%(levelname)s %(name)s: %(message)s'))

Fix

Move from agent.redact import RedactingFormatter to the top of start_gateway(), alongside the other logging imports, so it is always available regardless of verbosity.

Steps to reproduce

Install hermes after fd73937 and run hermes gateway run — the gateway crashes immediately on startup.

Commit fd73937 refactored the logging setup but accidentally removed
the `from agent.redact import RedactingFormatter` import that was
inside the `if verbosity is not None:` block. Since the default
verbosity is 0 (not None), the block is always entered and the
missing import causes a NameError on startup, preventing the gateway
from running entirely.

Fix by importing RedactingFormatter at the top of start_gateway()
alongside the other logging imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@dishadc dishadc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed locally: confirmed the missing import is required for the stderr formatter path in start_gateway(), and targeted pytest checks passed (tests/agent/test_redact.py plus selected gateway/cron tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants