$ the-wire · showcase
Surrogate-safe truncation lands across OpenClaw security paths
By RepoJournal · Filed · About OpenClaw
A security fix keeps channel metadata and install policy truncation from splitting surrogate pairs, preventing prompt corruption in LLM contexts.
OpenClaw shipped a security fix [1] replacing unsafe String.prototype.slice(0, N) truncation in channel-metadata.ts and install-policy.ts with surrogate-safe logic. channel-metadata is explicitly user-controlled untrusted content injected into LLM prompt context, so a dangling surrogate could corrupt the prompt. A similar fix [3] applies truncateUtf16Safe() at 5 call sites in memory dreaming snippet truncation to keep complex emoji and surrogate pairs intact.
Discord gateway error listeners no longer go stale after a restart [2]; the fix removes the gateway error listener on dispose while preserving late error guards and diagnostics. Meanwhile, model tools spawn_task and dismiss_task were added to the coding tool group [4], letting models propose follow-up work that operators approve before a fresh, isolated managed-worktree session starts.
On macOS, OpenClaw.app now skips unresolved dashboard auth templates [5], recognizing the same env SecretRef shorthand as core config so the LaunchAgent token fallback works instead of producing a URL with an encoded placeholder.
Action items
- → Review channel-metadata and install-policy truncation for surrogate-safe handling before next release openclaw/openclaw [immediate]
- → Test Discord gateway reconnect paths to confirm stale listeners no longer fire openclaw/openclaw [plan]
- → Verify macOS dashboard auth works when OPENCLAW_GATEWAY_TOKEN is absent openclaw/openclaw [plan]
References
- [1] fix(security): keep channel-metadata and install-policy truncation surrogate-safe (#102266) ↗ openclaw/openclaw
- [2] fix(discord): prevent stale gateway error listeners after restart (#101617) ↗ openclaw/openclaw
- [3] [AI] fix(memory): use truncateUtf16Safe for dreaming snippet truncation (#101946) ↗ openclaw/openclaw
- [4] feat: add follow-up task suggestions ↗ openclaw/openclaw
- [5] fix(macos): skip unresolved dashboard auth templates ↗ openclaw/openclaw