Skip to content

fix(service): find Homebrew tools in macOS LaunchAgents - #2883

Closed
mmhh256 wants to merge 1 commit into
TencentCloud:developfrom
mmhh256:fix/launchd-homebrew-path
Closed

mmhh256 wants to merge 1 commit into
TencentCloud:developfrom
mmhh256:fix/launchd-homebrew-path

Conversation

@mmhh256

@mmhh256 mmhh256 commented Nov 7, 2026

Copy link
Copy Markdown

Summary

Fixes #2881. A per-user macOS LaunchAgent starts with a system-only PATH, so Octop cannot find Homebrew's adb even when it works in the user's shell.

Generate a fixed PATH for user LaunchAgents with the macOS system directories first, followed by the standard Apple Silicon and Intel Homebrew bin directories. The renderer does not inherit the installer's shell PATH or change system LaunchDaemons. Existing custom plists are preserved during normal startup; users can regenerate an existing managed plist explicitly with octop service start --scope user --force-install.

Target branch

  • Base is develop

Type of change

  • Bug fix

Test plan

  • The new plist regression failed before the change with KeyError: 'PATH' and passed afterward. It checks both Homebrew prefixes, system directory precedence, and that the installer's PATH is not copied. The system-scope test verifies that LaunchDaemons still do not set PATH.
  • uv run --no-sync pytest -q tests/unit/infra/setup/test_service.py tests/unit/mobile/test_find_adb.py tests/unit/cli/test_service_cmd.py — 66 passed on Linux.
  • make lint typecheck RUN='uv run --no-sync' — Ruff lint/format and mypy passed.
  • The full non-live backend suite reported failures in this workspace and has not been verified green. No live macOS launchd/ADB verification or macOS screenshot was available.

Checklist

  • Added regression tests and updated CHANGELOG.md.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

This pull request was closed by a temporary author restriction.

Pull requests may only be opened by:

  • users who already have a merged pull request in this repository
  • users with admin, maintain, or write access
  • users listed in .github/pr-author-allowlist.txt or the PR_AUTHOR_ALLOWLIST repository variable

Ask a maintainer to add your GitHub login to that allowlist, then reopen the pull request.


此 Pull Request 已被临时的作者限制自动关闭。

当前仅允许以下用户创建 PR:

  • 已有 Pull Request 被合入本仓库的贡献者
  • 拥有 admin、maintain 或 write 权限的用户
  • 写在 .github/pr-author-allowlist.txt 或仓库变量 PR_AUTHOR_ALLOWLIST 中的用户

如需在首次合入前贡献,请联系维护者把 GitHub 用户名加入允许名单,然后再重新打开这个 PR。

维护者可将仓库变量 PR_AUTHOR_GUARD 设为 off 以关闭此限制。

@github-actions github-actions Bot closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant