-
Inspect git status --short at the repository root and in thirdparty/llama.cpp. Do not discard unrelated user changes.
-
Run the updater from the repository root:
.codex/skills/update-llamacpp/scripts/update_xllamacpp.sh
-
The script first switches the parent xllamacpp repository to its upstream default branch from origin/HEAD (normally main) and fast-forwards it to the latest code. It then switches thirdparty/llama.cpp to the upstream default branch from origin/HEAD (currently master for llama.cpp), fetches it, fast-forwards to it, then runs recursive submodule sync and update inside thirdparty/llama.cpp.
-
After it completes, inspect the resulting submodule pointer change from the xllamacpp repository root with git status --short and git diff --submodule=log -- thirdparty/llama.cpp.
-
Refresh upstream tags when requested:
.codex/skills/update-llamacpp/scripts/update_llamacpp_tags.sh
-
The tag script fetches tags from thirdparty/llama.cpp's origin, prunes local tags that no longer exist upstream, and force-updates moved upstream tag refs. It does not move branches, commits, or the parent repository's recorded submodule pointer.
-
Check whether the vendored checkout is already pinned to the latest upstream release tag whose name starts with b:
latest_tag="$(
git -C thirdparty/llama.cpp for-each-ref refs/tags/b* \
--sort=-creatordate \
--format='%(refname:short)' \
--count=1
)"
test -n "$latest_tag"
latest_tag_commit="$(git -C thirdparty/llama.cpp rev-parse "${latest_tag}^{}")"
pinned_commit="$(git -C thirdparty/llama.cpp rev-parse HEAD)"
printf 'Latest llama.cpp b* tag: %s\nLatest b* tag commit: %s\nPinned commit: %s\n' \
"$latest_tag" "$latest_tag_commit" "$pinned_commit"
-
If the latest b* tag's peeled commit matches thirdparty/llama.cpp HEAD, stop: llama.cpp is already at the latest b* tagged release. If it differs, pin thirdparty/llama.cpp to the exact latest b* tag before continuing. The vendored submodule must end on a clean b* tag commit, not on upstream branch commits after the tag or on a non-b* tag:
latest_tag="$(
git -C thirdparty/llama.cpp for-each-ref refs/tags/b* \
--sort=-creatordate \
--format='%(refname:short)' \
--count=1
)"
test -n "$latest_tag"
git -C thirdparty/llama.cpp switch --detach "$latest_tag"
git -C thirdparty/llama.cpp describe --tags --exact-match HEAD
-
Build xllamacpp outside the sandbox before editing compatibility code:
.codex/skills/update-llamacpp/scripts/build_xllamacpp.sh
-
If the outside-sandbox build fails, inspect the log path printed by the script and use the first concrete CMake or compiler error to drive the next fix. Build failure is expected after many upstream llama.cpp updates. Do not patch build code for failures that only reproduce inside the sandbox.
-
Check changed generated llama.cpp headers for struct/class field additions, removals, C/C++ type changes, and enum member additions/removals. Treat src/llama.cpp/ as read-only while doing this review: