From 47081edb7910daec544bd713e08c25e30b632858 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 20 Feb 2026 13:19:52 -0500 Subject: [PATCH] fix: restore HAPPY_HOME_DIR to PVC to preserve settings across restarts Moving it to /workspace (emptyDir) wiped Happy Coder's auth, config, and state on every pod restart. The daemon also failed to start on boot because the settings were gone. Keep HAPPY_HOME_DIR on the home PVC (/home/user/.happy) for persistence. The stale lock cleanup in init-repo.sh already handles the daemon.state.json.lock problem that motivated the workspace move. Co-Authored-By: Claude Sonnet 4.6 --- chart/values.yaml | 2 +- scripts/init-repo.sh | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 19b8281..34a7d38 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -12,7 +12,7 @@ githubRepo: "" # Happy Coder endpoints happyServerUrl: "https://happy.farh.net" happyWebappUrl: "https://happy-coder.farh.net" -happyHomeDir: "/workspace/.happy" +happyHomeDir: "/home/user/.happy" happyExperimental: "true" # VNC display diff --git a/scripts/init-repo.sh b/scripts/init-repo.sh index fe0e675..46b1313 100644 --- a/scripts/init-repo.sh +++ b/scripts/init-repo.sh @@ -63,10 +63,9 @@ chown "$RUN_UID:$RUN_GID" "$HOME" # so no sudo needed — Happy/Claude Code will find credentials in the correct home dir. echo "Starting Happy Coder..." -# HAPPY_HOME_DIR is in /workspace (emptyDir), so it is always fresh on pod start. -# Remove the lock file as a safety net in case daemon start is called more than -# once within the same container lifetime. -rm -f "${HAPPY_HOME_DIR:-/workspace/.happy}/daemon.state.json.lock" +# Remove stale lock file. HAPPY_HOME_DIR lives on the home PVC so it survives +# pod restarts — without this cleanup the daemon refuses to start after a crash. +rm -f "${HAPPY_HOME_DIR:-$HOME/.happy}/daemon.state.json.lock" cd "$WORKSPACE_DIR" happy daemon start || echo "Happy Coder daemon failed to start, continuing anyway..."