mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:10:49 +00:00
* fix(discord): normalize whitespace in command description comparison Discord server-side storage collapses consecutive whitespace and removes whitespace between adjacent CJK characters when persisting slash-command descriptions. Our locally-serialized desired descriptors keep the original whitespace, so commandsEqual returned false on every startup for any deployment with multi-line or CJK-heavy descriptions. This caused reconcile to issue a PATCH for every such command on every gateway restart. Under Discord's per-application rate limit that quickly produced a burst of 429s and some commands silently failed to register until the next restart — a recurring symptom behind several Discord deploy 429 reports (#75341, #75888). Fix: apply the same two normalizations to description strings in comparableCommand — collapse runs of whitespace to a single space, then drop whitespace between CJK boundary characters — before JSON-based equality. This mirrors Discord's storage semantics so round-tripped descriptions compare equal. Adds command-deploy.test.ts with regression coverage for: - server-side default fields ignored (dm_permission, nsfw, version, ids) - required:false treated as absent (existing behavior) - CJK descriptions with \n separators normalized - mixed CJK/ASCII descriptions with consecutive whitespace - substantive description diffs still flagged - ASCII whitespace normalization * fix(discord): normalize localized command descriptions * fix(discord): ignore null localization maps in command reconcile --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>