From 6a823a4f2378a9c4699c978513666918d9d70556 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 3 May 2026 02:31:13 -0700 Subject: [PATCH] test(onboarding): assert channel status surfaces --- CHANGELOG.md | 1 + .../npm-onboard-channel-agent/assertions.mjs | 23 +++++++++++++++++++ .../e2e/npm-onboard-channel-agent-docker.sh | 9 ++++++++ 3 files changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c720dd3edb..02e50d308fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Docs: https://docs.openclaw.ai - Plugins/onboarding: trust optional official plugin and web-search installs selected from the official catalog so npm security scanning treats them like other source-linked official install paths. Thanks @vincentkoc. - Tests/plugins: expose the Discord npm onboarding Docker lane as a package script and assert planned Docker lanes point at real scripts, so external-channel onboarding coverage can actually run. Thanks @vincentkoc. - Plugins/ClawHub: explain unreleased ClawHub plugin artifacts as a rollout-state fallback to `npm:` installs instead of leaking raw archive metadata fields. Thanks @vincentkoc. +- Tests/onboarding: assert packaged channel onboarding leaves `openclaw channels status --json` and plain `openclaw status` showing the configured channel, covering the empty Channels table regression path. Thanks @vincentkoc. - Microsoft Teams: persist sent-message markers across Gateway restarts so follow-up replies to recent bot messages keep resolving the original conversation instead of dropping out after restart, with marker TTLs preserved on best-effort recovery. (#75585) Thanks @amknight. - Matrix: persist pending approval reaction targets across Gateway restarts so room approvers can still approve or deny outstanding prompts after OpenClaw comes back online. (#75586) Thanks @amknight. - Channels/onboarding: map third-party official WeCom and Yuanbao catalog entries to their published plugin ids so npm installs pass expected-plugin validation. Thanks @vincentkoc. diff --git a/scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs b/scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs index 1e0211772de..26c35392a48 100644 --- a/scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs +++ b/scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs @@ -95,6 +95,28 @@ function assertChannelConfig() { } } +function assertStatusSurfaces() { + const channel = process.argv[3]; + const channelsStatusPath = process.argv[4]; + const statusTextPath = process.argv[5]; + const channelsStatus = readJson(channelsStatusPath); + const configuredChannels = Array.isArray(channelsStatus.configuredChannels) + ? channelsStatus.configuredChannels + : []; + if (!configuredChannels.includes(channel)) { + throw new Error( + `channels status did not list configured channel ${channel}. Payload: ${JSON.stringify(channelsStatus)}`, + ); + } + const statusText = fs.readFileSync(statusTextPath, "utf8"); + if (!/channels/i.test(statusText)) { + throw new Error(`plain status output did not render a Channels section. Output: ${statusText}`); + } + if (!statusText.toLowerCase().includes(channel.toLowerCase())) { + throw new Error(`plain status output did not mention ${channel}. Output: ${statusText}`); + } +} + function assertAgentTurn() { const marker = process.argv[3]; const logPath = process.argv[4]; @@ -112,6 +134,7 @@ const commands = { "assert-onboard-state": assertOnboardState, "configure-mock-model": configureMockModel, "assert-channel-config": assertChannelConfig, + "assert-status-surfaces": assertStatusSurfaces, "assert-agent-turn": assertAgentTurn, }; diff --git a/scripts/e2e/npm-onboard-channel-agent-docker.sh b/scripts/e2e/npm-onboard-channel-agent-docker.sh index a0e1b3cce5e..16e827d76fc 100644 --- a/scripts/e2e/npm-onboard-channel-agent-docker.sh +++ b/scripts/e2e/npm-onboard-channel-agent-docker.sh @@ -92,6 +92,10 @@ dump_debug_logs() { /tmp/openclaw-install.log \ /tmp/openclaw-onboard.json \ /tmp/openclaw-channel-add.log \ + /tmp/openclaw-channels-status.json \ + /tmp/openclaw-channels-status.err \ + /tmp/openclaw-status.txt \ + /tmp/openclaw-status.err \ /tmp/openclaw-doctor.log \ /tmp/openclaw-agent.combined \ /tmp/openclaw-agent.err \ @@ -137,6 +141,11 @@ echo "Configuring $CHANNEL..." openclaw channels add --channel "$CHANNEL" --token "$CHANNEL_TOKEN" >/tmp/openclaw-channel-add.log 2>&1 node scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs assert-channel-config "$CHANNEL" "$CHANNEL_TOKEN" +echo "Checking status surfaces for $CHANNEL..." +openclaw channels status --json >/tmp/openclaw-channels-status.json 2>/tmp/openclaw-channels-status.err +openclaw status >/tmp/openclaw-status.txt 2>/tmp/openclaw-status.err +node scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs assert-status-surfaces "$CHANNEL" /tmp/openclaw-channels-status.json /tmp/openclaw-status.txt + echo "Running doctor after channel activation..." openclaw doctor --repair --non-interactive >/tmp/openclaw-doctor.log 2>&1 if [ "$CHANNEL_PACKAGE_MODE" = "external" ]; then