#20969: Add DeJoy channel extension (Matrix-compatible protocol)
size: XL
Cluster:
Messaging Channel Integrations
## Summary
- **Problem:** Users/organizations running DeJoy (a Matrix-compatible protocol) have no dedicated OpenClaw channel; they must use the Matrix plugin with no distinct config or identity.
- **Why it matters:** DeJoy needs to be supported as its own channel (separate config, install path, and UI label) while reusing the same protocol implementation.
- **What changed:** New `extensions/dejoy` plugin: channel id `dejoy`, config under `channels.dejoy`, label "DeJoy (plugin)". Implementation is a copy of the Matrix extension with plugin identity and config key renamed; same SDK and protocol.
- **What did NOT change (scope boundary):** No changes to the existing Matrix plugin, `channels.matrix`, or any core gateway/skills/API. No shared code removed from Matrix.
## Change Type (select all)
- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [x] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Closes #
- Related # _(optional: link GitHub Discussion if you opened one)_
## User-visible / Behavior Changes
- New channel option: **DeJoy (plugin)** in channel selection (CLI/UI).
- New config section: `channels.dejoy` (same schema as `channels.matrix`: homeserver, userId, accessToken, password, etc.).
- Install: `openclaw extensions install @openclaw/dejoy` (or from repo/local path).
- Labeler: new label `channel: dejoy` for `extensions/dejoy/**` and `docs/channels/dejoy.md`.
## Security Impact (required)
- New permissions/capabilities? **No** (same as Matrix plugin).
- Secrets/tokens handling changed? **No** (same pattern as Matrix; credentials in config/env).
- New/changed network calls? **No** (same Matrix protocol; no new endpoints).
- Command/tool execution surface changed? **No** (same tool/action surface as Matrix).
- Data access scope changed? **No** (same account/room scope as Matrix).
- If any `Yes`, explain risk + mitigation: **N/A**
## Repro + Verification
### Environment
- OS: _e.g. macOS / Linux_
- Runtime/container: Node 22+ / pnpm
- Model/provider: N/A (channel-only)
- Integration/channel: DeJoy (or Matrix homeserver for testing)
- Relevant config (redacted): `channels.dejoy.homeserver`, `channels.dejoy.accessToken` (or password)
### Steps
1. Install extension: `pnpm install` (or `openclaw extensions install @openclaw/dejoy`).
2. Add `channels.dejoy` in config with homeserver + access token (or password).
3. Start gateway; verify DeJoy channel appears and can send/receive.
### Expected
- DeJoy appears as a separate channel; config under `channels.dejoy`; behavior matches Matrix plugin for the same protocol.
### Actual
- _Same as expected when tested locally._
## Evidence
- [x] Failing test/log before + passing after: N/A (new code; no prior failing test).
- [x] `pnpm test -- extensions/dejoy`: 28 tests passing (channel, directory, onboarding, actions, client/config/accounts/monitor/send, resolve-targets).
- [ ] Screenshot/recording: optional (e.g. channel list showing "DeJoy (plugin)").
- [ ] Perf numbers: N/A.
## Human Verification (required)
- **Verified scenarios:** Extension builds; `pnpm check` and `pnpm test -- extensions/dejoy` pass; config key `channels.dejoy` is used end-to-end; no references to `channels.matrix` in dejoy code.
- **Edge cases checked:** Lockfile rebase on latest `main`; no `node_modules` committed.
- **What you did not verify:** Live DeJoy server (if no test instance); full gateway E2E with DeJoy only.
## Compatibility / Migration
- Backward compatible? **Yes**
- Config/env changes? **No** (existing `channels.matrix` and env unchanged).
- Migration needed? **No**
- If yes, exact upgrade steps: N/A
## Failure Recovery (if this breaks)
- **How to disable/revert:** Remove or disable `channels.dejoy` in config; uninstall extension.
- **Files/config to restore:** `extensions/dejoy/`, `.github/labeler.yml` (dejoy entry), `package.json` / `pnpm-lock.yaml` if needed.
- **Known bad symptoms:** DeJoy channel not appearing; runtime errors when loading dejoy plugin (check extension install and config schema).
## Risks and Mitigations
- **Risk:** Duplicated logic from Matrix (two plugins, same protocol); future Matrix fixes might need to be applied to DeJoy.
- **Mitigation:** Document that DeJoy is a Matrix-protocol clone; consider syncing critical fixes from matrix to dejoy until/if they share a common layer.
- **Risk:** Lockfile/peer dependency churn.
- **Mitigation:** Rebased on latest `main` and ran `pnpm install`; CI will validate lockfile.
---
Code word: **lobster-biscuit**
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a DeJoy channel extension as a Matrix-protocol clone with separate configuration (`channels.dejoy`). The implementation correctly reads from the `channels.dejoy` config section and provides proper channel identity/labeling. Tests are comprehensive (28 passing tests covering all core functionality).
**Critical Issues Found:**
- **Credentials directory conflict**: DeJoy stores credentials in `credentials/matrix/` instead of `credentials/dejoy/`, causing both plugins to share the same directory
- **Environment variable conflict**: DeJoy reads `MATRIX_*` env vars instead of `DEJOY_*`, preventing independent configuration when both plugins are installed
**Additional Observations:**
- Internal function/type names retain "Matrix" naming (e.g., `resolveMatrixAccount`, `MatrixConfig`) - this is acceptable as they implement the Matrix protocol, but the runtime behavior correctly scopes to `channels.dejoy`
- The `.github/labeler.yml` properly adds the new `channel: dejoy` label
- The plugin metadata correctly identifies as `dejoy` with appropriate labels and docs paths
**Impact:** The two conflicts would prevent Matrix and DeJoy plugins from coexisting independently - credentials and env-based config would collide.
<h3>Confidence Score: 2/5</h3>
- This PR has critical conflicts that prevent Matrix and DeJoy plugins from coexisting independently
- Score reflects two critical logical errors: shared credentials directory and shared environment variables would cause runtime conflicts if both Matrix and DeJoy plugins are installed. The rest of the implementation is solid with good test coverage, but these conflicts are blocking issues.
- Pay close attention to `extensions/dejoy/src/dejoy/credentials.ts` (credentials directory path) and `extensions/dejoy/src/dejoy/client/config.ts` (environment variable names)
<sub>Last reviewed commit: 445c63a</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#22260: feat(extensions/deltachat): add Delta.Chat channel extension
by alanz · 2026-02-20
74.8%
#20278: Fix/matrix missing bot sdk dependency
by saurav470 · 2026-02-18
73.6%
#20348: Add support for Keybase as a channel
by xgess · 2026-02-18
72.1%
#19514: feat: add Bluesky DM channel extension
by librenews · 2026-02-17
71.8%
#18718: matrix: add pending group history context for room messages
by pharasyte · 2026-02-17
71.0%
#6518: feat(matrix): add inbound message debouncing
by Klowalski · 2026-02-01
70.6%
#13057: feat(matrix): add sessionScope=room to route sessions by roomId
by spengrah · 2026-02-10
70.5%
#9199: feat: Add Cisco Webex Teams channel plugin
by chrharri · 2026-02-05
69.6%
#20913: fix: intercept Discord embed images to enforce mediaMaxMb
by MumuTW · 2026-02-19
69.2%
#19030: feat(simplex): add SimpleX Chat channel plugin
by Bladerunner-hue · 2026-02-17
69.2%