Skip to content

Fix macOS Tailscale CLI discovery for App Store installs#35

Open
Ninja3047 wants to merge 1 commit intomainfrom
fix-macos-tailscale
Open

Fix macOS Tailscale CLI discovery for App Store installs#35
Ninja3047 wants to merge 1 commit intomainfrom
fix-macos-tailscale

Conversation

@Ninja3047
Copy link

Summary

  • On macOS, Tailscale installed via the App Store places its CLI at /Applications/Tailscale.app/Contents/MacOS/Tailscale, which is not in PATH
  • check_local_tailscale() was running ["tailscale", ...] which fails with FileNotFoundError, incorrectly reporting Tailscale as unavailable
  • Added find_tailscale_cli() helper that checks PATH first, then falls back to the macOS App Store location on darwin

Test plan

  • New TestFindTailscaleCli tests cover: PATH hit, macOS App Store fallback, app not installed, Linux (no fallback), PATH skips fallback
  • Updated TestCheckLocalTailscale tests to use find_tailscale_cli mock
  • Added race-condition safety net test (test_tailscale_binary_vanishes)
  • Full test suite passes (274 tests)
  • prek run passes

🤖 Generated with Claude Code

On macOS, Tailscale installed via the App Store places its CLI at
/Applications/Tailscale.app/Contents/MacOS/Tailscale, which is not in
PATH. Add find_tailscale_cli() helper that checks PATH first, then
falls back to the macOS App Store location on darwin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Ninja3047 Ninja3047 requested a review from ret2libc as a code owner February 14, 2026 20:49
Copy link
Collaborator

@DarkaMaul DarkaMaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great, two nitpicks:

  • maybe the tests are a bit too comprehensive here (I flagged the binary_vanishes)
  • the missing binary error is not surfaced to the user - we could maybe have a better error message here

Comment on lines +176 to +182
@patch("dropkit.main.find_tailscale_cli", return_value="/usr/bin/tailscale")
@patch("dropkit.main.subprocess.run")
def test_tailscale_binary_vanishes(self, mock_run, mock_find):
"""Test race condition: binary found but gone by execution time."""
mock_run.side_effect = FileNotFoundError()
assert check_local_tailscale() is False

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that's a bit too much here?

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.

3 participants