fix(hermes-agent): reinstall codex when this arch's native dep is missing
The arch-specific CLI stamp assumed the shared node_modules keeps both arches' codex native deps, but a sibling-arch npm install removes this arch's binary from the shared volume. So after running on the other arch, the stamp exists yet the native codex dep is gone -> configure-agent-clients fails -> churn. Gate the install on the current arch's native codex package being present, so it self-heals.
This commit is contained in:
parent
70002aeff7
commit
e7d6759140
@ -425,12 +425,15 @@ spec:
|
|||||||
chmod 0755 "${tools}/bin/ttyd.tmp"
|
chmod 0755 "${tools}/bin/ttyd.tmp"
|
||||||
mv "${tools}/bin/ttyd.tmp" "${tools}/bin/ttyd"
|
mv "${tools}/bin/ttyd.tmp" "${tools}/bin/ttyd"
|
||||||
fi
|
fi
|
||||||
# The CLI stamp is arch-specific: npm only materializes the current
|
# npm materializes codex's native optional dep only for the current
|
||||||
# arch's native optional deps (e.g. @openai/codex-linux-x64), so a
|
# platform, and a sibling-arch `npm install` on the SHARED volume
|
||||||
# fresh arch must re-run the install even though the shared volume
|
# removes this arch's native binary (node_modules is shared across
|
||||||
# already holds the other arch's node_modules. npm keeps both
|
# nodes). So re-run the install whenever this arch's native codex
|
||||||
# arches' optional packages, so this never clobbers the sibling arch.
|
# package is absent — not only when the arch stamp is missing —
|
||||||
if [ ! -f "${tools}/.cli-versions-0.147.0-2.1.226-${arch}" ]; then
|
# which self-heals after the pod has run on the other architecture.
|
||||||
|
case "$(uname -m)" in x86_64) nodearch=x64 ;; aarch64) nodearch=arm64 ;; *) nodearch=unknown ;; esac
|
||||||
|
codex_native="${tools}/lib/node_modules/@openai/codex-linux-${nodearch}"
|
||||||
|
if [ ! -f "${tools}/.cli-versions-0.147.0-2.1.226-${arch}" ] || [ ! -d "${codex_native}" ]; then
|
||||||
npm install --global --omit=dev --no-audit --no-fund --prefix "${tools}" \
|
npm install --global --omit=dev --no-audit --no-fund --prefix "${tools}" \
|
||||||
@openai/codex@0.147.0 \
|
@openai/codex@0.147.0 \
|
||||||
@anthropic-ai/claude-code@2.1.226
|
@anthropic-ai/claude-code@2.1.226
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user