Skip to content

Commit 1a04b8e

Browse files
committed
test(plugins): review channel daemon spawn findings
1 parent a21144d commit 1a04b8e

3 files changed

Lines changed: 11 additions & 20 deletions

File tree

extensions/raft/src/gateway.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@
22
import { spawn, type ChildProcess } from "node:child_process";
33
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
44
import type { EventEmitter } from "node:events";
5-
import {
6-
createServer,
7-
type IncomingMessage,
8-
type Server,
9-
type ServerResponse,
10-
} from "node:http";
5+
import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http";
116
import type { Socket } from "node:net";
12-
import {
13-
keepHttpServerTaskAlive,
14-
waitUntilAbort,
15-
} from "openclaw/plugin-sdk/channel-outbound";
167
import type { ChannelGatewayContext } from "openclaw/plugin-sdk/channel-contract";
8+
import { keepHttpServerTaskAlive, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
179
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
18-
import {
19-
createClaimableDedupe,
20-
type ClaimableDedupe,
21-
} from "openclaw/plugin-sdk/persistent-dedupe";
10+
import { createClaimableDedupe, type ClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
2211
import { RAFT_CHANNEL_ID, type ResolvedRaftAccount } from "./accounts.js";
2312
import { dispatchRaftWake } from "./inbound.js";
2413

@@ -54,11 +43,7 @@ type RaftBridgeProcess = Pick<ChildProcess, "kill"> & Pick<EventEmitter, "once">
5443

5544
type RaftGatewayDeps = {
5645
createToken?: () => string;
57-
spawnBridge?: (params: {
58-
profile: string;
59-
endpoint: string;
60-
token: string;
61-
}) => RaftBridgeProcess;
46+
spawnBridge?: (params: { profile: string; endpoint: string; token: string }) => RaftBridgeProcess;
6247
wakeDedupe?: ClaimableDedupe;
6348
};
6449

@@ -80,6 +65,8 @@ function spawnRaftBridge(params: {
8065
endpoint: string;
8166
token: string;
8267
}): RaftBridgeProcess {
68+
// Raft owns the fixed bridge command. OpenClaw passes profile/loopback
69+
// endpoint/token as separate argv/env fields; wake payloads never reach argv.
8370
return spawn(
8471
"raft",
8572
[
@@ -247,7 +234,7 @@ export async function startRaftGatewayAccount(
247234
onDiskError: (error) => {
248235
ctx.log?.warn?.(`Raft wake dedupe storage failed: ${String(error)}`);
249236
},
250-
});
237+
});
251238
const token = (deps.createToken ?? createToken)();
252239
const runtimeSession = randomUUID();
253240
const sockets = new Set<Socket>();

extensions/signal/src/daemon.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ function buildDaemonArgs(opts: SignalDaemonOpts): string[] {
116116

117117
export function spawnSignalDaemon(opts: SignalDaemonOpts): SignalDaemonHandle {
118118
const args = buildDaemonArgs(opts);
119+
// The executable is operator-selected or setup-discovered signal-cli.
120+
// Runtime message content only flows through the daemon HTTP API, not argv.
119121
const child = spawn(opts.cliPath, args, {
120122
stdio: ["ignore", "pipe", "pipe"],
121123
});

src/plugins/npm-install-security-scan.release.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const REQUIRED_REVIEWED_PUBLISHABLE_CRITICAL_FINDINGS = new Set([
3434
"@openclaw/google-meet:dangerous-exec:src/node-host.ts",
3535
"@openclaw/google-meet:dangerous-exec:src/realtime.ts",
3636
"@openclaw/matrix:dangerous-exec:src/matrix/deps.ts",
37+
"@openclaw/raft:dangerous-exec:src/gateway.ts",
38+
"@openclaw/signal:dangerous-exec:src/daemon.ts",
3739
"@openclaw/voice-call:dangerous-exec:src/tunnel.ts",
3840
"@openclaw/voice-call:dangerous-exec:src/webhook/tailscale.ts",
3941
]);

0 commit comments

Comments
 (0)