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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog

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(test): bound kitchen sink command output · openclaw/o...
vincentkoc · 2026-05-26 · via Recent Commits to openclaw:main

@@ -28,6 +28,10 @@ const INSTALL_TIMEOUT_MS = readPositiveInt(

2828

);

2929

const RPC_TIMEOUT_MS = readPositiveInt(process.env.OPENCLAW_KITCHEN_SINK_RPC_CALL_MS, 60000);

3030

const MAX_RSS_MIB = readPositiveInt(process.env.OPENCLAW_KITCHEN_SINK_MAX_RSS_MIB, 2048);

31+

const OUTPUT_CAPTURE_CHARS = readPositiveInt(

32+

process.env.OPENCLAW_KITCHEN_SINK_OUTPUT_CAPTURE_CHARS,

33+

1024 * 1024,

34+

);

3135

const DEFAULT_PORT = 19000 + Math.floor(Math.random() * 1000);

32363337

let callGatewayModulePromise;

@@ -109,14 +113,30 @@ function readJson(file) {

109113

return JSON.parse(fs.readFileSync(file, "utf8"));

110114

}

111115116+

export function appendBoundedOutput(buffer, chunk, maxChars = OUTPUT_CAPTURE_CHARS) {

117+

const text = String(chunk);

118+

const combined = `${buffer.text}${text}`;

119+

const overflowChars = Math.max(0, combined.length - maxChars);

120+

return {

121+

text: overflowChars > 0 ? combined.slice(overflowChars) : combined,

122+

truncatedChars: buffer.truncatedChars + overflowChars,

123+

};

124+

}

125+126+

function formatCapturedOutput(label, buffer) {

127+

return buffer.truncatedChars > 0

128+

? `[${label} truncated ${buffer.truncatedChars} chars]\n${buffer.text}`

129+

: buffer.text;

130+

}

131+112132

function runCommand(command, args, options = {}) {

113133

return new Promise((resolve, reject) => {

114134

const child = childProcess.spawn(command, args, {

115135

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

116136

...options,

117137

});

118-

let stdout = "";

119-

let stderr = "";

138+

let stdout = { text: "", truncatedChars: 0 };

139+

let stderr = { text: "", truncatedChars: 0 };

120140

const timeoutMs = options.timeoutMs ?? COMMAND_TIMEOUT_MS;

121141

let timedOut = false;

122142

const timer = setTimeout(() => {

@@ -125,10 +145,10 @@ function runCommand(command, args, options = {}) {

125145

setTimeout(() => child.kill("SIGKILL"), 2000).unref();

126146

}, timeoutMs);

127147

child.stdout?.on("data", (chunk) => {

128-

stdout += String(chunk);

148+

stdout = appendBoundedOutput(stdout, chunk);

129149

});

130150

child.stderr?.on("data", (chunk) => {

131-

stderr += String(chunk);

151+

stderr = appendBoundedOutput(stderr, chunk);

132152

});

133153

child.on("error", (error) => {

134154

clearTimeout(timer);

@@ -137,10 +157,21 @@ function runCommand(command, args, options = {}) {

137157

child.on("close", (status, signal) => {

138158

clearTimeout(timer);

139159

if (status === 0) {

140-

resolve({ stdout, stderr });

160+

resolve({

161+

stdout: stdout.text,

162+

stderr: stderr.text,

163+

stdoutTruncatedChars: stdout.truncatedChars,

164+

stderrTruncatedChars: stderr.truncatedChars,

165+

});

141166

return;

142167

}

143-

const detail = [stdout, stderr].filter(Boolean).join("\n").trim();

168+

const detail = [

169+

formatCapturedOutput("stdout", stdout),

170+

formatCapturedOutput("stderr", stderr),

171+

]

172+

.filter(Boolean)

173+

.join("\n")

174+

.trim();

144175

const failure = timedOut

145176

? `timed out after ${timeoutMs}ms`

146177

: `failed with ${signal || status}`;