mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 19:08:22 -06:00
fix(test): sample direct POSIX gateway process
This commit is contained in:
@@ -1873,12 +1873,14 @@ async function samplePosixProcessTree(pid, run, commandLineNeedles) {
|
||||
if (hasMalformedProcessTreeRows(malformedRows, rootTreeRows)) {
|
||||
return null;
|
||||
}
|
||||
const rootRow = rootTreeRows.find((row) => row.processId === safePid) ?? null;
|
||||
const descendants = rootTreeRows.filter((row) => row.processId !== safePid);
|
||||
const commandMatches = descendants.filter((row) =>
|
||||
const matchesCommandNeedles = (row) =>
|
||||
commandLineNeedles.every((needle) =>
|
||||
row.command.toLowerCase().includes(needle.toLowerCase()),
|
||||
),
|
||||
);
|
||||
);
|
||||
const commandMatches = descendants.filter(matchesCommandNeedles);
|
||||
const rootCommandMatches = rootRow && matchesCommandNeedles(rootRow) ? [rootRow] : [];
|
||||
const gatewayTitleMatches = descendants.filter((row) =>
|
||||
row.command.toLowerCase().includes("openclaw-gateway"),
|
||||
);
|
||||
@@ -1887,7 +1889,9 @@ async function samplePosixProcessTree(pid, run, commandLineNeedles) {
|
||||
? commandMatches
|
||||
: gatewayTitleMatches.length > 0
|
||||
? gatewayTitleMatches
|
||||
: descendants,
|
||||
: descendants.length > 0
|
||||
? descendants
|
||||
: rootCommandMatches,
|
||||
);
|
||||
if (!selected) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user