Repository navigation
refactor: deslop Discord, QA Lab and plugin fixtures - #182302
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherBundled 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6ba8529d86d3. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -174, Tests -476. Total -650 across 77 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 24, 2026, 2:45 AM ET / 06:45 UTC. |
|
Merged via squash.
|
* 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
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/feishuMsgerror 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
isRoomEncryptedcallback/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_proxyvalues even if unrelated code edited them meanwhile. #83382 (ce625162519c6, later refined by61d9a6d750455and 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.tsis an internal barrel, as documented indocs/plugins/sdk-channel-plugins.md; the publicapi.tsexports 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-envwithServerin 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.tsand SDK compatibility contracts are unchanged.Exact-head CI run
40072542592is green: all 75 jobs completed successfully. All 129 check-runs on03d7ddb3b646f72f5bf21b4046f506aba691efa0were enumerated with none pending, failing, or cancelled. Security Review40074240706published successfulopenclaw/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
40070239591found 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.