@@ -153,10 +153,50 @@ export NPM_CONFIG_PREFIX="/npm-global"
|
153 | 153 | export PATH="$NPM_CONFIG_PREFIX/bin:$PATH" |
154 | 154 | export OPENCLAW_NPM_TELEGRAM_REPO_ROOT="/app" |
155 | 155 | |
| 156 | +dump_hotpath_logs() { |
| 157 | + local status="$1" |
| 158 | + echo "installed npm onboarding recovery hot path failed with exit code $status" >&2 |
| 159 | + for file in \ |
| 160 | + /tmp/openclaw-npm-telegram-onboard.json \ |
| 161 | + /tmp/openclaw-npm-telegram-channel-add.log \ |
| 162 | + /tmp/openclaw-npm-telegram-doctor-fix.log \ |
| 163 | + /tmp/openclaw-npm-telegram-doctor-check.log; do |
| 164 | + if [ -f "$file" ]; then |
| 165 | + echo "--- $file ---" >&2 |
| 166 | + sed -n '1,220p' "$file" >&2 || true |
| 167 | + fi |
| 168 | + done |
| 169 | +} |
| 170 | +trap 'status=$?; dump_hotpath_logs "$status"; exit "$status"' ERR |
| 171 | + |
156 | 172 | command -v openclaw |
157 | 173 | openclaw --version |
158 | 174 | |
| 175 | +echo "Running installed npm onboarding recovery hot path..." |
| 176 | +OPENAI_API_KEY="${OPENAI_API_KEY:-sk-openclaw-npm-telegram-hotpath}" openclaw onboard --non-interactive --accept-risk \ |
| 177 | + --mode local \ |
| 178 | + --auth-choice openai-api-key \ |
| 179 | + --secret-input-mode ref \ |
| 180 | + --gateway-port 18789 \ |
| 181 | + --gateway-bind loopback \ |
| 182 | + --skip-daemon \ |
| 183 | + --skip-ui \ |
| 184 | + --skip-skills \ |
| 185 | + --skip-health \ |
| 186 | + --json >/tmp/openclaw-npm-telegram-onboard.json </dev/null |
| 187 | + |
| 188 | +openclaw channels add --channel telegram --token "123456:openclaw-npm-telegram-hotpath" >/tmp/openclaw-npm-telegram-channel-add.log 2>&1 </dev/null |
| 189 | +openclaw doctor --fix --non-interactive >/tmp/openclaw-npm-telegram-doctor-fix.log 2>&1 </dev/null |
| 190 | +openclaw doctor --non-interactive >/tmp/openclaw-npm-telegram-doctor-check.log 2>&1 </dev/null |
| 191 | +if grep -F -q "Bundled plugin runtime deps are missing." /tmp/openclaw-npm-telegram-doctor-check.log; then |
| 192 | + exit 1 |
| 193 | +fi |
| 194 | +if grep -F -q "Failed to install bundled plugin runtime deps" /tmp/openclaw-npm-telegram-doctor-fix.log; then |
| 195 | + exit 1 |
| 196 | +fi |
| 197 | + |
159 | 198 | export OPENCLAW_NPM_TELEGRAM_SUT_COMMAND="$(command -v openclaw)" |
| 199 | +trap - ERR |
160 | 200 | node --import tsx scripts/e2e/npm-telegram-live-runner.ts |
161 | 201 | EOF |
162 | 202 | |
|