Skip to content

fix(observability): auto-install dependencies on first run#550

Open
wojteksbt wants to merge 1 commit intodanielmiessler:mainfrom
wojteksbt:fix/observability-auto-install-deps
Open

fix(observability): auto-install dependencies on first run#550
wojteksbt wants to merge 1 commit intodanielmiessler:mainfrom
wojteksbt:fix/observability-auto-install-deps

Conversation

@wojteksbt
Copy link

Summary

  • Adds install_deps_if_needed() function to manage.sh
  • Automatically runs bun install when dependencies are missing
  • Checks for specific binaries (tsc, vite) not just directory existence
  • Works for both start and start-detached commands

Problem

When running manage.sh start after a fresh clone/download, the server fails silently because dependencies aren't installed. The script outputs "✅ Observability running" but ports aren't actually bound.

Solution

Check for required binaries before starting:

  • Server needs tsc → checks node_modules/.bin/tsc
  • Client needs vite → checks node_modules/.bin/vite

If missing, runs bun install automatically.

Test plan

  • Fresh install: dependencies auto-installed
  • Existing install: no unnecessary reinstall
  • Corrupted node_modules (empty .bin): triggers reinstall

Fixes #548

🤖 Generated with Claude Code

When running `manage.sh start` after a fresh download, the server would
fail silently because dependencies weren't installed. The script reported
success but ports weren't bound.

This adds an `install_deps_if_needed` function that checks for specific
binaries (tsc for server, vite for client) and runs `bun install` if
they're missing. Checking for specific files rather than just directory
existence handles cases where node_modules exists but is corrupted.

Fixes danielmiessler#548

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

pai-observability-server: manage.sh should auto-install dependencies

1 participant