



























@@ -143,13 +143,104 @@ export OPENAI_API_KEY="sk-openclaw-upgrade-survivor"
143143export DISCORD_BOT_TOKEN="upgrade-survivor-discord-token"
144144export TELEGRAM_BOT_TOKEN="123456:upgrade-survivor-telegram-token"
145145export FEISHU_APP_SECRET="upgrade-survivor-feishu-secret"
146+export BRAVE_API_KEY="BSA_upgrade_survivor_brave_key"
146147147148gateway_pid=""
149+plugin_registry_pid=""
148150cleanup() {
151+ if [ -n "${plugin_registry_pid:-}" ]; then
152+ kill "$plugin_registry_pid" >/dev/null 2>&1 || true
153+ fi
149154 openclaw_e2e_terminate_gateways "${gateway_pid:-}"
150155}
151156trap cleanup EXIT
152157158+configure_configured_plugin_install_fixture_registry() {
159+ [ "${OPENCLAW_UPGRADE_SURVIVOR_SCENARIO:-base}" = "configured-plugin-installs" ] || return 0
160+161+ local fixture_root="$OPENCLAW_UPGRADE_SURVIVOR_ARTIFACT_ROOT/configured-plugin-installs-npm-fixture"
162+ local package_dir="$fixture_root/package"
163+ local tarball="$fixture_root/openclaw-brave-plugin-2026.5.2.tgz"
164+ local port_file="$fixture_root/npm-registry-port"
165+ local log_file="$fixture_root/npm-registry.log"
166+ mkdir -p "$package_dir"
167+ FIXTURE_PACKAGE_DIR="$package_dir" node <<'"'"'NODE'"'"'
168+const fs = require("node:fs");
169+const path = require("node:path");
170+const root = process.env.FIXTURE_PACKAGE_DIR;
171+fs.mkdirSync(root, { recursive: true });
172+fs.writeFileSync(
173+ path.join(root, "package.json"),
174+ `${JSON.stringify(
175+ {
176+ name: "@openclaw/brave-plugin",
177+ version: "2026.5.2",
178+ openclaw: { extensions: ["./index.js"] },
179+ },
180+ null,
181+ 2,
182+ )}\n`,
183+);
184+fs.writeFileSync(
185+ path.join(root, "openclaw.plugin.json"),
186+ `${JSON.stringify(
187+ {
188+ id: "brave",
189+ activation: { onStartup: false },
190+ providerAuthEnvVars: { brave: ["BRAVE_API_KEY"] },
191+ contracts: { webSearchProviders: ["brave"] },
192+ configSchema: {
193+ type: "object",
194+ additionalProperties: false,
195+ properties: {
196+ webSearch: {
197+ type: "object",
198+ additionalProperties: false,
199+ properties: {
200+ apiKey: { type: ["string", "object"] },
201+ mode: { type: "string", enum: ["web", "llm-context"] },
202+ baseUrl: { type: ["string", "object"] },
203+ },
204+ },
205+ },
206+ },
207+ },
208+ null,
209+ 2,
210+ )}\n`,
211+);
212+fs.writeFileSync(
213+ path.join(root, "index.js"),
214+ `module.exports = { id: "brave", name: "Brave Fixture", register() {} };\n`,
215+);
216+NODE
217+ tar -czf "$tarball" -C "$fixture_root" package
218+ node scripts/e2e/lib/plugins/npm-registry-server.mjs \
219+ "$port_file" \
220+ "@openclaw/brave-plugin" \
221+ "2026.5.2" \
222+ "$tarball" \
223+ >"$log_file" 2>&1 &
224+ plugin_registry_pid="$!"
225+226+ for _ in $(seq 1 100); do
227+ if [ -s "$port_file" ]; then
228+ export NPM_CONFIG_REGISTRY="http://127.0.0.1:$(cat "$port_file")"
229+ export npm_config_registry="$NPM_CONFIG_REGISTRY"
230+ return 0
231+ fi
232+ if ! kill -0 "$plugin_registry_pid" 2>/dev/null; then
233+ cat "$log_file" >&2 || true
234+ return 1
235+ fi
236+ sleep 0.1
237+ done
238+239+ cat "$log_file" >&2 || true
240+ echo "Timed out waiting for configured plugin install npm fixture registry." >&2
241+ return 1
242+}
243+153244openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing OPENCLAW_TEST_STATE_SCRIPT_B64}"
154245node scripts/e2e/lib/upgrade-survivor/assertions.mjs seed
155246@@ -178,6 +269,7 @@ if [ "$update_status" -ne 0 ]; then
178269fi
179270180271echo "Running non-interactive doctor repair..."
272+configure_configured_plugin_install_fixture_registry
181273if ! openclaw doctor --fix --non-interactive >/tmp/openclaw-upgrade-survivor-doctor.log 2>&1; then
182274 echo "openclaw doctor failed" >&2
183275 cat /tmp/openclaw-upgrade-survivor-doctor.log >&2 || true
@@ -220,7 +312,7 @@ node scripts/e2e/lib/upgrade-survivor/probe-gateway.mjs \
220312 --base-url "http://127.0.0.1:$PORT" \
221313 --path /readyz \
222314 --expect ready \
223- --allow-failing discord,telegram,whatsapp,feishu \
315+ --allow-failing discord,telegram,whatsapp,feishu,matrix \
224316 --out /tmp/openclaw-upgrade-survivor-readyz.json
225317226318echo "Checking gateway RPC status..."
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。