Skip to content

fix(runtime-provider): guard HERMES_NOUS_TIMEOUT_SECONDS against malformed env var - #48776

Closed
vanthinh6886 wants to merge 1 commit into
NousResearch:mainfrom
vanthinh6886:fix/runtime-provider-timeout-env-guard
Closed

fix(runtime-provider): guard HERMES_NOUS_TIMEOUT_SECONDS against malformed env var#48776
vanthinh6886 wants to merge 1 commit into
NousResearch:mainfrom
vanthinh6886:fix/runtime-provider-timeout-env-guard

Conversation

@vanthinh6886

Copy link
Copy Markdown
Contributor

Summary

Replace bare float(os.getenv) with env_float for HERMES_NOUS_TIMEOUT_SECONDS at 2 call sites in hermes_cli/runtime_provider.py (lines 1300, 1514). A malformed value causes ValueError crash during runtime credential resolution.

Changes

  • hermes_cli/runtime_provider.py: Add env_float to existing utils import, replace 2 bare float(os.getenv) calls

Test Plan

  • Lint clean

Context

Part of systemic env var guard issue. Related: PR #48735, #48740, #48745, #48748, #48757, #48771, #48773.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 19, 2026
…ormed env var

Replace bare float(os.getenv(...)) with env_float(...) for 2 call sites
in hermes_cli/runtime_provider.py (lines 1300 and 1514).

A malformed HERMES_NOUS_TIMEOUT_SECONDS env var (e.g. "abc") causes a
ValueError crash during runtime credential resolution. The env_float()
helper in utils.py catches ValueError/TypeError and returns the default.
@vanthinh6886
vanthinh6886 force-pushed the fix/runtime-provider-timeout-env-guard branch from b560a53 to a004de9 Compare June 19, 2026 03:00

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Clean defensive fix with identical logic to the runtime-provider fix (PR 48778). Guards the HERMES_NOUS_TIMEOUT_SECONDS env var against malformed values. 14 additions, 1 file. Straightforward and correct.


Reviewed by Hermes Agent

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing as superseded by #49558, which landed the canonical fix for this whole bug class.

#49558 adds env_float() alongside the existing env_int() in utils.py (the env_float helper was cherry-picked from this PR — @annguyenNous's authorship is preserved in the merge, commit 06ca1e998), then converts all 22 genuinely-unguarded first-party int/float(os.getenv()) sites across the gateway, agent, auth, and platform adapters to those canonical helpers.

We went with the utils.env_int/env_float route (the established house pattern, already imported in several modules) rather than per-module helpers or inline try/except, so every malformed-env crash site is now guarded through one shared implementation.

Thanks for spotting and driving the fix on this — it's all in main now via:
#49558

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 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.

5 participants