Beautiful Open-Source Form Builder
fix: stabilize Codex worktree frontend startup (#1213)
Julien Nahum5cd7c75135ec
diff --git a/scripts/codex-worktree-lib.sh b/scripts/codex-worktree-lib.shindex 84b186f86..791d0cd65 100755--- a/scripts/codex-worktree-lib.sh+++ b/scripts/codex-worktree-lib.sh@@ -261,10 +261,12 @@ select_node_runtime() {fiherd_node="$HOME/Library/Application Support/Herd/config/nvm/versions/node/v20.20.1/bin/node"+ homebrew_node="/opt/homebrew/bin/node"+ local_node="/usr/local/bin/node"bundled_node="$HOME/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node"path_node=$(command -v node 2>/dev/null || true)- for candidate in "$herd_node" "$bundled_node" "$path_node"; do+ for candidate in "$herd_node" "$homebrew_node" "$local_node" "$bundled_node" "$path_node"; doif select_node_candidate "$candidate"; thenreturn 0fidiff --git a/scripts/codex-worktree-up.sh b/scripts/codex-worktree-up.shindex 08b708c61..f28d9bb62 100755--- a/scripts/codex-worktree-up.sh+++ b/scripts/codex-worktree-up.sh@@ -76,6 +76,11 @@ start_client() {exit 1fi+ # Vite's optimized dependency cache is transient. It can retain references+ # to chunks removed by npm ci, causing the Nuxt dev server to crash on first+ # navigation in a freshly created worktree.+ rm -rf "$ROOT_DIR/client/node_modules/.cache/vite"+if command -v screen >/dev/null 2>&1; thenrm -f "$CODEX_STATE_DIR/client.pid"screen -dmS "$CODEX_CLIENT_SCREEN" sh -c "cd '$ROOT_DIR/client' && set -a && . '$CODEX_CLIENT_ENV_FILE' && set +a && echo \$\$ >'$CODEX_STATE_DIR/client.pid' && exec env PATH='$PATH' RUNNER_TRACKING_ID= NUXT_HOST='$CODEX_APP_HOST' NUXT_PORT='$CODEX_APP_PORT' '$CODEX_NPM_BIN' run dev -- --host '$CODEX_APP_HOST' --port '$CODEX_APP_PORT' >'$CODEX_STATE_DIR/client.log' 2>&1"