DeepTutor icon indicating copy to clipboard operation
DeepTutor copied to clipboard

[Bug]: macOS desktop cannot detect Homebrew-installed agent CLIs with a minimal PATH

Open iSanae233 opened this issue 1 month ago • 1 comments

Do you need to file an issue?

  • [x] I have searched the existing issues and this bug is not already filed.
  • [x] I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

When Open DeepTutor Desktop runs with a minimal macOS PATH, its agent detection can report Homebrew-installed Codex and DeepSeek Harness as not installed. The CLI executables are available in /opt/homebrew/bin, but that directory is absent from the desktop backend's inherited PATH. Finder-launched apps may have this minimal environment.

Steps to reproduce

  1. On Apple Silicon macOS, install Codex and DeepSeek Harness in /opt/homebrew/bin and confirm that codex --version and dsh --version work in a terminal.
  2. Run the unpatched desktop app with PATH=/usr/bin:/bin:/usr/sbin:/sbin and an isolated desktop data directory. This deliberately reproduces the restricted PATH relevant to Finder launches.
  3. Open the agent settings or query the local /api/subagents/backends/options endpoint.
  4. Observe that both installed tools are reported unavailable.

Expected Behavior

Installed agent CLIs in common macOS locations should be detected when the desktop app starts with a minimal system PATH.

Related Module

Partners / TutorBot — desktop runtime and local subagent detection.

Configuration Used

  • Unpatched desktop build: dev commit f7aed0744c36c5afef16a4261c31ebee1208cac2, DeepTutor 1.7.1, previously tested with isolated app data and a minimal PATH.
  • macOS 27.2, Apple Silicon (arm64).
  • Host CLIs: Codex 0.166.0; DeepSeek Harness 0.2.1-rc.5; both available in /opt/homebrew/bin.
  • Bundled runtime: Python 3.12.13 and Node.js 22.23.4.

Logs and screenshots

The earlier unpatched test returned available: false for both CLIs. The backend PATH included bundled runtime directories and the system directories, but omitted /opt/homebrew/bin. A direct probe with the minimal PATH could not find the CLIs; adding /opt/homebrew/bin made both detectable.

Additional Information

Proposed fix: #2256 targets this issue. It appends /opt/homebrew/bin, /usr/local/bin, and ~/.local/bin on macOS after the inherited PATH while preserving bundled Python and Node precedence and deduplicating entries. The same PATH is used by the desktop backend for detection and execution. The PR targets dev.

On 2026-11-02, I built and launched an ad-hoc-signed Apple Silicon test app with the PR's desktop shell and 1.7.0 core at commit c9f1f3b2e906a9c8c3d7ab843477ac7dcd5f021f, again using isolated data and the minimal PATH. /api/subagents/detect returned available: true for both Codex 0.166.0 and DeepSeek Harness 0.2.1-rc.5. The existing desktop tests passed 23/23, and the bundled runtime smoke test passed. This verifies detection, not an authenticated agent task.

Build limitation: after one fresh web build failed to resolve Google Fonts and a retry stalled during compilation for an unconfirmed reason, this test package reused the previously built frontend from f7aed0744c36c5afef16a4261c31ebee1208cac2; the web/ sources were identical between that commit and the PR commit, but the compiled frontend's version marker can differ from the 1.7.0 core. It is a local test build, not an official release.

Related: #759 describes a similar unavailable status on Windows, but its .cmd resolution cause differs from this macOS PATH issue.

A second macOS Apple Silicon test used then-current dev (f7aed0744c36c5afef16a4261c31ebee1208cac2, v1.7.1) with #2256 cherry-picked in an isolated local build. With a minimal system PATH and a fresh test home, the packaged app detected both CLIs (Codex 0.166.0 and DeepSeek Harness 0.2.1-rc.5). The existing desktop tests passed 23/23 and runtime smoke passed. This build reused the previously compiled frontend and dependency caches from the same v1.7.1 dev commit; it does not verify an authenticated agent task.

iSanae233 avatar Nov 02 '26 05:11 iSanae233

Fixed on local dev (800b11e9eb7335d0a42471a44660a76f99790819). fix(desktop): discover host CLIs when launched from Finder. Validated with targeted regression tests and compatibility checks.

will be fixed in the next releases!

pancacake avatar Nov 14 '26 16:11 pancacake