fix(synology-chat): respect SYNOLOGY_RATE_LIMIT=0 in env var parsing#39197
fix(synology-chat): respect SYNOLOGY_RATE_LIMIT=0 in env var parsing#39197scoootscooob wants to merge 1 commit intoopenclaw:mainfrom
Conversation
parseInt(envRateLimit, 10) || 30 drops valid 0 because 0 is falsy. Switch to ?? (nullish coalescing) so only NaN triggers the default. Fixes openclaw#39191 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR fixes a subtle falsy-value bug in the
Confidence Score: 5/5
Last reviewed commit: 5629a3d |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5629a3ddac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const parsedRateLimit = envRateLimit != null ? parseInt(envRateLimit, 10) : NaN; | ||
| const envRateLimitValue = Number.isFinite(parsedRateLimit) ? parsedRateLimit : 30; |
There was a problem hiding this comment.
Reject partially numeric rate-limit env values
Using parseInt with Number.isFinite treats malformed values that start with zero (for example SYNOLOGY_RATE_LIMIT=0abc or 0x10) as valid 0, so this change now accepts those inputs instead of falling back to 30 as before. That silently changes runtime throttling behavior for misconfigured deployments and can unexpectedly clamp message throughput; the env value should only be accepted when the entire string is a valid integer.
Useful? React with 👍 / 👎.
Landed from contributor PR #39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
|
Landed on What shipped:
Landed commit: Source PR commit: Thanks @scoootscooob. |
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]>
Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]> (cherry picked from commit af9d76b)
… CI fixes (#1794) * fix: honor explicit Synology Chat rate-limit env values Landed from contributor PR openclaw#39197 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]> (cherry picked from commit af9d76b) * fix: honor zero-valued voice-call STT settings Landed from contributor PR openclaw#39196 by @scoootscooob. Co-authored-by: scoootscooob <[email protected]> (cherry picked from commit 28b72e5) * fix: honor explicit OpenAI TTS speed values Landed from contributor PR openclaw#39318 by @ql-wade. Co-authored-by: ql-wade <[email protected]> (cherry picked from commit 442f2c3) * Voice Call: allowlist realtime STT api key fixtures (cherry picked from commit b8b6569) * Voice Call: read TTS internals in tests (cherry picked from commit b1f7cf4) * Voice Call: read realtime STT internals in tests (cherry picked from commit 244aabb) * test: fix gate regressions (cherry picked from commit 56cd008) * refactor: normalize voice-call runtime defaults (cherry picked from commit 3087893) * refactor: preserve explicit mock voice-call values (cherry picked from commit f6c7ff3) * fix(ci): resolve type regressions on main (cherry picked from commit f721141) * refactor(voice-call): share tts deep merge (cherry picked from commit ed43743) * fix: land openclaw#33992 from @darkamenosa Co-authored-by: Tom <[email protected]> (cherry picked from commit fcdc1a1) * fix(ci): repair zalouser CI failures (cherry picked from commit 06ffef8) * fix: resolve cherry-pick type errors in zalouser extension Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * fix: resolve cherry-pick type error in voice-call config test — adapt SecretRef to string apiKey Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: scoootscooob <[email protected]> Co-authored-by: ql-wade <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Tom <[email protected]> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Summary
parseInt(envRateLimit, 10) || 30with a proper parse that usesNumber.isFinite()to validateparseInt("0", 10)returns0which||treats as falsy, silently defaulting to300(valid rate limit) andNaN(invalid input falls back to30)Test plan
respects SYNOLOGY_RATE_LIMIT=0 instead of defaulting to 30Fixes #39191
🤖 Generated with Claude Code