Skip to content

refactor: deslop Discord, QA Lab and plugin fixtures - #182302

Merged
steipete merged 2 commits into
mainfrom
deslop/s05-1-plugin-owners-20261015
Oct 24, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/s05-1-plugin-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Remove duplicated ownership and fixture plumbing from bundled plugins without removing their supported features.

User Impact

No user-visible feature, configuration, protocol, or persisted-data change. One deliberate best-effort compromise: unrelated proxy-environment edits made during a scoped CDP call can be overwritten when the final call restores its entry snapshot, as detailed below.

Why This Change Was Made

Stack independent plugin cleanups: remove unread private metadata and unused inputs, put deployment diagnostics at the request owner, and reuse existing test fixture owners. Public configuration, SDK contracts, channel behavior, ordinary concurrency, and persistence remain intact. No changelog edit: release-note context is this PR's description.

Feishu private errors and supported Axios headers

Remove copied, unread httpStatus/feishuMsg error fields while retaining messages, retry codes, log IDs, and telemetry. Set User-Agent through Axios's normalized interceptor request instead of supporting absent/plain/optional-set header variants. Keep the multipart workaround for #95291 and all request authority/redirect checks.

Best-effort tradeoffs accepted: none. The removed fields had no reader; the pinned dependency supplies interceptor headers. No alternate supported transport is removed.

Matrix SDK surfaces

Remove the unread crypto-facade isRoomEncrypted callback/property; the wire-event owner still decides encryption. Call required installed SDK decryption methods directly instead of probing for their existence. Keep direct event decryption, the client fallback, late-key recovery, bounded retries, and drain behavior from #94416 / human report #93501.

Best-effort tradeoffs accepted: none for supported SDK objects. Incomplete private test doubles must supply the required methods; old or foreign SDK implementations are not bundled-plugin compatibility contracts.

Teams pending uploads

Keep each pending upload and its expiry timer in one map entry instead of two parallel maps. TTL, explicit removal, activity updates, singleton reset, and returned upload values stay the same.

Best-effort tradeoffs accepted: replacing this module's singleton representation in a running process requires an ordinary restart. Persisted state and normal reload/restart behavior are unchanged; there is no hot-code-replacement contract.

Browser proxy restoration

Keep loopback-only bypass, shared overlapping-call accounting, and final restoration. Remove applied-value snapshots and compare-before-restore custody for arbitrary third-party environment edits during a CDP call. Remove only the two synthetic mutation tests for that retired mechanism; overlap, reverse-exit, and normal restoration proof remain.

Best-effort tradeoffs accepted: after this helper adds loopback entries, the final call restores the initial NO_PROXY/no_proxy values even if unrelated code edited them meanwhile. #83382 (ce625162519c6, later refined by 61d9a6d750455 and refactored in #167734) describes synthetic env regressions, not a human-reported need for mid-call custody. Actual proxy-bypass behavior reported in #31219 stays protected.

Discord diagnostics

Deployment requests attach method, path, body, and timing at DiscordCommandDeployer, eliminating shared REST monkey-patching, route probing, restoration, and attachment helpers. Keep warning formatting, original error identity, reconciliation, scheduling, and cache behavior. Real provider-entrypoint tests cover all five HTTP verbs and unrelated concurrent voice traffic, preserving the boundary from #104174 / human report #104163.

Remove the unread private presence-cache-size diagnostic and copied send-error metadata. Keep per-account presence operations, the resource cap, error status/text, native Discord errors, and permission probing.

runtime-api.ts is an internal barrel, as documented in docs/plugins/sdk-channel-plugins.md; the public api.ts exports neither removed surface. No public SDK subpath or deprecated compatibility contract is removed.

Best-effort tradeoffs accepted: none. Diagnostic ownership moves to the operation that knows its request; unrelated traffic is no longer intercepted.

QA Lab report clocks and Slack private inputs

Remove unused private parity-report clock selectors and Slack's unused question-resolver injection. Keep output timestamps, public flags, and the canonical SDK question operation.

Keep qa-cli-process's environment input, which has an actual consumer. Seven other QA production cuts were dropped after the initial CI run, as detailed in the CI follow-up below. Their current-main implementations remain unchanged by this PR.

Best-effort tradeoffs accepted: none. These are unused private alternatives, not public configuration or exported SDK contracts. Heartbeat recovery and authority checks remain; its retained fixture now exercises the actual default schedule without injected timer/retry overrides.

Signal reaction fixtures

Share the identical SDK-store capture mock across five suites. Preserve the namespace, module-reload capture set, all nine reset sites, every test, and every assertion; do not reintroduce the private reset exports retired by #178746. Load the helper before subject imports. Warm the existing invalid-persistence case with a same-key valid target so an ineffective reset fails; it was red with the late helper import and green after the ordering repair.

Best-effort tradeoffs accepted: none. Only duplicated fixture setup moves to a local test-support owner.

Feishu native loopback transport

Use the installed Lark client's native domain support in three document suites and the DM/content suites instead of reconstructing HTTP/fetch/JSON adapters or installing global routing interceptors. Retain real token exchange, request ordering, payload/error assertions, both config-schema parses, and lifecycle-sensitive authority fixtures. Correct one exact GET-body expectation to {}: the old fetch adapter discarded that data, while the installed SDK and the production Axios dispatch send it.

Best-effort tradeoffs accepted: none. Loopback domains remain test-only overrides after validation; supported production domain validation and routing do not change.

Shared HTTP fixture lifecycle

Reuse the existing openclaw/plugin-sdk/test-env withServer in browser, Feishu, Google Chat, Slack, Teams, Matrix, memory, and QA Lab fixtures. Keep handlers, actual SDK/guarded HTTP requests, all assertions, and all cases. Cancellation/closure/transmission bounds are observed inside callbacks, before helper cleanup. Client/manager/lab shutdown still precedes HTTP-server close. No new production test seam is introduced.

Best-effort tradeoffs accepted: none. This removes duplicated listener/socket lifecycle scaffolding, not cleanup, transport, security, durability, or retirement contracts.

Memory activity and JSON fixtures

Share the identical foundation activity mock across three index-scheduling suites, preserving immediate idle delivery, per-suite listener ownership, unsubscribe clearing, all 95 assertions, and publication/reopen/shutdown behavior. Two embedding suites use Node's JSON stream consumer instead of duplicating buffer accumulation; all 42 assertions and their transport/lifecycle behavior stay intact. The standalone session-memory backend is untouched.

Best-effort tradeoffs accepted: none. Synthetic request JSON is unchanged; these suites do not assert malformed/BOM decoding behavior. No schema, durability, retention, or permission change.

Slack context fixtures

Use the existing monitor-context fixture in two suites instead of copying its defaults. Keep every different identity, config, app, runtime, group, slash-command, and media value, including the debounce fixture's absent bot ID. All 25 assertion sites remain.

Best-effort tradeoffs accepted: none. Only repeated fixture defaults disappear; channel policy and runtime ownership stay unchanged.

Evidence

GitHub reports 611 net lines removed (1,481 additions / 2,092 deletions across 72 files). The local committed diff is also 611 net (1,491 additions / 2,102 deletions). Production: 134 net removed; tests/support and shrink-only ratchet maintenance: 477 net removed. The initially opened head was 650 net on GitHub; the narrowed repair head is 03d7ddb3b646f72f5bf21b4046f506aba691efa0.

Focused Vitest packets through the repository wrapper passed for the touched browser, Discord, Feishu, Google Chat, Matrix, memory, Teams, QA Lab, Signal and Slack owners, plus the internal runtime-barrel guardrail. The final fixture-repair packet passed 8 files / 96 tests in 596.86 seconds; the final Discord proof passed 1 file / 7 tests in 139.16 seconds. These wall times include compiler preparation under shared-host load, not just test execution. The retained long partial-delivery cases exercise real durable ingress/restart behavior; no timeout, retry or skip was added.

The Signal reset negative control failed on the intended warmed-cache defect before import-order repair, then passed. An exported-hoisted memory fixture declaration was corrected after Vitest rejected its setup; one exact Feishu GET-body expectation was corrected to the native SDK request instead of weakening the comparison. Production and test targeted type graphs pass; focused syntax lint and formatting pass on all 77 files; lint-suppressions passes 14 tests; both runtime and Madge import-cycle checks report zero cycles.

Fresh isolated Codex review found the fixture import-order defect, now repaired and proven. Its sole remaining finding requests the retired mid-call proxy custody, declined under the explicit best-effort tradeoff and provenance above. Two earlier public-contract concerns were resolved against the documented internal runtime-barrel boundary; public api.ts and SDK compatibility contracts are unchanged.

Exact-head CI run 40072542592 is green: all 75 jobs completed successfully. All 129 check-runs on 03d7ddb3b646f72f5bf21b4046f506aba691efa0 were enumerated with none pending, failing, or cancelled. Security Review 40074240706 published successful openclaw/ci-gate, dependency-review, and security-sensitive-review statuses. No CI rerun was used. The ordinary local lint wrapper attempted full SDK declaration preparation and was stopped to honor the host budget; its supported focused syntax-only route passed instead. No local broad suite, full build, live channel, or live Chromium claim.

CI follow-up

The initial run 40070239591 found three attributable static failures: an obsolete Matrix verification fixture argument, generic Request stringification in the new Discord fixture, and stale assertion-safety allowances after deletions. The repair removes the argument, reads Request URLs explicitly, and shrinks only the three named ratchet entries. No assertion, timeout, retry, skip, or retained behavior is weakened. Focused repair proof passes Matrix verification (18 tests), Discord deployment diagnostics (7 tests), lint-suppressions (14 tests), the targeted Matrix type graph, formatting, focused syntax lint, and assertion-safety ratchet.

The retained heartbeat fixture also passes all 21 tests against the restored main implementation, including its actual default retry schedule. This serial run took 301.45 seconds including 205.03 seconds of compiler preparation under shared-host load.

Three E2Es also failed: managed-worktree run-end retention, subagent completion during timeout recovery, and the Telegram model-picker callback queue. The flake registry and the inspected completed scheduled-main logs did not establish matching inherited failures. A QA-local runtime import walk (including literal dynamic imports and excluding type-only edges) found seven changed production files reachable through their QA entry barrels: Docker harness, Matrix substrate client, credential heartbeat, mock-provider input parsing, broker bootstrap, tool-search evidence, and self-check. These seven files were restored byte-for-byte to current main under the campaign's reachability-based drop rule. This is conservative scope reduction, not a diagnosis that their unused-input removals caused the E2E failures. Parity-report clocks and independent fixture changes are outside that slice and remain.

Keep request diagnostics with the Discord deployer, remove unused private metadata and inputs, and reuse existing SDK and local test-fixture owners. Preserve public SDK, channel, security and persistence contracts.

Accept best-effort restoration of the initial proxy environment after overlapping loopback CDP calls; unrelated mid-call environment edits no longer have custody machinery. Focused boundary tests, targeted types and independent review are recorded with the PR.
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 24, 2026 06:26
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: signal Channel integration: signal channel: slack Channel integration: slack extensions: memory-core Extension: memory-core channel: feishu Channel integration: feishu extensions: qa-lab extensions: browser size: XL labels Oct 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T07:04:18.699537Z 03d7ddb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates plugin request ownership, removes unused private surfaces, and shares existing test fixtures.

Example: During a CDP call to http://127.0.0.1:9222, unrelated code changes NO_PROXY from internal.corp to other.corp.

  • Before: Final cleanup preserves other.corp.
  • After: Final cleanup restores internal.corp, an explicitly accepted best-effort tradeoff.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Meaningful boundary coverage supports the cleanup, but the incomplete fixture migration and stale ratchet entries prevent a clean validation verdict.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the contributor proof gate; supplied validation and inspected tests exercise production owners in process, with no shipped Gateway, live channel, or Chromium run claimed.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Duplicated request interception and fixture plumbing make bundled plugin behavior harder to maintain.
Reason: The maintainer-authored direction reduces competing ownership and unused private alternatives, with the proxy compromise explicitly accepted.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: the maintainer-approved cleanup is useful, but an unmigrated Matrix fixture and stale assertion baselines introduce two concrete validation failures.

Priority: P3
Reviewed head: 9e09402c6a13f69181f9d2ffb2c7610b9bc6b3fe

Before merge

  • Remove the retired facade argument from the verification fixture (P2) - Removing isRoomEncrypted from createMatrixCryptoFacade's parameter type leaves this direct object-literal caller unchanged. TypeScript rejects the extra property, and test/tsconfig/tsconfig.extensions.test.json includes this suite. Remove the obsolete argument here, completing the same migration already made in the other facade fixtures.
  • Shrink the assertion baseline after removing the casts (P2) - The removed helpers reduce provider.deploy-errors.ts from six counted assertions to four, provider.deploy.ts from three to zero, and Feishu client.ts from four to one, but these baseline entries remain unchanged. runPerFileCountRatchet explicitly returns exit 1 for stale allowances, so the cleanup fails the assertion-safety gate. Regenerate the affected baseline reductions, removing the zero-count entry without expanding allowances.

Findings

  • [P2] Remove the retired facade argument from the verification fixture — extensions/matrix/src/matrix/sdk/verification-manager.test.ts:102
  • [P2] Shrink the assertion baseline after removing the casts — config/assertion-safety-baseline.txt:229-230

Provenance

  • QA Lab unused private selectors: original intent not found (unknown: Scoped history and caller searches confirm retained default paths but do not establish one introduction or rationale covering all removed private selectors.)
Agent review details

How this fits together

Bundled plugins translate Gateway operations into channel and browser requests; their tests exercise those owners through SDK clients, HTTP fixtures, and isolated state.

flowchart LR
  A[Gateway operations] --> B[Bundled plugin owners]
  B --> C[SDK and transport clients]
  C --> D[Channel and browser services]
  E[Integration tests] --> B
  C --> F[Shared HTTP fixtures]
Loading

Technical review

Best possible solution:

Complete the existing-owner cleanup by removing the obsolete Matrix fixture argument and shrinking only the assertion allowances eliminated by this PR.

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

Source establishes both failures: the Matrix fixture supplies a removed parameter, and the assertion checker rejects the unchanged allowances after casts disappear; no target code was executed.

Is this the best way to solve the issue?

The consolidation uses existing owners and preserves supported contracts; the smallest complete version also migrates the remaining Matrix fixture and updates the shrinking baseline.

Full review comments:

  • [P2] Remove the retired facade argument from the verification fixture — extensions/matrix/src/matrix/sdk/verification-manager.test.ts:102
    Removing isRoomEncrypted from createMatrixCryptoFacade's parameter type leaves this direct object-literal caller unchanged. TypeScript rejects the extra property, and test/tsconfig/tsconfig.extensions.test.json includes this suite. Remove the obsolete argument here, completing the same migration already made in the other facade fixtures.
    Confidence: 0.99
  • [P2] Shrink the assertion baseline after removing the casts — config/assertion-safety-baseline.txt:229-230
    The removed helpers reduce provider.deploy-errors.ts from six counted assertions to four, provider.deploy.ts from three to zero, and Feishu client.ts from four to one, but these baseline entries remain unchanged. runPerFileCountRatchet explicitly returns exit 1 for stale allowances, so the cleanup fails the assertion-safety gate. Regenerate the affected baseline reductions, removing the zero-count entry without expanding allowances.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6ba8529d86d3.

Provenance checked

  • Browser proxy restoration changes intended behavior with a stated reason (ce62516: The prior repair preserved concurrent environment edits while maintaining loopback coverage; subsequent refactors retained that behavior.)
  • Discord deployment diagnostics keeps the original intent (36e0ac3: Prevent unrelated startup REST traffic from receiving deployment labels and duplicate warnings, as documented in fix(logs): clean up gateway and channel startup/shutdown log output #104174.)
  • Matrix decryption retries keeps the original intent (4200745: Retry failed events through the SDK event API after late keys arrive, bypassing the client helper's failed-decryption guard, as documented in fix(matrix): handle event decryption errors during sync #94416.)
  • Feishu interceptor registration keeps the original intent (93d0d2a: Use the public interceptor API without accessing or replacing Axios private handlers, as documented in fix(feishu): avoid axios interceptor internals #89806.)
  • Teams pending-upload cleanup keeps the original intent (7843187: Retain pending file-consent uploads and expire or explicitly remove them; subsequent cleanup consolidated expiry handling through removePendingUpload.)
  • Signal approval-reaction fixtures keeps the original intent (13c25be: Retire private native test seams while capturing and clearing the SDK-owned stores.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm tsgo:extensions:test
  • pnpm test extensions/matrix/src/matrix/sdk/verification-manager.test.ts --maxWorkers=1
  • pnpm check:assertion-safety --base e29f837 --no-merge-base

What I checked:

Likely related people:

  • Vincent Koc: Raw commit ce62516 adds extensions/browser/src/browser/cdp-proxy-bypass.ts:48 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ce625162519c; files: extensions/browser/src/browser/cdp-proxy-bypass.ts)
  • mushuiyu886: Raw commit 4200745 adds extensions/matrix/src/matrix/sdk/decrypt-bridge.ts:371 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4200745a9835; files: extensions/matrix/src/matrix/sdk/decrypt-bridge.ts)

PR surface

Source -174, Tests -476. Total -650 across 77 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 24 94 268 -174
Tests 53 1401 1877 -476
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 77 1495 2145 -650

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +94/-268; tests/support +1401/-1877 Both categories shrink overall; production additions relocate request diagnostics, while test changes reuse existing lifecycle owners and retain distinct boundary assertions.

Labels

Label changes:

  • add P3: This is internal maintenance without an urgent user-facing regression; its confirmed blockers are narrow validation repairs.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal maintenance without an urgent user-facing regression; its confirmed blockers are narrow validation repairs.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 2:45 AM ET / 06:45 UTC.

@steipete
steipete merged commit 283b8a0 into main Oct 24, 2026
141 checks passed
@steipete
steipete deleted the deslop/s05-1-plugin-owners-20261015 branch October 24, 2026 08:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* refactor(plugins): consolidate request and fixture owners

Keep request diagnostics with the Discord deployer, remove unused private metadata and inputs, and reuse existing SDK and local test-fixture owners. Preserve public SDK, channel, security and persistence contracts.

Accept best-effort restoration of the initial proxy environment after overlapping loopback CDP calls; unrelated mid-call environment edits no longer have custody machinery. Focused boundary tests, targeted types and independent review are recorded with the PR.

* fix: repair plugin cleanup CI and narrow QA scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: signal Channel integration: signal channel: slack Channel integration: slack extensions: browser extensions: memory-core Extension: memory-core extensions: qa-lab P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant