fix(watch): resolve install mode without PATH so launchd/cron auto-reinstall fires - #87
Merged
Merged
Conversation
…install fires The launchd agent (and Linux cron) run with a minimal PATH that lacks ~/.local/bin, so `command -v devflow` returned empty and _detect_install_mode resolved to "none" - _auto_reinstall_check then returned early and the auto-update SILENTLY no-opped. The reliable launchd trigger was therefore useless: it fired, but what it fired could not find devflow to reinstall it. Two fixes: - _detect_install_mode now falls back to resolving the installed launcher directly when it is not on PATH: the DEVFLOW_ROOT-derived <prefix>/bin/devflow (copy install, honours a custom PREFIX), then ~/.local/bin/devflow, then the brew locations. It inspects the BINDIR launcher (not the repo source) so a `make link` symlink still reads as "link" and a copy install as "install". Verified live: under an emptied PATH it now returns "install" where it previously returned "none". - The launchd plist gains EnvironmentVariables > PATH (the launcher dir + standard dirs), so the agent's own subprocess can also find devflow, git, curl under launchd's minimal environment. Tests: pathless resolution for copy + link + custom-prefix-via-DEVFLOW_ROOT, plist PATH injection, and the "none" test tightened to require a truly empty environment. watch.bats 32/32; full make test-unit 126/0; make test green. Follow-up to #84 (launchd scheduler). Without this, #84's agent fires but never auto-updates on macOS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AndreJorgeLopes
added a commit
that referenced
this pull request
Jul 30, 2026
…er (#88) command -v devflow can return a relative ./bin/devflow when PATH has a relative entry, so watch setup pinned the launchd/cron entry to the source checkout via WorkingDirectory instead of the stable launcher. _devflow_launcher now resolves an absolute stable target (DEVFLOW_ROOT-derived BINDIR launcher, else absolutized command -v). watch.bats 34/34. Follow-up to #84/#87.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Follow-up to #84. The launchd agent (and Linux cron) run with a minimal PATH lacking
~/.local/bin, socommand -v devflowwas empty,_detect_install_modereturned "none", and_auto_reinstall_checkbailed early — the auto-update silently no-opped. The reliable trigger was useless because what it fired couldn't find devflow.Fix
_detect_install_modenow falls back to resolving the installed launcher directly when it's not on PATH:DEVFLOW_ROOT-derived<prefix>/bin/devflow(copy install, honours custom PREFIX) ->~/.local/bin/devflow-> brew paths. It inspects the BINDIR launcher, not the repo source, so amake linksymlink still readslinkand a copy installinstall.EnvironmentVariables > PATH(launcher dir + standard dirs) so the agent's subprocess also finds devflow/git/curl.Verification
_detect_install_modenow returnsinstall(wasnone).make test-unit126/0;make testgreen.Builds on v0.27.0. Without this, #84's launchd agent fires but never auto-updates on macOS.
🤖 Generated with Claude Code