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:
Peter Steinberger
2026-07-14 04:08:36 -07:00
committed by GitHub
parent 6ceb72d2bd
commit c56d1bbbbb
4 changed files with 17 additions and 2 deletions
+11
View File
@@ -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);
});
});
-1
View File
@@ -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,
+4
View File
@@ -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);
+2 -1
View File
@@ -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 }) => {