rtk-ai/rtk

bug(telemetry): salt file not auto-created on macOS — device hash shows '(no salt file)'

Open

#1656 opened on May 1, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (48,085 stars) (2,914 forks)batch import
bugeffort-smallgood first issue

Description

Description

On macOS, rtk telemetry status shows device hash: (no salt file) even after running commands that should trigger generate_device_hash() (e.g. rtk gain).

Root cause

The salt_file_path() function uses dirs::data_local_dir(), which on macOS resolves to ~/Library/Application Support/not ~/.local/share/ (Linux convention). However, the auto-creation logic in get_or_create_salt() silently fails, leaving no salt file and no error message.

The telemetry status command reads the salt file path correctly (from ~/Library/Application Support/rtk/.device_salt), but since the file was never created, it falls back to (no salt file).

Steps to reproduce

  1. Fresh install via brew install rtk on macOS
  2. Run rtk gain or any command
  3. Run rtk telemetry status
  4. Observe: device hash: (no salt file)
  5. Check ~/.local/share/rtk/ — directory doesn't exist
  6. Check ~/Library/Application Support/rtk/.device_salt not present

Workaround

cp <some-salt> ~/Library/Application\ Support/rtk/.device_salt

After placing the file in the correct macOS path, rtk telemetry status shows the device hash correctly.

Expected behavior

The salt file should be auto-created at ~/Library/Application Support/rtk/.device_salt on first use on macOS.

Environment

  • OS: macOS (Darwin 25.4.0)
  • RTK version: 0.38.0
  • Installed via: Homebrew

Contributor guide