惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
宝玉的分享
宝玉的分享
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 司徒正美
罗磊的独立博客
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
小众软件
小众软件
Jina AI
Jina AI

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(voice-call): bound tailscale status output · openclaw...
vincentkoc · 2026-05-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -18,12 +18,14 @@ vi.mock("node:child_process", async () => {

1818

});

1919
2020

import {

21+

appendTailscaleCommandStdout,

2122

cleanupTailscaleExposure,

2223

cleanupTailscaleExposureRoute,

2324

getTailscaleDnsName,

2425

getTailscaleSelfInfo,

2526

setupTailscaleExposure,

2627

setupTailscaleExposureRoute,

28+

TAILSCALE_COMMAND_STDOUT_MAX_BYTES,

2729

} from "./tailscale.js";

2830
2931

function createProc(params?: { code?: number; stdout?: string }) {

@@ -104,6 +106,21 @@ describe("voice-call tailscale helpers", () => {

104106

await expect(getTailscaleSelfInfo()).resolves.toBeNull();

105107

});

106108
109+

it("tracks tailscale stdout without retaining over-limit output", () => {

110+

let stdout = appendTailscaleCommandStdout({ bytes: 0, exceeded: false, text: "" }, "ok", 4);

111+

stdout = appendTailscaleCommandStdout(stdout, "boom", 4);

112+
113+

expect(stdout).toEqual({ bytes: 6, exceeded: true, text: "" });

114+

});

115+
116+

it("kills tailscale status when stdout exceeds the capture limit", async () => {

117+

const proc = createProc({ stdout: "x".repeat(TAILSCALE_COMMAND_STDOUT_MAX_BYTES + 1) });

118+

spawnMock.mockReturnValueOnce(proc);

119+
120+

await expect(getTailscaleSelfInfo()).resolves.toBeNull();

121+

expect(proc.kill).toHaveBeenCalledWith("SIGKILL");

122+

});

123+
107124

it("sets up and cleans up exposure routes with the selected mode", async () => {

108125

spawnMock

109126

.mockReturnValueOnce(

@@ -127,7 +144,7 @@ describe("voice-call tailscale helpers", () => {

127144

expect(spawnMock).toHaveBeenNthCalledWith(

128145

1,

129146

"tailscale",

130-

["status", "--json"],

147+

["status", "--json", "--peers=false"],

131148

tailscaleSpawnOptions,

132149

);

133150

expect(spawnMock).toHaveBeenNthCalledWith(

Original file line numberDiff line numberDiff line change

@@ -6,6 +6,30 @@ type TailscaleSelfInfo = {

66

nodeId: string | null;

77

};

88
9+

export const TAILSCALE_COMMAND_STDOUT_MAX_BYTES = 4 * 1024 * 1024;

10+
11+

type TailscaleCommandStdout = {

12+

bytes: number;

13+

exceeded: boolean;

14+

text: string;

15+

};

16+
17+

export function appendTailscaleCommandStdout(

18+

current: TailscaleCommandStdout,

19+

data: Buffer | string,

20+

maxBytes = TAILSCALE_COMMAND_STDOUT_MAX_BYTES,

21+

): TailscaleCommandStdout {

22+

if (current.exceeded) {

23+

return current;

24+

}

25+

const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data);

26+

const bytes = current.bytes + buffer.byteLength;

27+

if (bytes > maxBytes) {

28+

return { bytes, exceeded: true, text: "" };

29+

}

30+

return { bytes, exceeded: false, text: `${current.text}${buffer.toString("utf8")}` };

31+

}

32+
933

function runTailscaleCommand(

1034

args: string[],

1135

timeoutMs = 2500,

@@ -15,7 +39,7 @@ function runTailscaleCommand(

1539

stdio: ["ignore", "pipe", "pipe"],

1640

});

1741
18-

let stdout = "";

42+

let stdout: TailscaleCommandStdout = { bytes: 0, exceeded: false, text: "" };

1943

let settled = false;

2044

let timer: ReturnType<typeof setTimeout>;

2145

const finish = (result: { code: number; stdout: string }) => {

@@ -28,7 +52,11 @@ function runTailscaleCommand(

2852

};

2953
3054

proc.stdout.on("data", (data) => {

31-

stdout += data;

55+

stdout = appendTailscaleCommandStdout(stdout, data);

56+

if (stdout.exceeded) {

57+

proc.kill("SIGKILL");

58+

finish({ code: -1, stdout: "" });

59+

}

3260

});

3361
3462

timer = setTimeout(() => {

@@ -41,13 +69,13 @@ function runTailscaleCommand(

4169

});

4270
4371

proc.on("close", (code) => {

44-

finish({ code: code ?? -1, stdout });

72+

finish({ code: code ?? -1, stdout: stdout.text });

4573

});

4674

});

4775

}

4876
4977

export async function getTailscaleSelfInfo(): Promise<TailscaleSelfInfo | null> {

50-

const { code, stdout } = await runTailscaleCommand(["status", "--json"]);

78+

const { code, stdout } = await runTailscaleCommand(["status", "--json", "--peers=false"]);

5179

if (code !== 0) {

5280

return null;

5381

}