豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 503f7b7

Browse files
gumadeirasxudaiyanzi
authored andcommitted
fix(matrix): skip pairing-store reads for room auth (openclaw#67325)
Merged via squash. Prepared head SHA: 121ff3b Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
1 parent 6ef4c2f commit 503f7b7

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Docs: https://docs.openclaw.ai
1616
- Plugins/bundled channels: partition bundled channel lazy caches by active bundled root so `OPENCLAW_BUNDLED_PLUGINS_DIR` flips stop reusing stale plugin, setup, secrets, and runtime state. (#67200) Thanks @gumadeiras.
1717
- Packaging/plugins: prune common test/spec cargo from bundled plugin runtime dependencies and fail npm release validation if packaged test cargo reappears, keeping published tarballs leaner without plugin-specific special cases. (#67275) thanks @gumadeiras.
1818
- Agents/context + Memory: trim default startup/skills prompt budgets, cap `memory_get` excerpts by default with explicit continuation metadata, and keep QMD reads aligned with the same bounded excerpt contract so long sessions pull less context by default without losing deterministic follow-up reads.
19+
- Matrix/commands: skip DM pairing-store reads on room traffic now that room control-command authorization ignores pairing-store entries, keeping the room path narrower without changing room auth behavior. (#67325) Thanks @gumadeiras.
1920

2021
## 2026.4.15-beta.1
2122

extensions/matrix/src/matrix/monitor/handler.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,11 @@ describe("matrix monitor handler pairing account scope", () => {
446446
});
447447

448448
it("blocks room control commands from DM-only paired senders", async () => {
449+
const readAllowFromStore = vi.fn(async () => ["@user:example.org"]);
449450
const { handler, finalizeInboundContext, recordInboundSession } =
450451
createMatrixHandlerTestHarness({
451452
isDirectMessage: false,
452-
readAllowFromStore: vi.fn(async () => ["@user:example.org"]),
453+
readAllowFromStore,
453454
roomsConfig: {
454455
"!room:example.org": { requireMention: false },
455456
},
@@ -473,6 +474,7 @@ describe("matrix monitor handler pairing account scope", () => {
473474

474475
expect(recordInboundSession).not.toHaveBeenCalled();
475476
expect(finalizeInboundContext).not.toHaveBeenCalled();
477+
expect(readAllowFromStore).not.toHaveBeenCalled();
476478
});
477479

478480
it("processes room messages mentioned via displayName in formatted_body", async () => {

extensions/matrix/src/matrix/monitor/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
586586
senderNamePromise ??= getMemberDisplayName(roomId, senderId).catch(() => senderId);
587587
return await senderNamePromise;
588588
};
589-
const storeAllowFrom = await readStoreAllowFrom();
589+
const storeAllowFrom = isDirectMessage ? await readStoreAllowFrom() : [];
590590
const roomUsers = roomConfig?.users ?? [];
591591
const accessState = resolveMatrixMonitorAccessState({
592592
allowFrom,

0 commit comments

Comments
 (0)