Skip to content

test(channels): consolidate remaining channel scaffolding - #118493

Merged
steipete merged 2 commits into
mainfrom
test/channel-scaffolding-round2
Aug 3, 2026
Merged

steipete merged 2 commits into
mainfrom
test/channel-scaffolding-round2

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The remaining Telegram, Google Meet, and WhatsApp channel tests repeated large callback, media, setup, transcript, realtime, successor-controller, and retry fixtures. That duplication obscured the assertions that actually distinguish each behavior and made fixture changes expensive.

Why This Change Was Made

This follows the test-only consolidation shape from #117826, #117854, and #117910: narrow local factories own byte-equivalent setup, mechanically isomorphic cases use named tables, and async lifecycle cases remain explicit when their ordering or ownership differs.

Previous repeated shape Consolidated shape Divergence deliberately preserved
Telegram plugin callback registration, open-DM bot setup, and callback envelopes createTelegramPluginCallbackHandler plus the existing callback-context factory Edit, delete, topic reply, submitted-text, authorization, retry, and policy outcomes retain their own named cases and assertions
Telegram replied-photo messages and reaction dispatch createReplyPhotoMessage and dispatchTelegramReaction Timeout, classic polling abort, spooled abort, multi-emoji delta, forum routing, and ordinary-group routing remain distinct
Google Meet Twilio environment/plugin/config setup runTwilioSetupStatus Environment vs configured credentials, missing allowlist/entry, dial plan, request dial-in, and webhook URL checks remain distinct
Google Meet local Chrome setup/join/session lifecycle withLocalChromeMeetSession Owned/reused/closed/moved tabs, transcript epoch/finalization/concurrency/eviction, and repeated leave assertions remain distinct
Google Meet realtime callback capture Provider factories retain and require their created request Local child-process bridge, direct realtime engine, and node transport scaffolding remain explicit
WhatsApp successor controller A/B setup primeCapturedReplyWithSuccessor Matching identity, PN/LID rotation, and mismatched fail-closed outcomes remain distinct
WhatsApp quoted wrappers and GroupSystemPrompt variants Named it.each rows All generated case names and per-row expectations are preserved
WhatsApp auth-stabilization retry setup Two named table rows Recovery/abort and retry-exhaustion lifecycle assertions remain branch-specific

The batch estimate of 650–1,000 removable test lines was optimistic on current main: several cited reaction/platform cases were already table-driven by the precedent PRs, and the remaining async cases protect meaningfully different ownership and ordering. This stops at 404 net lines removed rather than hiding those differences behind a test DSL.

User Impact

None. This is test-only scaffolding cleanup: no production, configuration, protocol, SDK, schema, documentation, or changelog files changed.

Evidence

  • Static preservation against immutable pre-edit base 128361397aa745e8b24176fada82553cc3b12239: Telegram 94/94 test declarations and 463/463 assertions; Google Meet 146/146 declarations and 762/762 assertions; WhatsApp table conversions preserve 3 successor, 3 quoted-wrapper, 3 GroupSystemPrompt, and 2 auth-stabilization cases with their original titles.
  • Canonical oxfmt over all 6 touched files — passed.
  • Canonical oxlint --config .oxlintrc.json over all 6 touched files — passed.
  • git diff --check — passed before and after rebases.
  • Codex autoreview (gpt-5.6-sol, high) — clean on the full bundle and the CI typing repair, no accepted/actionable findings, both at 0.99 confidence; TruffleHog bundle scans clean.
  • First-head CI found two test-helper typing errors: a nested type derived from a generic Record<string, unknown> and a channel-specific callback passed through an erased process-global registry. Both were repaired at their test-helper boundaries; no behavior or assertions changed.
  • Final exact-head CI: run 30786728791 on 6fd9ff981c059430b7db57ef2b78682412c072f4 passed with no failed or pending checks.
  • Focused verbose Vitest baseline/final attempts were blocked before Vitest spawn by this fleet host's I/O/runner environment. Blacksmith was not installed, managed AWS lacked broker authentication, and node scripts/check-changed.mjs reported no ready provider. Hosted exact-head CI supplies the executable test/type/check proof.
  • LOC: production +0/-0; tests +698/-1,102, net -404.

@steipete
steipete marked this pull request as ready for review August 3, 2026 05:10
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web plugin: google-meet size: XL maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 1:31 AM ET / 05:31 UTC.

ClawSweeper review

What this changes

The branch replaces repeated Telegram, Google Meet, and WhatsApp test setup with narrow local helpers and named parameterized cases while retaining distinct lifecycle and channel assertions.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR remains useful: it is a clean, test-only consolidation across channel suites, with no current-main overlap on its six touched files and no concrete correctness finding in the refactor. The exact-head CI and Real behavior proof checks reported in the supplied PR context are successful; the maintainer label keeps the final merge decision with a human reviewer. Likely related people: steipete, based on the current commits and the immediately preceding merged channel-test consolidation work.

Priority: P3
Reviewed head: 6fd9ff981c059430b7db57ef2b78682412c072f4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) This is a focused, runtime-neutral test refactor with preserved scenario assertions and successful exact-head CI evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.
Evidence reviewed 7 items Test-only scope and production delta: The branch changes six *.test.ts files only: production +0/-0 and tests +698/-1,102 (net -404).
Google Meet helper preserves request observation: The voice and transcription test providers now retain the request passed by the runtime and expose requireRequest, so tests still fail if the corresponding bridge or session is never created rather than silently dropping the callback observation.
Telegram helper retains channel-specific assertions: The new callback, replied-photo, and reaction setup helpers are local to the Telegram test suite; the individual tests retain their authorization, topic-routing, retry, and emitted-event assertions.
Findings None None.
Security None None.

How this fits together

Telegram, Google Meet, and WhatsApp extensions receive external events and route them into OpenClaw’s channel and agent flows. Their tests construct callback, media, setup, connection, and reply-lifecycle scenarios; this PR reduces repeated scenario scaffolding without changing the runtime code those tests exercise.

flowchart LR
  A[External channel events] --> B[Channel extensions]
  B --> C[Channel behavior tests]
  C --> D[Local fixtures and helpers]
  D --> E[Lifecycle and routing assertions]
  E --> F[Regression confidence]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; although current main has no changes on the six touched paths and the supplied GitHub state is mergeable, a maintainer may require a rebase or exact-head check refresh before landing.
  • Complete next step (P2) - No actionable patch defect remains for a repair worker; the protected maintainer label reserves the final branch-freshness and merge decision for a human reviewer.
Agent review details

Security

None.

PR surface

Tests -404. Total -404 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 698 1102 -404
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 698 1102 -404

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +698/-1,102 (net -404) The refactor removes repeated test scaffolding without adding a runtime, configuration, protocol, SDK, or persistence surface.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the refactor test-only, preserve the focused suite coverage and distinct lifecycle assertions, then land after the normal maintainer-owned branch freshness gate is satisfied.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the refactor test-only, preserve the focused suite coverage and distinct lifecycle assertions, then land after the normal maintainer-owned branch freshness gate is satisfied.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors test scaffolding rather than reporting a user-facing defect. The relevant verification is whether the changed channel suites preserve their scenarios and execute on the proposed head.

Is this the best way to solve the issue?

Yes. Local factories and named tables remove mechanically repeated setup while the remaining assertions continue to distinguish channel routing, lifecycle, and fail-closed behavior; no broader test DSL or production change is warranted.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 122181649e73.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a test-only cleanup with no intended user-visible behavior change or production-code delta.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.
  • proof: sufficient: Contributor real behavior proof is sufficient. For this test-only refactor, the supplied exact-head hosted CI evidence and successful Real behavior proof checks show the refactored suites executing after the change; no user-facing channel recording is relevant.

Evidence

What I checked:

  • Test-only scope and production delta: The branch changes six *.test.ts files only: production +0/-0 and tests +698/-1,102 (net -404). (extensions/google-meet/index.test.ts:110, 6fd9ff981c05)
  • Google Meet helper preserves request observation: The voice and transcription test providers now retain the request passed by the runtime and expose requireRequest, so tests still fail if the corresponding bridge or session is never created rather than silently dropping the callback observation. (extensions/google-meet/index.test.ts:110, 6fd9ff981c05)
  • Telegram helper retains channel-specific assertions: The new callback, replied-photo, and reaction setup helpers are local to the Telegram test suite; the individual tests retain their authorization, topic-routing, retry, and emitted-event assertions. (extensions/telegram/src/bot.test.ts:223, 6fd9ff981c05)
  • WhatsApp parameterization retains divergent outcomes: The converted tables keep the recovery-versus-exhaustion assertions and the group/direct/absent prompt expectations explicit; successor-controller tests still separately prove matching, LID-equivalent, and fail-closed mismatched identity behavior. (extensions/whatsapp/src/auto-reply.web-auto-reply.connection-and-logging.e2e.test.ts:574, 6fd9ff981c05)
  • Current-main merge relevance: No commits between the PR base and current main modify any of the six touched test files, and a non-writing three-way merge preview produced merged file results without conflict markers. The supplied GitHub context also reports the PR as mergeable, though behind. (extensions/google-meet/index.test.ts:110, 6fd9ff981c05)
  • Patch hygiene and exact-head proof: git diff --check is clean. The supplied PR context records successful exact-head hosted CI for 6fd9ff981c059430b7db57ef2b78682412c072f4, including successful Real behavior proof checks and no failed or pending checks in the cited run. (extensions/whatsapp/src/monitor-inbox.socket-lifecycle.test.ts:36, 6fd9ff981c05)

Likely related people:

  • steipete: The current branch’s two commits are authored by Peter Steinberger, and the supplied related-item history identifies steipete as the author of the immediately preceding merged channel-test consolidation PRs spanning the same Telegram, Google Meet, and WhatsApp test areas. (role: recent channel-test consolidation contributor; confidence: high; commits: 6fd9ff981c05, 7cb147be6ab6, 59a6abd06513; files: extensions/google-meet/index.test.ts, extensions/telegram/src/bot.test.ts, extensions/whatsapp/src/monitor-inbox.socket-lifecycle.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch and its exact-head checks only if the repository’s merge policy requires an up-to-date head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-03T05:15:21.206Z sha f4e856d4d301f8baf2f05e36b04cc1e78d84fa32 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T05:22:47.708Z sha 6fd9ff9 :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the test/channel-scaffolding-round2 branch from f4e856d to 6fd9ff9 Compare August 3, 2026 05:16
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 3, 2026
@steipete
steipete merged commit 8e35fb4 into main Aug 3, 2026
132 of 138 checks passed
@steipete
steipete deleted the test/channel-scaffolding-round2 branch August 3, 2026 06:03
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…18493)

* test(channels): consolidate channel scaffolding

* test(channels): fix helper typings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: google-meet proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant