Skip to content

Commit 87b62b6

Browse files
lroolleclaude
andcommitted
fix(build): drop npm self-upgrade that breaks Docker builds
- Remove `npm install -g npm@latest` from copilot-api install step; npm replacing itself mid-execution corrupts its own node_modules when the cached layer has stale state - Remove the 5-attempt retry loop that only masked the real failure - Node 22 ships npm 10.x which handles `npm install -g pnpm` fine - Mount ~/.agents into container for agent state persistence Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 978f393 commit 87b62b6

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

Dockerfile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,7 @@ ARG COPILOT_API_VERSION
7979
LABEL org.opencontainers.image.copilot_api_version=${COPILOT_API_VERSION}
8080

8181
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
82-
set -eu && \
83-
i=0 && \
84-
while :; do \
85-
i=$((i + 1)) && \
86-
if npm install -g npm@latest pnpm; then \
87-
break; \
88-
fi; \
89-
if [ "$i" -ge 5 ]; then \
90-
echo "npm install failed after $i attempts" >&2; \
91-
exit 1; \
92-
fi; \
93-
echo "npm install failed (attempt $i), retrying..." >&2; \
94-
sleep $((i * 5)); \
95-
done && \
82+
npm install -g pnpm && \
9683
git clone --branch "${COPILOT_API_BRANCH}" "${COPILOT_API_REPO}" /tmp/copilot-api && \
9784
cd /tmp/copilot-api && \
9885
git checkout "${COPILOT_API_COMMIT}" && \

deva.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,6 +2976,9 @@ if [ "$CONFIG_HOME_FROM_CLI" = false ] && [ "$QUICK_MODE" = false ]; then
29762976
if [ -d "$HOME/.cache/deva" ]; then
29772977
DOCKER_ARGS+=("-v" "$HOME/.cache/deva:/home/deva/.cache/deva")
29782978
fi
2979+
if [ -d "$HOME/.agents" ]; then
2980+
DOCKER_ARGS+=("-v" "$HOME/.agents:/home/deva/.agents")
2981+
fi
29792982
fi
29802983
29812984
append_user_envs

0 commit comments

Comments
 (0)