Skip to content

fix(web_server): guard GATEWAY_HEALTH_TIMEOUT against invalid env values - #14756

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ed900554
Apr 23, 2026
Merged

fix(web_server): guard GATEWAY_HEALTH_TIMEOUT against invalid env values#14756
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ed900554

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #14751 (@sprmn24) onto current main.

Summary

_GATEWAY_HEALTH_TIMEOUT = float(os.getenv("GATEWAY_HEALTH_TIMEOUT", "3")) at module level in web_server.py crashes the entire web server at import if the env var holds a non-numeric value. Wrapped in try/except with a warning log and 3.0s fallback.

Changes

  • hermes_cli/web_server.py: try/except around the bare float() parse; warns via existing _log.

Validation

E2E with real imports against this worktree:

Env value Before After
abc ValueError at import, server dies Warning logged, timeout=3.0, server starts
5.5 5.5 5.5
unset 3.0 3.0

Cherry-picked from PR #14751 commit 2beeedc, authorship preserved.

float(os.getenv(...)) at module level raises ValueError on any
non-numeric value, crashing the web server at import before it starts.

Wrap in try/except with a warning log and fallback to 3.0s.
@teknium1
teknium1 merged commit 78d1e25 into main Apr 23, 2026
10 of 11 checks passed
@teknium1
teknium1 deleted the hermes/hermes-ed900554 branch April 23, 2026 22:07
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14751 — same GATEWAY_HEALTH_TIMEOUT float() guard fix, cherry-picked onto current main.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants