fix(wecom): guard text batch delay env vars against malformed values - #48757
fix(wecom): guard text batch delay env vars against malformed values#48757vanthinh6886 wants to merge 1 commit into
Conversation
Replace bare float(os.getenv(...)) with env_float(...) for 2 env vars in gateway/platforms/wecom.py __init__: - HERMES_WECOM_TEXT_BATCH_DELAY_SECONDS (line 189) - HERMES_WECOM_TEXT_BATCH_SPLIT_DELAY_SECONDS (line 190) A malformed value (e.g. HERMES_WECOM_TEXT_BATCH_DELAY_SECONDS=abc) causes a ValueError crash when the WeCom adapter initializes. The env_float() helper in utils.py catches ValueError/TypeError and returns the default value.
|
Duplicate of #23374 — same fix: guards the WeCom text batch-delay env vars (HERMES_WECOM_TEXT_BATCH_DELAY_SECONDS / _SPLIT_DELAY_SECONDS) against malformed values. #23374 (earliest open) already hardens these exact batch-delay env parses across Telegram/Discord/WeCom; see also the broader open cluster #47338/#39113. Closing as redundant. |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Guards wecom text batch delay env vars against malformed values. Consistent with the env-var guard pattern established in this batch. 3 additions. No concerns.
Reviewed by Hermes Agent
|
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
Replace bare float(os.getenv(...)) with env_float(...) for 2 env vars in gateway/platforms/wecom.py:
A malformed value causes a ValueError crash when the WeCom adapter initializes.
Changes
Test Plan
Context
Part of systemic env var guard issue. Related: PR #48735, #48740, #48745, #48748.