Skip to content

refactor(qa): add canonical live channel adapters - #99707

Merged
RomneyDa merged 1 commit into
mainfrom
dallin/wave1-channel-host
Jul 6, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
dallin/wave1-channel-host

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

Closes #99699

What Problem This Solves

Telegram, Slack, WhatsApp, and Matrix live QA transports could not be selected by the shared QA Lab scenario host. Matrix also belongs to its own QA runner plugin, so QA Lab needs an owner-neutral contribution contract rather than importing plugin-private runtime code.

Why This Change Was Made

Each live channel contributes a transport adapter definition through the existing QA runner registration seam. QA Lab remains the single scenario host: it owns the QA bus, wait lifecycle, failure detection, and state-backed adapter wrapper, while channel factories own only transport setup, inbound delivery, outbound observation, readiness, cleanup, and channel configuration.

The runner contract now exposes only four adapter setup options and a three-method message recorder instead of duplicating the full CLI option object and QA bus state. Telegram Bot API types come from the Telegram plugin API, and Slack message types are derived from the existing validated response schema.

The existing qa telegram, qa slack, qa whatsapp, and qa matrix commands keep their current runners and scenario catalogs. The shared host can run migrated scenarios with qa suite --channel-driver live --channel <adapter-id> without changing current command behavior. Matrix cleanup and forced-exit behavior remain intact.

QA Channel and Crabline keep their existing stateful implementations; contributed live definitions are the only transports wrapped by the shared host. Slack streamed previews are reconciled into QA bus edit events when the native message is updated in place.

User Impact

Existing live QA commands behave as before. Maintainers can migrate shared YAML/flow scenarios to the canonical adapters incrementally, then remove legacy scenario runners only after their command contracts are represented by the shared host.

Explicit shared live-adapter runs use one worker, reject runtime-pair duplication, and default to the selected factory's declared canonical scenarios.

Evidence

  • Rebased onto bfffa950d71c91b5a8f9c2f3bbd2d3a80da7705c.
  • Focused SDK, QA host, registry, Crabline, CLI, Telegram, Slack, and boundary tests passed.
  • Extension test types passed, including the new Slack preview-to-final edit regression.
  • pnpm build passed with Plugin SDK export verification.
  • Extension package-boundary validation passed for all 117 plugins plus canaries; Telegram now uses the same generated public-API declaration boundary as Slack and WhatsApp.
  • git diff --check passed.
  • Final Codex autoreview is clean with no accepted/actionable findings.
  • Exact-content Testbox-through-Crabbox tbx_01kwqtr4x789kqdgeh9azfydfq passed for head ddc617494c240e7beeef16577e5b1df73b1cf559 (Actions run 28724355393). Current-head CI has 68 passing substantive checks with Real behavior proof still in progress. Current-head ClawSweeper is pinned to this SHA with no contributor-facing code finding.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 11:54 AM ET / 15:54 UTC.

Summary
Adds an optional QA runner adapterFactory contract, live adapter factories for Telegram, Slack, WhatsApp, and Matrix, and QA Lab suite routing/docs/tests for qa suite --channel-driver live --channel <id>.

PR surface: Source +1075, Tests +429, Docs +11, Other +45. Total +1560 across 37 files.

Reproducibility: not applicable. as a bug reproduction: this is a feature/refactor PR. Source inspection shows current main lacks the adapterFactory live adapter hosting path that the PR adds.

Review metrics: 3 noteworthy metrics.

  • Plugin SDK surface: 1 optional field added. adapterFactory is additive, but it becomes part of the plugin-facing QA runner contract if merged.
  • Live adapter contributions: 4 factories wired. Telegram, Slack, WhatsApp, and Matrix now share one hosted live adapter path, so sibling transport behavior should be reviewed together.
  • Boundary artifact generation: 1 plugin API boundary added. Telegram API declarations are added to extension package-boundary generation, which matters for plugin import enforcement.

Stored data model
Persistent data-model change detected: vector/embedding metadata: docs/plugins/manifest.md, vector/embedding metadata: extensions/qa-lab/src/suite.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99699
Summary: This PR is the candidate implementation for the open maintainer feature issue about unifying live channel QA runtime hosting; the merged Matrix evidence PR is adjacent supporting work, not a replacement.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainer should explicitly approve or revise the adapterFactory SDK contract before merge.
  • A short Telegram live adapter proof would reduce transport-level uncertainty for the visible Telegram path.

Mantis proof suggestion
A visible Telegram live adapter run would add useful transport-level proof for the new shared QA host path. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify qa suite --channel-driver live --channel telegram runs the channel-chat-baseline scenario through the shared QA host.

Risk before merge

  • [P1] The PR adds a plugin-facing optional adapterFactory surface to QaRunnerCliRegistration; even though it is additive and preserves registration-only runners, maintainers should explicitly accept the SDK contract before merge.
  • [P1] Telegram live QA behavior is visible in chat and the scoped Telegram guide prefers live Telegram proof for transport changes; a short Mantis/maintainer live run would reduce remaining review uncertainty.

Maintainer options:

  1. Approve the adapterFactory SDK seam (recommended)
    Maintainers can accept the additive plugin-facing contract and merge after confirming registration-only runners remain supported.
  2. Revise the SDK contract first
    If the contract shape is not the desired long-term plugin API, change the PR before merge and keep the shared-host behavior behind the approved seam.
  3. Pause or close this branch
    If the shared live host direction is not ready, keep the canonical issue open and close or supersede this branch later.

Next step before merge

  • [P2] Protected maintainer PR with a plugin SDK contract change needs maintainer approval and validation rather than automated repair or cleanup close.

Maintainer decision needed

  • Question: Should OpenClaw accept adapterFactory as the plugin-facing QA runner contribution contract for shared live QA scenarios?
  • Rationale: The code path looks coherent and additive, but adapterFactory becomes a public plugin SDK contract and the linked maintainer issue is explicitly marked as needing a product decision.
  • Likely owner: RomneyDa — They authored the linked feature issue and the prerequisite QA transport work, so they have the strongest feature-history context for the contract choice.
  • Options:
    • Approve adapterFactory seam (recommended): Accept the additive SDK surface, keep registration-only runners supported, and proceed with merge once normal maintainer validation is satisfied.
    • Revise contract shape: Pause this PR and replace adapterFactory with the preferred SDK shape before merging the shared live host work.
    • Pause behind the issue: Keep the linked feature issue open as the architecture tracker and do not merge this branch until the shared-host direction is re-approved.

Security
Cleared: No concrete security or supply-chain regression was found; the current diff has no lockfile/dependency-source change and the dependency graph guard cleared the current head.

Review details

Best possible solution:

Land this PR only after maintainers approve the additive QA runner adapter contract and are satisfied with the registration-only compatibility path plus current-head live QA validation.

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

Not applicable as a bug reproduction: this is a feature/refactor PR. Source inspection shows current main lacks the adapterFactory live adapter hosting path that the PR adds.

Is this the best way to solve the issue?

Yes, conditionally: using the existing QA runner registration seam and QA Lab transport registry is the narrowest owner-neutral route I found. The SDK surface still needs maintainer approval because it becomes a compatibility-sensitive plugin contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 67ec544884af.

Label changes

Label justifications:

  • P2: This is a bounded maintainer-facing QA infrastructure and plugin SDK improvement with limited production-user blast radius.
  • merge-risk: 🚨 compatibility: The PR changes the plugin-facing QA runner registration contract by adding the optional adapterFactory SDK surface.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored protected PR, so the external contributor real-behavior proof gate does not apply; PR body evidence and current CI are supplemental validation context.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes Telegram live QA adapter behavior that can be demonstrated with a short Telegram Desktop/live QA proof.
Evidence reviewed

PR surface:

Source +1075, Tests +429, Docs +11, Other +45. Total +1560 across 37 files.

View PR surface stats
Area Files Added Removed Net
Source 23 1204 129 +1075
Tests 9 447 18 +429
Docs 3 15 4 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 2 45 0 +45
Total 37 1711 151 +1560

What I checked:

  • Repository policy read: Root and scoped AGENTS guides for extensions, Telegram, plugin SDK, docs, and scripts were read; the plugin SDK compatibility and Telegram proof rules affected this review. (AGENTS.md:15, 67ec544884af)
  • Current main lacks the new SDK seam: On current main, QaRunnerCliRegistration only exposes commandName and register, so the PR is not already implemented on main. (src/plugin-sdk/qa-runner-runtime.ts:12, 67ec544884af)
  • PR adds the plugin-facing adapter contract: The PR head adds the optional adapterFactory and validates that a contributed factory matches the manifest command and has the required methods. (src/plugin-sdk/qa-runner-runtime.ts:107, 24794158dacc)
  • PR routes live adapter selection through QA Lab: runQaSuiteCommand now allows --channel-driver live with a selected channel, resolves its factory and default scenarios, forces single-worker execution, and rejects incompatible multipass/runtime-pair modes. (extensions/qa-lab/src/cli.runtime.ts:902, 24794158dacc)
  • PR keeps the owner-neutral transport registry: The registry keeps built-in QA Channel and Crabline creation local, then wraps contributed live adapter definitions with the state-backed adapter and recorder methods. (extensions/qa-lab/src/qa-transport-registry.ts:69, 24794158dacc)
  • Transport wrapper supports contributed definitions: The PR converts adapter definitions into QaTransportAdapters, preserving health checks, reset hooks, outbound sequence fallback, runtime env patches, and cleanup ownership. (extensions/qa-lab/src/qa-transport.ts:315, 24794158dacc)

Likely related people:

  • RomneyDa: Authored the linked feature issue, this PR, and merged prerequisite QA transport and Matrix evidence PRs that this branch extends. (role: feature owner and recent QA transport refactor author; confidence: high; commits: 04601ae81a6d, 1ab021fba94f, 939f9aeff587; files: src/plugin-sdk/qa-runner-runtime.ts, extensions/qa-lab/src/qa-transport-registry.ts, extensions/qa-lab/src/qa-transport.ts)
  • Vincent Koc: Current-main blame for the existing QA runner runtime and QA transport registry points to a recent repository snapshot commit over these files, though the commit title is unrelated to this feature. (role: recent area contributor; confidence: low; commits: 709be93ca898; files: src/plugin-sdk/qa-runner-runtime.ts, extensions/qa-lab/src/qa-transport-registry.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-04T18:08:55.247Z sha 46cc264 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T18:15:04.827Z sha 46cc264 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T20:14:20.608Z sha f01400056e1dbbf3e3b1be21e9c78d05d63640d0 :: needs changes before merge. :: [P2] Gate live driver selection on an adapter channel
  • reviewed 2026-07-04T20:29:44.510Z sha 8da112c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:22:31.992Z sha 44bdb8122a0b3e289f46698b3e859b9e733deba7 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:32:31.945Z sha ddc6174 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:38:49.433Z sha ddc6174 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:44:30.765Z sha ddc6174 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 3, 2026
@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch from 4adef85 to a075be3 Compare July 4, 2026 01:21
@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch from a075be3 to c5cc32e Compare July 4, 2026 01:26
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 4, 2026
@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch from c5cc32e to e38dd7b Compare July 4, 2026 03:29
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jul 4, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 4, 2026
@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch 2 times, most recently from 3249aec to 419e7d9 Compare July 4, 2026 04:07
@clawsweeper clawsweeper Bot removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 4, 2026
@clawsweeper clawsweeper Bot added 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 4, 2026
@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch from 8da112c to 4710dd2 Compare July 5, 2026 00:06
@RomneyDa
RomneyDa requested a review from a team as a code owner July 5, 2026 00:06
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram scripts Repository scripts labels Jul 5, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 24794158dacc2a592b3af97fbb5a9ce9b8b9532d

@RomneyDa
RomneyDa force-pushed the dallin/wave1-channel-host branch from 4710dd2 to 44bdb81 Compare July 5, 2026 00:16
@clawsweeper clawsweeper Bot removed mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@RomneyDa

RomneyDa commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 5, 2026
@RomneyDa

RomneyDa commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram docs Improvements or additions to documentation extensions: qa-lab maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

[Feature]: Unify live channel QA runtime hosting

1 participant