Skip to content

Commit 00cb90f

Browse files
sanil-23claude
authored andcommitted
fix(memory_tree,sync_status,scripts): IMMEDIATE-tx ingest, reembed skip-persistence, sidecar-based sync-status accounting, Windows dev-script PATH (tinyhumansai#2349)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: sanil-23 <sanil@alphahuman.xyz>
1 parent 7765393 commit 00cb90f

7 files changed

Lines changed: 786 additions & 110 deletions

File tree

scripts/run-dev-win.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,29 @@ if [[ -z "$PNPM_EXE" ]]; then
488488
exit 1
489489
fi
490490
echo "[run-dev-win] pnpm resolved to: $PNPM_EXE"
491+
492+
# `cargo tauri dev` runs its beforeDevCommand (`pnpm run dev`) via a native
493+
# `cmd /S /C` that resolves bare `pnpm` off PATH. This script otherwise only
494+
# ever calls pnpm by absolute path, so its dir was never on PATH and Tauri
495+
# dies with "'pnpm' is not recognized". Prepend the resolved pnpm's dir — it
496+
# ships pnpm.CMD alongside the bash shim, which cmd.exe uses.
497+
# Split the dirname computation out of the export so a `dirname` failure
498+
# surfaces with a non-zero exit (SC2155) instead of being swallowed by the
499+
# enclosing `export`. `dirname` on a validated absolute path is reliable
500+
# in practice, but the strict-mode posture is worth the extra line.
501+
PNPM_DIR="$(dirname "$PNPM_EXE")"
502+
# `dirname` returns `.` for a bare filename (e.g. if PNPM_EXE somehow
503+
# resolved to just "pnpm" without a path component). Prepending `.` would
504+
# inject the current working directory into PATH on a Windows dev machine
505+
# — a privilege-escalation-flavoured surprise. Skip the prepend in that
506+
# case (and on the also-degenerate empty result); the absolute-path call
507+
# sites elsewhere in this script still work.
508+
if [[ -n "$PNPM_DIR" && "$PNPM_DIR" != "." ]]; then
509+
export PATH="$PNPM_DIR:$PATH"
510+
echo "[run-dev-win] pnpm dir prepended to PATH: $PNPM_DIR"
511+
else
512+
echo "[run-dev-win] pnpm dir not prepended to PATH (PNPM_EXE has no path component: $PNPM_EXE)"
513+
fi
491514
echo "[run-dev-win] node on bash PATH: $(command -v node 2>/dev/null || echo '<not found>')"
492515
echo "[run-dev-win] node.exe on bash PATH: $(command -v node.exe 2>/dev/null || echo '<not found>')"
493516

@@ -576,6 +599,25 @@ else
576599
DEV_PORT=1420
577600
fi
578601

602+
# Tauri spawns beforeDevCommand (`pnpm run dev`) via a native `cmd /S /C`
603+
# inheriting THIS process's env. By here PATH has the full system PATH stacked
604+
# several times over (vcvars rebuild + Git-Bash /etc/profile re-runs + pnpm
605+
# .bin layering); the MSYS→Windows conversion overflows the process
606+
# environment-block limit, so the child inherits an EMPTY PATH and Tauri dies
607+
# with "'pnpm' is not recognized" (even `where` is gone). Collapse PATH to
608+
# first-seen entries (clean POSIX `/c/...` entries, so ':' split is safe).
609+
_dedup_seen=":"
610+
_dedup_new=""
611+
IFS=':' read -ra _dedup_parts <<< "$PATH"
612+
for _dp in "${_dedup_parts[@]}"; do
613+
[[ -z "$_dp" ]] && continue
614+
case "$_dedup_seen" in *":$_dp:"*) continue ;; esac
615+
_dedup_seen="${_dedup_seen}${_dp}:"
616+
_dedup_new="${_dedup_new:+$_dedup_new:}$_dp"
617+
done
618+
export PATH="$_dedup_new"
619+
echo "[run-dev-win] PATH de-duplicated: ${#_dedup_parts[@]}$(awk -v RS=: 'END{print NR}' <<< "$_dedup_new") entries"
620+
579621
if (( DEV_PORT != 1420 )); then
580622
echo "[run-dev-win] OPENHUMAN_DEV_PORT=$DEV_PORT — overriding tauri devUrl"
581623
"$PNPM_EXE" tauri dev -c "{\"build\":{\"devUrl\":\"http://localhost:$DEV_PORT\"}}"

0 commit comments

Comments
 (0)