fix(worker): tolerate OpenCode workspace seed permission errors
Do not abort the entrypoint when the shared volume is not writable; log a warning and continue so the worker can still start. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
9572eac3eb
commit
ff3bf83afe
1 changed files with 8 additions and 5 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
|
||||||
|
|
||||||
# When a remote harness shares a workspace volume, seed it from the deploy
|
# When a remote harness shares a workspace volume, seed it from the deploy
|
||||||
# snapshot baked into the image (/app/repo).
|
# snapshot baked into the image (/app/repo).
|
||||||
|
set -u
|
||||||
|
|
||||||
session_type="${WORKER_SESSION_TYPE:-minimal}"
|
session_type="${WORKER_SESSION_TYPE:-minimal}"
|
||||||
if [ "$session_type" = "openhands" ] || [ "$session_type" = "opencode" ]; then
|
if [ "$session_type" = "openhands" ] || [ "$session_type" = "opencode" ]; then
|
||||||
if [ "$session_type" = "opencode" ]; then
|
if [ "$session_type" = "opencode" ]; then
|
||||||
|
|
@ -10,11 +10,14 @@ if [ "$session_type" = "openhands" ] || [ "$session_type" = "opencode" ]; then
|
||||||
else
|
else
|
||||||
target="${WORKER_OPENHANDS_WORKSPACE:-/workspace/repo}"
|
target="${WORKER_OPENHANDS_WORKSPACE:-/workspace/repo}"
|
||||||
fi
|
fi
|
||||||
mkdir -p "$(dirname "$target")"
|
|
||||||
if [ ! -f "$target/pnpm-workspace.yaml" ]; then
|
if [ ! -f "$target/pnpm-workspace.yaml" ]; then
|
||||||
echo "[worker-entrypoint] seeding ${session_type} workspace at ${target}"
|
echo "[worker-entrypoint] seeding ${session_type} workspace at ${target}"
|
||||||
mkdir -p "$target"
|
mkdir -p "$target" || true
|
||||||
cp -a /app/repo/. "$target/"
|
# Volume may be root-owned from an earlier helper container — best-effort seed.
|
||||||
|
if ! cp -a /app/repo/. "$target/" 2>/tmp/worker-seed.err; then
|
||||||
|
echo "[worker-entrypoint] WARN: workspace seed failed (continuing with /app/repo):"
|
||||||
|
cat /tmp/worker-seed.err 2>/dev/null || true
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue