Skip to content

fix(gateway): tolerate malformed HERMES_HUMAN_DELAY_* env vars (salvage #16933)#20217

Merged
teknium1 merged 3 commits into
mainfrom
salvage/pr-16933
May 5, 2026
Merged

fix(gateway): tolerate malformed HERMES_HUMAN_DELAY_* env vars (salvage #16933)#20217
teknium1 merged 3 commits into
mainfrom
salvage/pr-16933

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 5, 2026

Salvages @Krionex's PR #16933 onto current main and widens it to sibling site per never-merge-incomplete-fixes.

What it does

_get_human_delay() called int(os.getenv(...)) on HERMES_HUMAN_DELAY_MIN_MS / MAX_MS before dispatching on mode. A typo crashed the gateway regardless of mode.

Changes

  • gateway/platforms/base.py — natural mode no longer reads the custom env vars at all (PR fix(gateway): ignore malformed custom delay env vars in natural mode #16933's fix); custom mode wraps its int() calls in try/except/fallback to match (widening).
  • tests/gateway/test_platform_base.py — regression tests for both modes.
  • scripts/release.py — AUTHOR_MAP entry for Krionex.

Validation

tests/gateway/test_platform_base.py -k 'human_delay or HumanDelay' — 6 passed locally.

Closes #16933 via salvage.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 5, 2026
Krionex and others added 3 commits May 5, 2026 06:11
…mode

Widens @Krionex's PR #16933 fix to cover the second bug class at the sibling
site. natural mode used to pass env values through int() before the PR
caught mis-typed values crashing the gateway; custom mode had the exact
same bug one branch away (HERMES_HUMAN_DELAY_MIN_MS=oops in custom mode
still crashed). Same try/except/fallback pattern, scoped to the two
int() calls that feed random.uniform().
@teknium1 teknium1 force-pushed the salvage/pr-16933 branch from 2f7b15d to 93787a7 Compare May 5, 2026 13:11
@teknium1 teknium1 merged commit fb31195 into main May 5, 2026
9 of 10 checks passed
@teknium1 teknium1 deleted the salvage/pr-16933 branch May 5, 2026 13:11
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 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.

3 participants