mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
_redact_telegram_error_text() strips bot tokens from api.telegram.org URLs embedded in transport-error text, and is already applied across the send/edit transient-error paths. Four sites still built their message from the raw exception: - connect()'s fatal-error handler is the most severe: the raw text is passed to _set_fatal_error(), which persists it via write_runtime_status() to a dashboard/admin-facing runtime status file, not just a log line. A transient network error during startup commonly embeds the request URL (https://api.telegram.org/bot<TOKEN>/getMe), so this could leak the live bot token into that surface. - disconnect(), send_document(), send_video() build the same unredacted pattern into a warning log line (lower blast radius, but the same leak class). Fix: route all four through the existing _redact_telegram_error_text() helper before building the message/log line, mirroring the send/edit paths exactly. Also drops exc_info=True from the two logger.error/ logger.warning calls that had it — exc_info prints the exception's own traceback (including its unredacted message) separately from the format string, which would otherwise defeat the redaction; the already-redacted sibling call sites in this file follow the same convention. |
||
|---|---|---|
| .. | ||
| browser | ||
| context_engine | ||
| cron_providers | ||
| dashboard_auth | ||
| disk-cleanup | ||
| google_meet | ||
| hermes-achievements | ||
| image_gen | ||
| kanban | ||
| memory | ||
| model-providers | ||
| observability | ||
| platforms | ||
| security-guidance | ||
| spotify | ||
| teams_pipeline | ||
| video_gen | ||
| web | ||
| __init__.py | ||
| plugin_utils.py | ||