fix: guard remaining float(os.getenv) casts against malformed values - #49436
fix: guard remaining float(os.getenv) casts against malformed values#49436vanthinh6886 wants to merge 2 commits into
Conversation
|
Related: #45521 (guards the same |
run_agent.py and hermes_cli/auth.py have bare float(os.getenv(...)) calls that raise ValueError on malformed input. Wrap in try/except to fall back to the default value, matching the pattern already used elsewhere. - run_agent.py: HERMES_API_TIMEOUT - hermes_cli/auth.py: HERMES_CODEX_REFRESH_TIMEOUT_SECONDS, HERMES_XAI_REFRESH_TIMEOUT_SECONDS
d9250cb to
0484e0e
Compare
|
Closing as superseded by #49558, which landed the canonical fix for this whole bug class. #49558 adds We went with the Thanks for spotting and driving the fix on this — it's all in main now via: |
Summary
run_agent.pyandhermes_cli/auth.pyhave barefloat(os.getenv(...))calls that raiseValueErroron malformed input (e.g."abc","").Fix
Wrap in
try/except (TypeError, ValueError)to fall back to the default value, matching the pattern already used throughout the codebase.Changes
run_agent.py:HERMES_API_TIMEOUT(line 1112)hermes_cli/auth.py:HERMES_CODEX_REFRESH_TIMEOUT_SECONDS(line 3841),HERMES_XAI_REFRESH_TIMEOUT_SECONDS(line 4478)