openclaw/extensions/matrix
Miorbnli 18e80760a7
fix(channels): keep inbound log previews UTF-16 safe (#102407)
* fix(matrix): truncate inbound preview on UTF-16 code-point boundary

The matrix inbound verbose preview used bodyText.slice(0, 200) before logging.
When a supplementary-plane character (emoji, extended CJK) straddles the 200th
code unit, the slice splits its surrogate pair and emits a lone surrogate into
the verbose log line. Lone surrogates corrupt JSON log serialization, break
terminal rendering, and crash UTF-8-validating log shippers.

Use the shared truncateUtf16Safe helper (already used by the mattermost sibling
monitor after #101630) to keep complete surrogate pairs intact. No behavior
change for ASCII input; the preview is still capped at 200 code units.

Co-Authored-By: Claude <noreply@anthropic.com>

* test(matrix): fix inbound-preview test for lint and lib target

- Avoid String.prototype.isWellFormed (ES2024 lib): use the encodeURIComponent
  well-formedness probe instead, which works on the project's TS lib target.
- Replace literal string concatenation with template strings to satisfy the
  no-useless-concat lint rule. No behavior change in the assertions.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(channels): keep inbound log previews UTF-16 safe

* test(line): type verbose preview fixtures

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-09 07:32:55 +01:00
..
src fix(channels): keep inbound log previews UTF-16 safe (#102407) 2026-07-09 07:32:55 +01:00
.npmignore
api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
auth-presence.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
CHANGELOG.md chore(release): close out 2026.6.11 on main 2026-06-30 11:31:08 -07:00
channel-plugin-api.ts
cli-metadata.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
contract-api.ts refactor(extensions): split channel contract sidecars 2026-06-10 13:05:24 +05:30
doctor-contract-api.test.ts refactor(matrix): move storage metadata into sqlite 2026-06-19 01:20:06 +08:00
doctor-contract-api.ts refactor: consolidate duplicated plugin state and doctor migration plumbing onto SDK seams (#99850) 2026-07-04 01:51:03 -07:00
helper-api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
index.test.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
index.ts refactor(shared): consolidate remaining channel lazy loaders (#99302) 2026-07-02 19:08:11 -07:00
npm-shrinkwrap.json chore: update dependencies (#100027) 2026-07-04 14:56:50 -04:00
openclaw.plugin.json fix(plugins): remove simpleicons icon color paths (#95987) 2026-06-23 12:16:02 -07:00
package.json chore: update dependencies (#100027) 2026-07-04 14:56:50 -04:00
plugin-entry.handlers.runtime.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
README.md docs(plugins): add npm readmes for channel providers 2026-05-31 20:02:45 +01:00
runtime-api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
runtime-heavy-api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
runtime-setter-api.ts
secret-contract-api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
session-binding-contract-api.ts refactor(extensions): split channel contract sidecars 2026-06-10 13:05:24 +05:30
setup-entry.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
setup-plugin-api.ts
SPEC-SUPPORT.md
subagent-hooks-api.ts refactor(shared): consolidate remaining channel lazy loaders (#99302) 2026-07-02 19:08:11 -07:00
test-api.ts fix(qa-matrix): read account state from sqlite 2026-07-01 22:56:12 -07:00
thread-binding-api.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
thread-bindings-runtime.ts docs: document messaging extension sources 2026-06-04 22:03:15 -04:00
tsconfig.json

OpenClaw Matrix

Official OpenClaw channel plugin for Matrix rooms and direct messages.

Install from OpenClaw:

openclaw plugin add @openclaw/matrix

Configure the Matrix homeserver and bot credentials in OpenClaw. The plugin lets agents join configured rooms, receive messages, and reply through Matrix.