fix: run Happy daemon as app user so it can find credentials #15
Reference in New Issue
Block a user
Delete Branch "fix/happy-daemon-user"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When
init-repo.shstarts the Happy daemon it runs as root, soHOME=/root. Happy Coder and Claude Code look for credentials and config in~/.happyand~/.claude, which resolve to/root/...— not/home/user/...where the actual user credentials live.This is why:
happylaunched from a VSCode terminal works (runs asuser, correct home dir)The fix uses
sudo -u <user> -Eso the daemon runs as the correct user while still inheriting the pod's environment variables (HAPPY_SERVER_URL,HAPPY_WEBAPP_URL,ANTHROPIC_API_KEY, etc.).Test plan
happyfrom terminal🤖 Generated with Claude Code