If your scheduled OpenClaw cron jobs are mysteriously posting to your `#general` Matrix room instead of your dedicated `#cron-log`, you’re not alone. A regression in version v2026.2.22 broke the delivery logic for explicit room targets. This bug causes the system to ignore your specified room ID, defaulting to the first room it finds—often your default channel. Here’s the breakdown of the issue, the community-driven fix, and what you can do right now.
The Bug: Explicit Room Targeting Fails, Silently Redirecting Announcements to #general
The core failure is in the target resolution logic within OpenClaw’s Matrix extension. When you create a cron job with `delivery.mode: “announce”` and specify a target like `!abc123:matrix.org`, the system is supposed to post directly to that room.
Instead, the announcement is posted to the wrong Matrix room – typically the default #general room. The job log even shows `lastDeliveryStatus: “delivered”`, making the bug particularly stealthy and frustrating.
This issue, reported as GitHub Issue #25318, is a clear regression. It worked correctly in versions prior to **v2026.2.22** but was broken by a change intended to optimize delivery routing.
Root Cause: A Missing “Fast-Path” for Room IDs Triggers a Faulty Directory Lookup
The technical flaw is isolated in the file `extensions/matrix/src/resolve-targets.ts`. The code contains a fast-path check for user IDs (strings starting with `@`), correctly returning them without further lookup.
However, there was no equivalent check for room IDs (strings starting with `!`). When a room ID like `!cron-log-id:matrix.org` is passed, the code falls through to a function called `listMatrixDirectoryGroupsLive`. This function queries the public Matrix directory by display name or alias, not by the opaque room ID. This lookup often resolves to the first room it finds, which is frequently your `#general` channel if it has a common alias or is listed as a default space.
The Fix: A One-Line Code Change That Restores Direct Room Targeting
The solution, contributed by community member `lbo728` in Pull Request #25325, is elegantly simple. It mirrors the existing logic for user IDs by adding an early return for room IDs. The fix, committed in ff533cf, essentially checks:
* If the target string starts with `!` AND contains a colon (`:`).
* If true, it treats the string as a full room ID and returns it immediately, bypassing the broken directory lookup entirely.
This minimal change resolves the regression and ensures explicit room targeting works as users expect.
Immediate Workarounds: Three Actions to Regain Control Before the Official Release
While the fix is merged into the codebase, you may be running a released version that still contains the bug. Here are your options:
- Use a Public Room Alias: If your target room has a published alias (e.g., `#cron-log:matrix.org`), use that instead of the internal room ID (`!abc123:matrix.org`). The directory lookup works correctly for unique, published aliases.
- Downgrade Your Installation: Revert to a version of OpenClaw prior to v2026.2.22 where room targeting functioned correctly.
- Apply the Patch Manually (Advanced): If you are comfortable, you can manually edit the `resolve-targets.ts` file in your installation to include the fix. Locate the fast-path for user IDs and add a similar condition for room IDs before the directory lookup logic executes.
This incident is a textbook example of how a minor oversight during a refactor can create a significant user-facing bug, and how the open-source model enables rapid diagnosis and repair by the community.
Once the fix is included in an official release, updating OpenClaw with `npm update -g openclaw` will permanently resolve the issue. Until then, you can use the workarounds to ensure your cron announcements land in the right room.

