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

推荐订阅源

MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
腾讯CDC
GbyAI
GbyAI
I
InfoQ
博客园 - Franky
G
Google Developers Blog
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Vercel News
Vercel News
博客园_首页
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
V
V2EX
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub 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(qa): keep kitchen sink sampling scoped · openclaw/ope...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -1677,15 +1677,20 @@ async function samplePosixProcessWithDescendants(pid, run) {

16771677

const { stdout } = await run("ps", POSIX_PROCESS_SNAPSHOT_ARGS, {

16781678

timeoutMs: 5000,

16791679

});

1680-

const rows = parsePosixProcessRows(stdout);

1681-

if (!rows) {

1680+

const snapshot = parsePosixProcessRows(stdout);

1681+

if (!snapshot) {

16821682

return null;

16831683

}

1684+

const { malformedRows, rows } = snapshot;

16841685

const selected = rows.find((row) => row.processId === safePid);

16851686

if (!selected) {

16861687

return null;

16871688

}

1688-

return formatPosixProcessTreeSample(selected, collectPosixProcessTree(rows, safePid));

1689+

const treeRows = collectPosixProcessTree(rows, safePid);

1690+

if (hasMalformedProcessTreeRows(malformedRows, treeRows)) {

1691+

return null;

1692+

}

1693+

return formatPosixProcessTreeSample(selected, treeRows);

16891694

} catch {

16901695

return null;

16911696

}

@@ -1700,13 +1705,16 @@ async function samplePosixProcessTree(pid, run, commandLineNeedles) {

17001705

const { stdout } = await run("ps", POSIX_PROCESS_SNAPSHOT_ARGS, {

17011706

timeoutMs: 5000,

17021707

});

1703-

const rows = parsePosixProcessRows(stdout);

1704-

if (!rows) {

1708+

const snapshot = parsePosixProcessRows(stdout);

1709+

if (!snapshot) {

17051710

return null;

17061711

}

1707-

const descendants = collectPosixProcessTree(rows, safePid).filter(

1708-

(row) => row.processId !== safePid,

1709-

);

1712+

const { malformedRows, rows } = snapshot;

1713+

const rootTreeRows = collectPosixProcessTree(rows, safePid);

1714+

if (hasMalformedProcessTreeRows(malformedRows, rootTreeRows)) {

1715+

return null;

1716+

}

1717+

const descendants = rootTreeRows.filter((row) => row.processId !== safePid);

17101718

const commandMatches = descendants.filter((row) =>

17111719

commandLineNeedles.every((needle) =>

17121720

row.command.toLowerCase().includes(needle.toLowerCase()),

@@ -1736,6 +1744,7 @@ async function samplePosixProcessTree(pid, run, commandLineNeedles) {

1736174417371745

function parsePosixProcessRows(stdout) {

17381746

const rows = [];

1747+

const malformedRows = [];

17391748

for (const line of stdout.split(/\r?\n/u)) {

17401749

const match = line.match(/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/u);

17411750

if (!match) {

@@ -1754,7 +1763,11 @@ function parsePosixProcessRows(stdout) {

17541763

!Number.isInteger(parentProcessId) ||

17551764

!Number.isInteger(rssKb)

17561765

) {

1757-

return null;

1766+

malformedRows.push({

1767+

pidRaw,

1768+

ppidRaw,

1769+

});

1770+

continue;

17581771

}

17591772

rows.push({

17601773

processId,

@@ -1764,7 +1777,7 @@ function parsePosixProcessRows(stdout) {

17641777

command: command ?? "",

17651778

});

17661779

}

1767-

return rows;

1780+

return { malformedRows, rows };

17681781

}

1769178217701783

function parseStrictNonNegativeDecimal(raw) {

@@ -1820,6 +1833,32 @@ function collectPosixProcessTree(rows, rootPid) {

18201833

return collected;

18211834

}

182218351836+

function hasMalformedProcessTreeRows(malformedRows, treeRows) {

1837+

if (malformedRows.length === 0 || treeRows.length === 0) {

1838+

return false;

1839+

}

1840+

const treePids = new Set(treeRows.map((row) => row.processId));

1841+

return malformedRows.some(

1842+

(row) =>

1843+

rawProcessTokenMatchesTree(row.pidRaw, treePids) ||

1844+

rawProcessTokenMatchesTree(row.ppidRaw, treePids),

1845+

);

1846+

}

1847+1848+

function rawProcessTokenMatchesTree(raw, treePids) {

1849+

const text = String(raw ?? "").trim();

1850+

for (const pid of treePids) {

1851+

const pidText = String(pid);

1852+

if (text === pidText) {

1853+

return true;

1854+

}

1855+

if (text.startsWith(pidText) && !/\d/u.test(text.at(pidText.length) ?? "")) {

1856+

return true;

1857+

}

1858+

}

1859+

return false;

1860+

}

1861+18231862

function selectPeakRssProcess(rows) {

18241863

return rows.reduce((peak, row) => (peak && peak.rssKb >= row.rssKb ? peak : row), null);

18251864

}