mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(reef): send through the connected gateway (#107373)
* fix(reef): route outbound through gateway * chore: keep Reef release note in PR
This commit is contained in:
committed by
GitHub
parent
6ceb72d2bd
commit
c56d1bbbbb
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import reefEntry from "./index.js";
|
||||
import { reefPlugin } from "./src/channel.js";
|
||||
import { reefOutboundAdapter } from "./src/outbound.js";
|
||||
|
||||
describe("reef bundled entry", () => {
|
||||
it("keeps outbound delivery on the canonical channel plugin", () => {
|
||||
expect(reefEntry.loadChannelOutbound).toBeUndefined();
|
||||
expect(reefPlugin.outbound).toBe(reefOutboundAdapter);
|
||||
});
|
||||
});
|
||||
@@ -26,7 +26,6 @@ export default defineBundledChannelEntry({
|
||||
description: "Guarded end-to-end encrypted claw channel",
|
||||
importMetaUrl: import.meta.url,
|
||||
plugin: { specifier: "./channel-plugin-api.js", exportName: "reefPlugin" },
|
||||
outbound: { specifier: "./api.js", exportName: "reefOutboundAdapter" },
|
||||
runtime: { specifier: "./runtime-api.js", exportName: "setReefRuntime" },
|
||||
registerCliMetadata: registerReefCliMetadata,
|
||||
registerFull: registerReefFullRuntime,
|
||||
|
||||
@@ -3,6 +3,10 @@ import { reefOutboundAdapter } from "./outbound.js";
|
||||
import { setActiveReef } from "./runtime.js";
|
||||
|
||||
describe("reefOutboundAdapter", () => {
|
||||
it("delegates delivery to the Gateway that owns the active encrypted flow", () => {
|
||||
expect(reefOutboundAdapter.deliveryMode).toBe("gateway");
|
||||
});
|
||||
|
||||
it("normalizes the SDK target and delegates only message content/context to the guarded flow", async () => {
|
||||
const send = vi.fn(async () => "01JZ0000000000000000000200");
|
||||
setActiveReef({ flow: { send }, friends: {}, reviews: {} } as never);
|
||||
|
||||
@@ -27,7 +27,8 @@ async function send(
|
||||
}
|
||||
|
||||
export const reefOutboundAdapter: ChannelOutboundAdapter = {
|
||||
deliveryMode: "direct",
|
||||
// The encrypted flow belongs to the Gateway account lifecycle; other processes must delegate.
|
||||
deliveryMode: "gateway",
|
||||
textChunkLimit: 32 * 1024,
|
||||
deliveryCapabilities: { durableFinal: { text: true, replyTo: true, thread: true } },
|
||||
resolveTarget: ({ to }) => {
|
||||
|
||||
Reference in New Issue
Block a user