Skip to content

feat(cron): make the media-send timeout configurable via HERMES_CRON_MEDIA_SEND_TIMEOUT - #87967

Closed
AiwendilInTheWoods wants to merge 1 commit into
NousResearch:mainfrom
AiwendilInTheWoods:feat/cron-media-send-timeout-configurable
Closed

feat(cron): make the media-send timeout configurable via HERMES_CRON_MEDIA_SEND_TIMEOUT#87967
AiwendilInTheWoods wants to merge 1 commit into
NousResearch:mainfrom
AiwendilInTheWoods:feat/cron-media-send-timeout-configurable

Conversation

@AiwendilInTheWoods

Copy link
Copy Markdown
Contributor

Problem

cron/scheduler.py bounds media delivery with a hardcoded future.result(timeout=30). Any job producing a large attachment — long TTS audio, a concatenated recording, a sizeable export — fails once the upload exceeds 30 seconds, and there is no way to raise the limit short of patching the file.

Observed in production: a ~7.4 MB MP3 was generated correctly and then failed to deliver, while 3.0–3.3 MB files on the same path had always succeeded. Nothing was wrong with the file, the credentials, or the transport — the upload simply took longer than 30 s.

Why an environment variable, and why this name

The same module already reads three sibling timeouts from the environment:

  • HERMES_CRON_SCRIPT_TIMEOUT
  • HERMES_CRON_TIMEOUT
  • HERMES_CRON_SESSION_DB_TIMEOUT

Media send is the odd one out. This follows the established convention rather than introducing a new mechanism, and os is already imported.

Default

Raised from 30 s to 300 s. Set HERMES_CRON_MEDIA_SEND_TIMEOUT=30 to restore the previous behaviour exactly.

Docs

The three sibling HERMES_CRON_* variables are not currently documented in website/docs/user-guide/configuration.md or cli-config.yaml.example, so this PR matches that convention rather than expanding scope. Happy to add documentation for all four in this PR if you'd prefer.

Related

The media delivery path used a hardcoded future.result(timeout=30).
Large attachments legitimately exceed it with no way to raise the limit.
Read HERMES_CRON_MEDIA_SEND_TIMEOUT, matching the existing
HERMES_CRON_SCRIPT_TIMEOUT / HERMES_CRON_TIMEOUT /
HERMES_CRON_SESSION_DB_TIMEOUT convention in the same module.
@alt-glitch alt-glitch added type/feature New feature or request comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 16, 2026
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.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #88787 (merge commit bc76f62) — your commit landed with authorship preserved, together with your #87965 fix. On top of it we promoted the raw env-var read to the standard resolution pattern (HERMES_CRON_MEDIA_SEND_TIMEOUTcron.media_send_timeout_seconds in config.yaml → 300s default, mirroring script_timeout_seconds), registered the config key, and added docs + tests. Thanks for the contribution and the clear production evidence!

@teknium1 teknium1 closed this Aug 18, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants