fix(cron): media-send failure logs an empty reason when the cause is a timeout - #87965
Closed
AiwendilInTheWoods wants to merge 1 commit into
Closed
Conversation
TimeoutError carries no message and str(TimeoutError()) is the empty string, so the media-send warning rendered with nothing after the colon. Fall back to the exception class name when str(e) is empty.
teknium1
added a commit
that referenced
this pull request
Aug 18, 2026
Follow-up on the salvaged commits from PRs #87965 and #87967 (@AiwendilInTheWoods): - Promote the media-send timeout to the standard resolution pattern: HERMES_CRON_MEDIA_SEND_TIMEOUT env var, then cron.media_send_timeout_seconds in config.yaml, then 300s default (mirrors script_timeout_seconds; .env stays secrets-only). - Register the config key in DEFAULT_CONFIG and document both surfaces (environment-variables reference + cron user guide). - Fold the empty-str() exception fallback into the error string recorded in delivery_errors (post-#88631 the reason reaches the run status, not just the log line). - Tests: timeout resolution precedence + TimeoutError reason fallback.
Contributor
|
Merged via PR #88787 (merge commit bc76f62) — your commit landed with authorship preserved, together with your #87967 timeout work. A follow-up commit folds the class-name fallback into the delivery error recorded on the run status as well (post-#88631 those reasons surface in |
lisajlau
pushed a commit
to lisajlau/hermes-agent
that referenced
this pull request
Aug 20, 2026
Follow-up on the salvaged commits from PRs NousResearch#87965 and NousResearch#87967 (@AiwendilInTheWoods): - Promote the media-send timeout to the standard resolution pattern: HERMES_CRON_MEDIA_SEND_TIMEOUT env var, then cron.media_send_timeout_seconds in config.yaml, then 300s default (mirrors script_timeout_seconds; .env stays secrets-only). - Register the config key in DEFAULT_CONFIG and document both surfaces (environment-variables reference + cron user guide). - Fold the empty-str() exception fallback into the error string recorded in delivery_errors (post-NousResearch#88631 the reason reaches the run status, not just the log line). - Tests: timeout resolution precedence + TimeoutError reason fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a cron job's media delivery fails on a timeout, the log records no cause at all:
Note the trailing colon with nothing after it. The operator cannot tell whether this was a timeout, an auth failure, a size rejection, or a network error — and no traceback is emitted on this path either.
Root cause
cron/scheduler.pybounds the send withfuture.result(timeout=30)and re-raisesTimeoutErrorinto the generic handler, which formats the exception with%s:TimeoutErroris raised with no arguments, andstr(TimeoutError())is the empty string. So the single most likely failure on this path is precisely the one that erases itself from the log.Fix
Fall back to the exception class name when
str(e)is empty, so an argument-less exception still identifies itself. Messages that do exist are unchanged.Related
Same defect class as #63357 (
computer_use: empty TimeoutError surfaces as blank "capture failed: "), which is still open — this is thecron/scheduler.pyinstance of the same pattern.Scope
Logging only. No behaviour change, no new configuration.
How it was found
A ~7.4 MB audio attachment built correctly and then failed to deliver in production. The log line was empty by construction, so identifying the cause required reading the source rather than the journal.