Skip to content

test: consolidate embedded agent and channel suites - #117826

Merged
steipete merged 3 commits into
mainfrom
test/consolidate-agents-pilot
Aug 2, 2026
Merged

steipete merged 3 commits into
mainfrom
test/consolidate-agents-pilot

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Three high-volume test clusters repeated setup, platform mutation, mock clearing, configuration literals, callback envelopes, and file-level imports. The repetition made focused failures harder to navigate and increased maintenance cost without adding behavior coverage.

This pilot consolidates those mechanics while preserving the current effective test counts: 181 embedded-agent cases, 162 Google Meet cases, and 121 Telegram cases. The original batch estimate of 3,000–5,000 removable lines did not match current main: the 181 embedded-agent cases are behaviorally distinct and already use the shared e2e harness, so this change stops at 884 net test lines removed rather than introducing a test DSL or weakening order-sensitive proofs.

Why This Change Was Made

  • Consolidates 20 embedded-agent subscription files into eight thematic suites, with named it.each rows for chunking/fence boundaries.
  • Replaces 24 Google Meet platform try/finally blocks with one restoration helper and table-drives the three isomorphic local-Chrome setup_status failures.
  • Replaces Telegram test-boundary manual clears with vi.clearAllMocks(), while retaining 18 intentional intra-test phase clears.
  • Replaces 44 literal Telegram config setups and all 18 observed callback-query envelopes with narrow local factories.
  • Table-drives two approval terminalization cases while retaining their distinct canonical-result assertions.
  • Changes test files only; production LOC delta is zero.

Embedded-agent mapping

Old file suffix New suite / describe
calls-onblockreplyflush-before-tool-execution-start-preserve block-reply-flushing.test.ts / block reply flush boundaries
does-not-append-text-end-content-is text-end-reconciliation.test.ts / text_end snapshot reconciliation
does-not-call-onblockreplyflush-callback-is-not block-reply-flushing.test.ts / boundaries without callbacks
does-not-duplicate-text-end-repeats-full text-end-reconciliation.test.ts / text_end replay de-duplication
does-not-emit-duplicate-block-replies-text text-end-reconciliation.test.ts / assistant snapshot replay
emits-block-replies-text-end-does-not text-end-reconciliation.test.ts / text_end delivery and phase routing
emits-reasoning-as-separate-message-enabled reasoning-delivery.test.ts / reasoning block delivery
filters-final-suppresses-output-without-start-tag final-tag-streaming.test.ts / final tag enforcement
includes-canvas-action-metadata-tool-summaries compaction-and-tool-summaries.test.ts / canvas tool summaries
keeps-assistanttexts-final-answer-block-replies-are reasoning-delivery.test.ts / reasoning without block replies
keeps-indented-fenced-blocks-intact chunking-fences.test.ts / paragraph and whole-fence chunking
reopens-fenced-blocks-splitting-inside-them chunking-fences.test.ts / oversized and whole-fence chunking
splits-long-single-line-fenced-blocks-reopen chunking-fences.test.ts plus compaction-and-tool-summaries.test.ts
streams-soft-chunks-paragraph-preference chunking-fences.test.ts / paragraph and whole-fence chunking
subscribeembeddedagentsession retained unchanged with its 66 effective cases
suppresses-commentary-phase-output reasoning-delivery.test.ts / commentary classification
suppresses-message-end-block-replies-message-tool source-reply-suppression.test.ts / message-tool source-reply suppression
waits-multiple-compaction-retries-before-resolving compaction-and-tool-summaries.test.ts / retries and tool summaries
withholds-anthropic-pretool-narration reasoning-delivery.test.ts / Anthropic pre-tool narration
withholds-completions-pretool-narration reasoning-delivery.test.ts / Chat Completions pre-tool narration

No test cases were merged. The embedded-agent effective distribution is 7 chunking/fence, 24 text-end, 24 final-tag, 18 reasoning, 19 source-suppression, 7 flush, 16 compaction/tool-summary, and 66 retained monolith cases.

User Impact

None. This is a test-only refactor with no runtime, configuration, protocol, schema, documentation, or changelog changes.

Evidence

  • Before: embedded agent 20 files / 181 passed; after: 8 files / 181 passed.
  • Before: Google Meet 162 passed; after: 162 passed.
  • Telegram collected 121 cases before and after, but both local runs stopped during suite setup because this dependency-free worktree could not resolve the existing undici package. One documented hydrated-modules retry reproduced the same environment failure; hosted CI is the required executable proof.
  • node scripts/run-vitest.mjs <8 embedded-agent files> --reporter=verbose — 181/181 passed.
  • node scripts/run-vitest.mjs extensions/google-meet/index.test.ts --reporter=verbose — 162/162 passed.
  • node scripts/check-changed.mjs — provider unavailable before execution; hosted CI supplies type/lint/check proof.
  • Canonical oxfmt over all 10 surviving touched files — no diff change.
  • git diff --check origin/main...HEAD — passed.
  • Structured Codex autoreview — clean on the full refactor and both CI repairs, with no accepted/actionable findings (0.97, 0.99, and 0.98 confidence).
  • Hosted CI on final head 7aaef74ec751e9bb75d1d775a1e5e0223be88e3c — 58 passed, 38 skipped, 0 pending, 0 failed.
  • Rebase patch-id remained identical over fresh origin/main.
  • Diff: 1,977 additions, 2,861 deletions, net -884 test LOC; zero non-test files.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram agents Agent runtime and tooling plugin: google-meet size: XL labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 04:45
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 2, 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 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 1:03 AM ET / 05:03 UTC.

ClawSweeper review

What this changes

This PR consolidates duplicated embedded-agent, Google Meet, and Telegram test setup into thematic suites and local fixture helpers while retaining the covered behavioral assertions.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open. The patch is a focused test-only consolidation with no concrete correctness or security defect found in the available diff, but it still lacks the required independently observed after-fix behavior proof for an external PR; its current status: 📣 needs proof label correctly reflects that gate. The maintainer label also requires explicit maintainer handling rather than automated cleanup.

Priority: P3
Reviewed head: 7aaef74ec751e9bb75d1d775a1e5e0223be88e3c

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch appears focused and coherent, but its real behavior evidence is limited to tests and CI-oriented checks.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body provides focused Vitest, formatter, and static-check claims, but no independently observed after-fix run or artifact from the affected environment; add redacted terminal output or a linked validation artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body provides focused Vitest, formatter, and static-check claims, but no independently observed after-fix run or artifact from the affected environment; add redacted terminal output or a linked validation artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Test-only diff: The supplied PR file list contains only test files: embedded-agent test-suite moves/consolidations plus extensions/google-meet/index.test.ts and extensions/telegram/src/bot.test.ts; no runtime, dependency, workflow, schema, or configuration-production file is changed.
Current setup-reset contract: Current main already uses vi.clearAllMocks() as the Google Meet suite-wide reset, while the affected Google Meet platform cases still use local try/finally restoration. The proposed helper is therefore a localized test abstraction rather than a production behavior change.
Agent-suite policy and current surface: The scoped agent policy requires retaining behavior proof when coverage is reorganized; current main has the 20 embedded-agent subscription test files that this PR maps into thematic suites, so the refactor touches delivery-sensitive regression coverage even though it does not alter runtime code.
Findings None None.
Security None None.

How this fits together

The changed suites exercise agent-stream event handling and channel adapter behavior before those components reach real users. Test fixtures feed simulated events and configuration into agent or plugin entry points, then assert the emitted replies, setup diagnostics, and callback handling remain correct.

flowchart LR
  AgentEvents[Agent stream events] --> AgentSuites[Embedded-agent test suites]
  ChannelFixtures[Channel configs and callbacks] --> ChannelSuites[Telegram and Google Meet suites]
  AgentSuites --> Assertions[Delivery and lifecycle assertions]
  ChannelSuites --> Assertions
  Assertions --> CI[Focused tests and CI checks]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body provides focused Vitest, formatter, and static-check claims, but no independently observed after-fix run or artifact from the affected environment; add redacted terminal output or a linked validation artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The consolidation moves delivery-sensitive embedded-agent coverage between files and replaces local test cleanup patterns; focused test results are useful but do not independently prove the reorganized suites retain all effective behavior in the affected environment.
  • Resolve merge risk (P1) - Several required CI lanes were still in progress or queued in the supplied snapshot, so merge readiness should be refreshed on the exact head after the contributor supplies proof.
  • Complete next step (P2) - The remaining gate is contributor-supplied real behavior proof and exact-head CI refresh, not a discrete source defect suitable for an automated repair branch.
Agent review details

Security

None.

PR surface

Tests -884. Total -884 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 24 1977 2861 -884
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 24 1977 2861 -884

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.includes-canvas-action-metadata-tool-summaries.test.ts, vector/embedding metadata: src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.includes-canvas-action-metadata-tool-summaries.test.ts, vector/embedding metadata: src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.suppresses-commentary-phase-output.test.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Add direct post-refactor proof (recommended)
    Post a redacted terminal transcript or linked artifact showing the consolidated embedded-agent, Google Meet, and Telegram suites run after this refactor, then refresh the exact-head review.
  2. Pause the cleanup
    Leave the PR open until the affected test environment is available rather than relying only on mock-oriented focused tests and pending CI.

Technical review

Best possible solution:

Retain the narrow test-only refactor, add a redacted post-refactor validation transcript or artifact from the actual affected test environment covering the three consolidated suites, then refresh exact-head CI and maintainer review before merge.

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

Not applicable: this PR does not report a user-facing defect; it reorganizes regression suites. The claimed preservation can be checked through the affected suites, but that is validation of the refactor rather than a reproduction path.

Is this the best way to solve the issue?

Yes, conditionally: consolidating repeated test mechanics while retaining behavior-specific assertions is the maintainable direction, provided the moved delivery coverage is demonstrated in the real affected test environment rather than inferred from mocks alone.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4b26a15a1f42.

Labels

Label justifications:

  • P3: This is a maintenance-only test refactor with no claimed runtime behavior, configuration, or user-flow change.
  • merge-risk: 🚨 message-delivery: The reorganized embedded-agent cases protect reply chunking, final-answer delivery, narration suppression, and source-reply behavior, so lost or weakened coverage could permit a delivery regression despite no production diff.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides focused Vitest, formatter, and static-check claims, but no independently observed after-fix run or artifact from the affected environment; add redacted terminal output or a linked validation artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Test-only diff: The supplied PR file list contains only test files: embedded-agent test-suite moves/consolidations plus extensions/google-meet/index.test.ts and extensions/telegram/src/bot.test.ts; no runtime, dependency, workflow, schema, or configuration-production file is changed. (extensions/telegram/src/bot.test.ts:124, 7aaef74ec751)
  • Current setup-reset contract: Current main already uses vi.clearAllMocks() as the Google Meet suite-wide reset, while the affected Google Meet platform cases still use local try/finally restoration. The proposed helper is therefore a localized test abstraction rather than a production behavior change. (extensions/google-meet/index.test.ts:899, d4c6ed4bd9f5)
  • Agent-suite policy and current surface: The scoped agent policy requires retaining behavior proof when coverage is reorganized; current main has the 20 embedded-agent subscription test files that this PR maps into thematic suites, so the refactor touches delivery-sensitive regression coverage even though it does not alter runtime code. (src/agents/AGENTS.md:1, d4c6ed4bd9f5)
  • Feature-history routing: The inspected current-main Google Meet test helper region is attributed to Peter Steinberger, and recent history for the Telegram test path includes Vincent Koc's Telegram performance/migration maintenance. These are routing signals, not fault attribution. (extensions/google-meet/index.test.ts:625, eda7cab0819a)
  • Proof remains mock-only: The PR body reports focused Vitest runs, formatting, and static checks, but those are unit/mock and CI-oriented checks. It does not include an independently observed after-fix validation transcript or artifact from the affected environment; the supplied context also records the existing dated status: 📣 needs proof label. (7aaef74ec751)

Likely related people:

  • steipete: Current-main blame attributes the inspected Google Meet test helper and surrounding setup-test infrastructure to Peter Steinberger; he also authored the current consolidation branch. (role: recent area contributor; confidence: high; commits: eda7cab0819a, ec2768a180ad, 1e21c6e44f9d; files: extensions/google-meet/index.test.ts, src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.does-not-append-text-end-content-is.test.ts)
  • Vincent Koc: Recent current-main history on the affected Telegram bot test path includes Telegram maintenance work, making this a useful secondary routing contact for fixture-reset semantics. (role: recent adjacent contributor; confidence: medium; commits: 53279655411d; files: extensions/telegram/src/bot.test.ts)

Rank-up moves

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

  • Add a redacted after-fix validation transcript or artifact for the consolidated suites, including the Telegram environment that previously failed to resolve undici.
  • Refresh required CI and review against the exact current head after the proof is added.

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 (1 earlier review cycle)
  • reviewed 2026-08-02T04:50:21.375Z sha 263b73d32e87dd76338d38296f009449114b8334 :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the test/consolidate-agents-pilot branch from 263b73d to 8ec2dc6 Compare August 2, 2026 04:55
@steipete
steipete force-pushed the test/consolidate-agents-pilot branch from 8ec2dc6 to 7aaef74 Compare August 2, 2026 04:59
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Aug 2, 2026
@steipete
steipete merged commit 59a6abd into main Aug 2, 2026
107 checks passed
@steipete
steipete deleted the test/consolidate-agents-pilot branch August 2, 2026 05:14
@steipete

steipete commented Aug 2, 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 2, 2026
* test: consolidate embedded agent and channel suites

* test: type reply reconciliation table rows

* test: preserve raw telegram config fixture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: google-meet rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant