FoolDev Claude Fable 5 commited on
Commit
d9d9f49
·
1 Parent(s): 9382597

fix(load_bundle): portable LFS-pointer size probe (wc -c, not GNU stat -c)

Browse files

resolve_bundle() sized the bundle with `stat -c '%s'`, GNU-only syntax that
errors on macOS/BSD stat (which needs `-f%z`). macOS is an advertised host
(Mac Studio in the Modelfile + README), so this leaked a stderr line there;
the empty-string-to-0 coercion only happened to preserve correct routing.
`wc -c < file` is POSIX and identical on GNU and BSD.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Files changed (2) hide show
  1. CHANGELOG.md +5 -0
  2. scripts/load_bundle.sh +1 -1
CHANGELOG.md CHANGED
@@ -26,6 +26,11 @@ track the **tooling and documentation**, not the underlying base model.
26
  override.
27
 
28
  ### Fixed
 
 
 
 
 
29
  - **`examples/llama_cpp_quickstart.py` system prompt restored.** Its
30
  `JANUS_SYSTEM` had truncated to five behavior rules (dropped "or
31
  meta-commentary" and "or incomplete", and omitted the creative-writing and
 
26
  override.
27
 
28
  ### Fixed
29
+ - **`scripts/load_bundle.sh` LFS-pointer size check is now portable.** The
30
+ bundle resolver probed file size with GNU-only `stat -c '%s'`, which errors on
31
+ macOS/BSD `stat` (that needs `-f%z`) — leaking a stderr line on an advertised
32
+ supported host (the Modelfile and README list Mac Studio as a working config).
33
+ Switched to `wc -c`, which is identical on GNU and BSD.
34
  - **`examples/llama_cpp_quickstart.py` system prompt restored.** Its
35
  `JANUS_SYSTEM` had truncated to five behavior rules (dropped "or
36
  meta-commentary" and "or incomplete", and omitted the creative-writing and
scripts/load_bundle.sh CHANGED
@@ -52,7 +52,7 @@ resolve_bundle() {
52
  # LFS pointer files are tiny (a couple hundred bytes) and start with
53
  # `version https://git-lfs.github.com/spec/v1`.
54
  local size
55
- size="$(stat -c '%s' "${file}")"
56
  if (( size < 1024 )) && head -n1 "${file}" | grep -q 'git-lfs'; then
57
  return 1
58
  fi
 
52
  # LFS pointer files are tiny (a couple hundred bytes) and start with
53
  # `version https://git-lfs.github.com/spec/v1`.
54
  local size
55
+ size="$(wc -c < "${file}")"
56
  if (( size < 1024 )) && head -n1 "${file}" | grep -q 'git-lfs'; then
57
  return 1
58
  fi