Skip to content

fix(macos): check disk space on INSTALL_DIR instead of $HOME#103

Merged
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/97-disk-space-install-dir
Mar 9, 2026
Merged

fix(macos): check disk space on INSTALL_DIR instead of $HOME#103
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/97-disk-space-install-dir

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

Summary

  • Pass $INSTALL_DIR (not $HOME) to test_disk_space() at both call sites in install-macos.sh
  • Add parent-directory traversal in test_disk_space() so df resolves to the nearest existing mount point when the target directory hasn't been created yet (first install)

The disk-space preflight always checked $HOME, which reports the wrong volume when the user sets DS_INSTALL_DIR to an external drive. This caused installs to proceed even when the target volume was full, or to block installs when the boot volume was full but the target had plenty of space.

Safety

  • Default installs ($HOME/dream-server): traversal reaches $HOME (exists) → identical behavior to before
  • External volume: traversal reaches the mount point → df reports the correct volume
  • Root edge case: dirname "/" = /, which exists → loop always terminates

Test plan

  • Install with default DS_INSTALL_DIR (unchanged behavior)
  • Install with DS_INSTALL_DIR pointing to an external volume — verify disk check reports that volume's free space
  • Install with DS_INSTALL_DIR pointing to a non-existent nested path (/Volumes/ExtDrive/deep/nested/path) — verify traversal resolves to /Volumes/ExtDrive

Fixes #97

🤖 Generated with Claude Code

The disk-space preflight always checked $HOME, which reports the wrong
volume when the user installs to an external drive (DS_INSTALL_DIR).

- Pass $INSTALL_DIR to test_disk_space() at both call sites
- Add parent-directory traversal so df resolves to an existing mount
  even when the target directory hasn't been created yet

Fixes #97

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lightheartdevs Lightheartdevs merged commit 2a1d0b3 into Light-Heart-Labs:main Mar 9, 2026
4 of 15 checks passed
Lightheartdevs added a commit that referenced this pull request Mar 9, 2026
- yasinBursali: add PRs #103 (macOS disk space fix) and #104 (embeddings
  platform override)
- bugman-007: add PR #105 (backup/restore CLI integration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Muhammad-Sulleman added a commit to Muhammad-Sulleman/DreamServer that referenced this pull request Mar 10, 2026
- Move disk space calculation logic into lib/disk.sh for reuse
- Replace duplicated ~30-line block in Phase 1 and Phase 2 with
  single calculate_needed_disk() call from lib/disk.sh
- Fix disk checks to use $INSTALL_DIR instead of $HOME to correctly
  support external drive installs (restores fix from PR Light-Heart-Labs#103)
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.

fix(macos): disk space check hardcodes $HOME, fails for external volume installs

2 participants