cloverleaf-larry/VERSION
Bryan Johnson 47452d3910 v0.6.4: cygpath -w wrap on every --rawfile/--slurpfile argv path
Bryan hit this on MobaXterm immediately after v0.6.3 shipped:

  C:\Users\...\bin\jq.exe: Bad JSON in --rawfile c /tmp/tmp.AlsIcdX9aO:
  Could not open /tmp/tmp.AlsIcdX9aO: No such file or directory
  error: OAuth token unavailable; run 'larry-auth.sh login' to re-authenticate
  error: empty response from API (timeout or network?)

Root cause is the same one v0.5.4 fixed for the OAuth file reads, but now
biting the new tempfile pipeline introduced for argv-overflow avoidance.
The Windows-native jq.exe shipped to MobaXterm via install-larry.sh
cannot resolve Cygwin paths like /tmp/tmp.X or /home/mobaxterm/.larry/...
when they come in as argv arguments to --rawfile / --slurpfile — it
interprets them as Windows paths and the open() fails.

v0.5.4 fixed this for stdin-read cases by piping via bash redirection
(`< "$file"`), since bash handles the cygwin→windows path open before
jq sees a file descriptor. But --rawfile / --slurpfile DO want a path
argument, so the stdin trick doesn't apply — we must give jq a path it
can actually open.

Fix: new jqpath() helper translates a cygwin path to its real Windows
equivalent via `cygpath -w` when cygpath exists (Cygwin / MobaXterm / MSYS).
On Linux and macOS cygpath is absent and the helper echoes the path
unchanged — true cross-platform no-op outside Cygwin.

Wrapped every --rawfile / --slurpfile argv path in larry.sh:
  add_user_text         --rawfile c ←
  add_assistant_blocks  --slurpfile b ←
  add_user_tool_results --slurpfile b ←
  agent_turn payload    --rawfile system, --slurpfile messages,
                        --slurpfile tools ←
  agent_turn tool-result aggregation  --rawfile c ←

Verified on macOS: jqpath echoes paths unchanged, the 40KB prompt
smoke test from v0.6.3 still works end-to-end.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:48:52 -07:00

2 lines
6 B
Plaintext