Skip to content

fix(install): loud dependency failures for jq, audio, and pdftotext#1073

Open
MHoroszowski wants to merge 1 commit intodanielmiessler:mainfrom
MHoroszowski:fix/install-loud-dependency-failures
Open

fix(install): loud dependency failures for jq, audio, and pdftotext#1073
MHoroszowski wants to merge 1 commit intodanielmiessler:mainfrom
MHoroszowski:fix/install-loud-dependency-failures

Conversation

@MHoroszowski
Copy link
Copy Markdown

Summary

install.sh previously hid package-manager errors behind
2>/dev/null and silently skipped runtime tools PAI actually needs,
so users on Linux/WSL hit cryptic failures well after install claimed
to succeed. This PR makes those failures loud and actionable.

install.sh (Releases/v4.0.3/.claude/PAI-Install/install.sh)

  • Package manager detection prelude — probes brew, apt-get,
    dnf, yum in that order and sets PKG_MGR (or unknown).
    Shared by the install branches and the dependency hints.
  • Loud git install — unknown package manager now exits 1 with a
    manual-install pointer instead of silently warning; apt/dnf/yum
    errors propagate. The Darwin/brew path is preserved
    byte-identical
    (no Mac available for testing — please verify on
    review).
  • Loud bun install — the curl ... | bash 2>/dev/null no longer
    swallows installer errors (network failures, missing unzip, arch
    mismatches).
  • Runtime dependency check — a new check_dep helper verifies
    jq, mpg123 OR ffplay, and pdftotext before the installer
    hands off to main.ts. Missing deps print a per-package-manager
    install command and link statusline-command.sh silently shows empty defaults when jq is missing (common on fresh Linux/WSL installs) #1065.

statusline-command.sh (Releases/v4.0.3/.claude/statusline-command.sh)

  • Early guard after set -o pipefail: if jq is missing, print an
    install hint and exit 0. The statusline is decorative and a
    non-zero exit would block Claude Code sessions — the actionable
    message is what closes the bug for affected users.

Test plan

  • bash -n on both files
  • Synthetic PATH isolation with jq removed: install.sh exits
    non-zero, names the missing deps, prints per-PKG_MGR hints
    (unknown branch tested), and links statusline-command.sh silently shows empty defaults when jq is missing (common on fresh Linux/WSL installs) #1065.
  • Synthetic happy path with all deps + apt-get in PATH:
    dep check passes, success banner prints, installer proceeds.
  • statusline-command.sh with jq masked: prints the install
    hint, exits 0.
  • git diff main... shows exactly the two files.
  • Darwin reviewer sanity-check: git install branch is unchanged
    from before this PR.

Fixes #1065

install.sh previously hid package-manager errors behind `2>/dev/null`
and silently skipped runtime tools PAI actually needs at runtime, so
users on Linux/WSL hit cryptic failures well after install claimed to
succeed. This adds:

- A `PKG_MGR` detection prelude (brew, apt-get, dnf, yum) used by the
  install branches and the dependency hints.
- A loud git install branch: unknown package managers now exit 1 with
  a manual-install pointer instead of silently warning; apt/dnf/yum
  errors propagate. The Darwin/brew path is preserved byte-identical.
- A loud bun install branch: the `curl ... | bash 2>/dev/null` no
  longer swallows installer errors.
- A new runtime dependency check (`check_dep` helper) that verifies
  jq, an audio player (mpg123 or ffplay), and pdftotext before the
  installer hands off to main.ts. Missing deps print a per-package-
  manager install command, link the tracking issue, and exit 1.

statusline-command.sh also now fails gracefully when jq is missing:
it prints an install hint and exits 0, since the statusline is
decorative and a non-zero exit would block Claude Code sessions.

Fixes danielmiessler#1065
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.

statusline-command.sh silently shows empty defaults when jq is missing (common on fresh Linux/WSL installs)

1 participant