fix(feishu): guard 6 env var casts against malformed values - #48771
fix(feishu): guard 6 env var casts against malformed values#48771vanthinh6886 wants to merge 1 commit into
Conversation
Replace bare int(os.getenv(...))/float(os.getenv(...)) with env_int(...)/env_float(...) for 6 env vars in gateway/platforms/feishu.py: - HERMES_FEISHU_DEDUP_CACHE_SIZE (int) - HERMES_FEISHU_TEXT_BATCH_DELAY_SECONDS (float) - HERMES_FEISHU_TEXT_BATCH_SPLIT_DELAY_SECONDS (float) - HERMES_FEISHU_TEXT_BATCH_MAX_MESSAGES (int) - HERMES_FEISHU_TEXT_BATCH_MAX_CHARS (int) - HERMES_FEISHU_MEDIA_BATCH_DELAY_SECONDS (float) A malformed value (e.g. HERMES_FEISHU_DEDUP_CACHE_SIZE=abc) causes a ValueError crash when the Feishu adapter initializes. The env_int() and env_float() helpers in utils.py catch ValueError/TypeError and return the default value.
542408a to
5e175be
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Consistent defensive fix: guards env var casts against malformed values in the Feishu platform adapter. 18 additions across affected files. 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 int(os.getenv)/float(os.getenv) with env_int()/env_float() for 6 env vars in gateway/platforms/feishu.py:
A malformed value causes a ValueError crash when the Feishu adapter initializes.
Changes
Test Plan
Context
Part of systemic env var guard issue. Related: PR #48735, #48740, #48745, #48748, #48757.