2020 - ' cloud/packages/lib/services/docker-sandbox-provider.ts'
2121 - ' cloud/packages/lib/services/eliza-sandbox.ts'
2222 - ' cloud/packages/db/repositories/agent-sandboxes.ts'
23+ - ' packages/core/**'
24+ - ' plugins/plugin-sql/**'
2325 workflow_dispatch :
2426
2527concurrency :
7072 host : ${{ env.DEPLOY_HOST }}
7173 username : deploy
7274 key : ${{ env.DEPLOY_SSH_KEY }}
73- script_stop : true
7475 command_timeout : 10m
7576 envs : DEPLOY_BRANCH,SYSTEMD_UNIT
7677 script : |
@@ -120,6 +121,15 @@ jobs:
120121 done
121122 cd /opt/eliza
122123
124+ # The daemons run under Node/tsx rather than Bun. Node resolves
125+ # linked workspace packages through their built `node` exports, so
126+ # refresh linked package dist files after installing dependencies.
127+ bun run --cwd cloud build:linked-core
128+ mkdir -p plugins/plugin-sql/node_modules/@elizaos
129+ rm -rf plugins/plugin-sql/node_modules/@elizaos/core
130+ ln -s ../../../../packages/core plugins/plugin-sql/node_modules/@elizaos/core
131+ bun run --cwd plugins/plugin-sql build
132+
123133 # Install/refresh both systemd units (provisioning worker + agent router).
124134 sudo install -m 0644 \
125135 cloud/packages/scripts/eliza-provisioning-worker.service \
@@ -141,7 +151,6 @@ jobs:
141151 host : ${{ env.DEPLOY_HOST }}
142152 username : deploy
143153 key : ${{ env.DEPLOY_SSH_KEY }}
144- script_stop : true
145154 command_timeout : 5m
146155 envs : SYSTEMD_UNIT
147156 script : |
@@ -150,12 +159,13 @@ jobs:
150159 # Info-level logs are filtered unless VERBOSE_LOGGING=true, so we
151160 # rely on systemd's own signals: process is active AND no fatal
152161 # error / restart-loop in the journal since deploy.
153- SINCE_TS ="$(date -u -d '30 seconds ago' '+%Y-%m-%d %H:%M:%S')"
162+ HEALTH_SINCE_TS ="$(date -u '+%Y-%m-%d %H:%M:%S')"
154163 STABLE_THRESHOLD_SEC=20
164+ FATAL_LOG_PATTERN="\[(provisioning-worker|agent-router)\] (fatal|unhandled rejection)|node:internal/.*Error:|Error \[ERR_|^[A-Za-z]+Error:"
155165 for attempt in $(seq 1 18); do
156166 if sudo systemctl is-active --quiet "$SYSTEMD_UNIT"; then
157- JOURNAL=$(sudo journalctl -u "$SYSTEMD_UNIT" --since "$SINCE_TS " --no-pager 2>/dev/null || true)
158- if echo "$JOURNAL" | grep -qE "\[provisioning-worker\] (fatal|unhandled rejection)|node:internal/.*Error:|^[A-Za-z]+Error: "; then
167+ JOURNAL=$(sudo journalctl -u "$SYSTEMD_UNIT" --since "$HEALTH_SINCE_TS " --no-pager 2>/dev/null || true)
168+ if echo "$JOURNAL" | grep -qE "$FATAL_LOG_PATTERN "; then
159169 echo "::error::Worker logged a fatal error since deploy."
160170 echo "$JOURNAL" | tail -n 50
161171 exit 1
@@ -168,20 +178,32 @@ jobs:
168178 AGE=$(( NOW_SEC - UPTIME_SEC ))
169179 if [ "$AGE" -ge "$STABLE_THRESHOLD_SEC" ]; then
170180 if ! sudo systemctl is-active --quiet eliza-agent-router.service; then
171- echo "::error::eliza-agent-router.service is not active."
172- sudo systemctl status eliza-agent-router.service --no-pager || true
173- sudo journalctl -u eliza-agent-router.service -n 50 --no-pager || true
181+ echo "Health check attempt $attempt/18: worker stable (${AGE}s), router not active yet."
182+ sleep 5
183+ continue
184+ fi
185+ ROUTER_JOURNAL=$(sudo journalctl -u eliza-agent-router.service --since "$HEALTH_SINCE_TS" --no-pager 2>/dev/null || true)
186+ if echo "$ROUTER_JOURNAL" | grep -qE "$FATAL_LOG_PATTERN"; then
187+ echo "::error::Agent router logged a fatal error since activation."
188+ echo "$ROUTER_JOURNAL" | tail -n 50
174189 exit 1
175190 fi
191+ ROUTER_UPTIME_SEC=$(systemctl show eliza-agent-router.service --property=ActiveEnterTimestampMonotonic --value | awk '{ print int($1 / 1e6) }')
192+ ROUTER_AGE=$(( NOW_SEC - ROUTER_UPTIME_SEC ))
193+ if [ "$ROUTER_AGE" -lt "$STABLE_THRESHOLD_SEC" ]; then
194+ echo "Health check attempt $attempt/18: worker stable (${AGE}s), router only ${ROUTER_AGE}s old."
195+ sleep 5
196+ continue
197+ fi
176198 ROUTER_PORT=$(systemctl show eliza-agent-router.service --property=Environment --value | tr ' ' '\n' | awk -F= '$1=="AGENT_ROUTER_PORT" {print $2}')
177199 : "${ROUTER_PORT:=3458}"
178- if ! curl -sf -m 3 "http://127.0.0.1:${ROUTER_PORT}/healthz" >/dev/null 2>&1; then
179- echo "::error::eliza-agent-router /healthz did not respond on port ${ROUTER_PORT}."
180- sudo journalctl -u eliza-agent-router.service -n 50 --no-pager || true
181- exit 1
200+ if curl -sf -m 3 "http://127.0.0.1:${ROUTER_PORT}/healthz" >/dev/null 2>&1; then
201+ echo "Both daemons active and stable (worker ${AGE}s, router ${ROUTER_AGE}s, router /healthz OK) on attempt $attempt."
202+ exit 0
182203 fi
183- echo "Both daemons active and stable (worker ${AGE}s, router /healthz OK) on attempt $attempt."
184- exit 0
204+ echo "Health check attempt $attempt/18: worker stable (${AGE}s), router ${ROUTER_AGE}s but /healthz not ready on port ${ROUTER_PORT}."
205+ sleep 5
206+ continue
185207 fi
186208 echo "Health check attempt $attempt/18: active but only ${AGE}s old, waiting for stability..."
187209 else
@@ -193,6 +215,8 @@ jobs:
193215 echo "::error::$SYSTEMD_UNIT failed to become healthy within 90s."
194216 sudo systemctl status "$SYSTEMD_UNIT" --no-pager || true
195217 sudo journalctl -u "$SYSTEMD_UNIT" -n 200 --no-pager || true
218+ sudo systemctl status eliza-agent-router.service --no-pager || true
219+ sudo journalctl -u eliza-agent-router.service -n 200 --no-pager || true
196220 exit 1
197221
198222 - name : Notify Discord (Success)
@@ -219,4 +243,4 @@ jobs:
219243 description : |
220244 Branch: develop
221245 Commit: ${{ github.sha }}
222- color : 0xff0000
246+ color : 0xff0000
0 commit comments