fix(doctor): avoid launchagent false positives · openclaw/openclaw@3536c92
steipete
·
2026-05-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,6 +25,7 @@ Docs: https://docs.openclaw.ai
|
25 | 25 | |
26 | 26 | - Agents/edit tool: honor `file_path` and related path aliases when resolving edit-recovery targets, so post-write errors no longer surface false edit failures after the file actually changed. Fixes #81909. Thanks @giodl73-repo. |
27 | 27 | - Gateway/diagnostics: add opt-in critical memory pressure stability snapshots with gateway logs, V8 heap, cgroup, active-resource, and redacted large session-file evidence. Fixes #82518. |
| 28 | +- Doctor/Gateway: avoid treating unrelated macOS LaunchAgents as legacy gateways just because their environment values mention old checkout paths. |
28 | 29 | - CLI/setup: collapse raw gateway config keys in existing-config summaries into friendly `Model` and `Gateway` rows. |
29 | 30 | - CLI/config: show concise human config-write output with an indented backup path instead of printing checksum-heavy overwrite audit details by default. |
30 | 31 | - CLI/docs: call the canonical lowercase docs MCP search tool and surface MCP errors instead of returning empty search results. Fixes #82702. (#82704) Thanks @hclsys. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -267,6 +267,27 @@ describe("findExtraGatewayServices (darwin / scanLaunchdDir) — real filesystem
|
267 | 267 | } |
268 | 268 | }); |
269 | 269 | |
| 270 | +it("does not report non-gateway LaunchAgents that mention clawdbot in environment values", async () => { |
| 271 | +const tmpHome = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-test-")); |
| 272 | +const launchdDir = path.join(tmpHome, "Library", "LaunchAgents"); |
| 273 | +try { |
| 274 | +await fs.mkdir(launchdDir, { recursive: true }); |
| 275 | +await fs.writeFile( |
| 276 | +path.join(launchdDir, "com.github.facebook.watchman.plist"), |
| 277 | +`<?xml version="1.0" encoding="UTF-8"?> |
| 278 | +<plist version="1.0"><dict> |
| 279 | +<key>Label</key><string>com.github.facebook.watchman</string> |
| 280 | +<key>EnvironmentVariables</key><dict><key>PATH</key><string>/Users/test/Projects/clawdbot2/node_modules/.bin:/opt/homebrew/bin</string></dict> |
| 281 | +<key>ProgramArguments</key><array><string>/opt/homebrew/bin/watchman</string><string>--foreground</string></array> |
| 282 | +</dict></plist>`, |
| 283 | +); |
| 284 | +const result = await findExtraGatewayServices({ HOME: tmpHome }); |
| 285 | +expect(result).toStrictEqual([]); |
| 286 | +} finally { |
| 287 | +await fs.rm(tmpHome, { recursive: true, force: true }); |
| 288 | +} |
| 289 | +}); |
| 290 | + |
270 | 291 | it("reports custom LaunchAgents that execute openclaw gateway", async () => { |
271 | 292 | const tmpHome = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-test-")); |
272 | 293 | const launchdDir = path.join(tmpHome, "Library", "LaunchAgents"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -300,7 +300,7 @@ async function scanLaunchdDir(params: {
|
300 | 300 | const marker = |
301 | 301 | hasGatewayServiceMarker(contents) || executionMarker === "openclaw" |
302 | 302 | ? "openclaw" |
303 | | - : executionMarker === "clawdbot" || legacyLabel || detectMarker(contents) === "clawdbot" |
| 303 | + : executionMarker === "clawdbot" || legacyLabel |
304 | 304 | ? "clawdbot" |
305 | 305 | : null; |
306 | 306 | if (!marker) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。