




























@@ -89,6 +89,7 @@ jobs:
8989REPORT_DIR: ${{ github.workspace }}/.artifacts/kova/reports/${{ matrix.lane }}
9090BUNDLE_DIR: ${{ github.workspace }}/.artifacts/kova/bundles/${{ matrix.lane }}
9191SUMMARY_DIR: ${{ github.workspace }}/.artifacts/kova/summaries
92+SOURCE_PERF_DIR: ${{ github.workspace }}/.artifacts/openclaw-performance/source/${{ matrix.lane }}
9293LANE_ID: ${{ matrix.lane }}
9394PROFILE: ${{ inputs.profile || 'diagnostic' }}
9495REQUESTED_REPEAT: ${{ inputs.repeat || '3' }}
@@ -297,6 +298,105 @@ jobs:
297298 exit "$status"
298299 fi
299300301+ - name: Run OpenClaw source performance probes
302+if: ${{ steps.lane.outputs.run == 'true' && matrix.lane == 'mock-provider' }}
303+shell: bash
304+run: |
305+ set -euo pipefail
306+ source_runs="$REQUESTED_REPEAT"
307+ if ! [[ "$source_runs" =~ ^[0-9]+$ ]] || [[ "$source_runs" -lt 1 ]]; then
308+ source_runs=3
309+ fi
310+311+ mkdir -p "$SOURCE_PERF_DIR/mock-hello"
312+ pnpm build
313+314+ pnpm test:gateway:cpu-scenarios \
315+ --output-dir "$SOURCE_PERF_DIR/gateway-cpu" \
316+ --runs "$source_runs" \
317+ --warmup 1 \
318+ --skip-qa \
319+ --startup-case default \
320+ --startup-case skipChannels \
321+ --startup-case oneInternalHook \
322+ --startup-case allInternalHooks \
323+ --startup-case fiftyPlugins \
324+ --startup-case fiftyStartupLazyPlugins
325+326+ for run_index in $(seq 1 "$source_runs"); do
327+ run_dir="$SOURCE_PERF_DIR/mock-hello/run-$(printf '%03d' "$run_index")"
328+ pnpm openclaw qa suite \
329+ --provider-mode mock-openai \
330+ --concurrency 1 \
331+ --output-dir "$(realpath --relative-to="$GITHUB_WORKSPACE" "$run_dir")" \
332+ --scenario channel-chat-baseline
333+ done
334+335+ gateway_home="$(mktemp -d)"
336+ gateway_port="$(node -e "const net=require('node:net'); const s=net.createServer(); s.listen(0,'127.0.0.1',()=>{ console.log(s.address().port); s.close(); });")"
337+ gateway_state="$gateway_home/.openclaw"
338+ gateway_config="$gateway_state/openclaw.json"
339+ gateway_log="$SOURCE_PERF_DIR/cli-gateway.log"
340+ gateway_pid=""
341+ mkdir -p "$gateway_state"
342+ cat > "$gateway_config" <<EOF
343+ {
344+ "browser": { "enabled": false },
345+ "gateway": {
346+ "mode": "local",
347+ "port": ${gateway_port},
348+ "bind": "loopback",
349+ "auth": { "mode": "none" },
350+ "controlUi": { "enabled": false },
351+ "tailscale": { "mode": "off" }
352+ },
353+ "plugins": {
354+ "enabled": true,
355+ "entries": { "browser": { "enabled": false } }
356+ }
357+ }
358+ EOF
359+ cleanup_gateway() {
360+ if [[ -n "${gateway_pid:-}" ]] && kill -0 "$gateway_pid" 2>/dev/null; then
361+ kill "$gateway_pid" 2>/dev/null || true
362+ wait "$gateway_pid" 2>/dev/null || true
363+ fi
364+ rm -rf "$gateway_home"
365+ }
366+ trap cleanup_gateway EXIT
367+ OPENCLAW_HOME="$gateway_home" OPENCLAW_STATE_DIR="$gateway_state" OPENCLAW_CONFIG_PATH="$gateway_config" OPENCLAW_GATEWAY_PORT="$gateway_port" OPENCLAW_SKIP_CHANNELS=1 \
368+ node dist/entry.js gateway run --bind loopback --port "$gateway_port" --auth none --allow-unconfigured --force \
369+ >"$gateway_log" 2>&1 &
370+ gateway_pid="$!"
371+372+ for _ in $(seq 1 120); do
373+ if curl -fsS "http://127.0.0.1:${gateway_port}/healthz" >/dev/null; then
374+ break
375+ fi
376+ if ! kill -0 "$gateway_pid" 2>/dev/null; then
377+ cat "$gateway_log" >&2
378+ exit 1
379+ fi
380+ sleep 1
381+ done
382+ curl -fsS "http://127.0.0.1:${gateway_port}/healthz" >/dev/null
383+384+ OPENCLAW_HOME="$gateway_home" OPENCLAW_STATE_DIR="$gateway_state" OPENCLAW_CONFIG_PATH="$gateway_config" OPENCLAW_GATEWAY_PORT="$gateway_port" \
385+ node --import tsx scripts/bench-cli-startup.ts \
386+ --case gatewayHealthJson \
387+ --case configGetGatewayPort \
388+ --runs "$source_runs" \
389+ --warmup 1 \
390+ --output "$SOURCE_PERF_DIR/cli-startup.json"
391+ cleanup_gateway
392+ trap - EXIT
393+394+ pnpm perf:source:summary \
395+ --source-dir "$SOURCE_PERF_DIR" \
396+ --output "$SOURCE_PERF_DIR/index.md"
397+398+ cat "$SOURCE_PERF_DIR/index.md" >> "$GITHUB_STEP_SUMMARY"
399+300400 - name: Upload Kova artifacts
301401if: ${{ always() && steps.lane.outputs.run == 'true' }}
302402uses: actions/upload-artifact@v5
@@ -306,6 +406,7 @@ jobs:
306406 .artifacts/kova/reports/${{ matrix.lane }}
307407 .artifacts/kova/bundles/${{ matrix.lane }}
308408 .artifacts/kova/summaries/${{ matrix.lane }}.md
409+ .artifacts/openclaw-performance/source/${{ matrix.lane }}
309410 if-no-files-found: ignore
310411retention-days: ${{ matrix.deep_profile == 'true' && 14 || 30 }}
311412@@ -348,6 +449,18 @@ jobs:
348449 mkdir -p "$dest/bundles"
349450 cp -R "$BUNDLE_DIR"/. "$dest/bundles/"
350451 fi
452+ if [[ -d "$SOURCE_PERF_DIR" ]]; then
453+ mkdir -p "$dest/source"
454+ cp -R "$SOURCE_PERF_DIR"/. "$dest/source/"
455+ if [[ -f "$SOURCE_PERF_DIR/index.md" ]]; then
456+ cat >> "$dest/index.md" <<'EOF'
457+458+ ## Source probes
459+460+ Additional gateway boot, memory, plugin pressure, mock hello-loop, and CLI startup numbers are in [source/index.md](source/index.md).
461+ EOF
462+ fi
463+ fi
351464 cat > "${reports_root}/openclaw-performance/${ref_slug}/latest-${LANE_ID}.json" <<EOF
352465 {
353466 "repository": "${GITHUB_REPOSITORY}",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。