Skip to content

Generated daemon watchdog hardcodes /opt/homebrew/bin/tracedecay, so recovery never works on other install paths #731

Description

@BleedingDev

Environment

tracedecay 0.0.74, macOS 26.7 arm64. Binary installed at ~/.local/bin/tracedecay, not via Homebrew.

Problem

The generated watchdog script ~/.local/bin/tracedecay-daemon-watchdog hardcodes a Homebrew path as its default:

readonly tracedecay_bin="${TRACEDECAY_WATCHDOG_BINARY:-/opt/homebrew/bin/tracedecay}"

On an install that is not in /opt/homebrew/bin, every recovery attempt fails:

tracedecay-daemon-watchdog:40: no such file or directory: /opt/homebrew/bin/tracedecay
daemon recovery attempt failed; will retry after the grace period

The daemon died and stayed dead. The watchdog failed 202 consecutive times over about 3 hours on its 30 second interval, and never recovered it.

Downstream, anything waiting on daemon.sock broke: the MCP server timed out awaiting tools/list after 30s, and hooks blew their 5 second timeouts. Neither symptom points at the watchdog, so this took a while to find.

The daemon plist generated by the same install is correct and uses the real absolute path. Only the watchdog has the wrong default.

Fix

Resolve the binary the way the daemon plist already does. A command -v lookup with an absolute fallback also works, and the fallback matters because launchd runs the script with a minimal PATH:

readonly tracedecay_bin="${TRACEDECAY_WATCHDOG_BINARY:-$(command -v tracedecay 2>/dev/null || print -r -- /absolute/path/to/tracedecay)}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions