fix(test): reduce startup-heavy hotspot retention#52381
Conversation
Greptile SummaryThis PR reduces startup time and RSS for five identified hotspot test files by splitting two heavy modules into lighter seams and adding a new Key changes:
Confidence Score: 5/5
|
84d3c15 to
fa1f376
Compare
(cherry picked from commit dbd26e4)
* test: add Feishu bot-menu lifecycle regression (cherry picked from commit 0e825ec) * fix(feishu): harden webhook signature compare (cherry picked from commit 223ae42) * refactor: move feishu zalo zalouser to setup wizard (cherry picked from commit 40be12d) * Plugin SDK: add legacy message discovery helper (cherry picked from commit 4c36436) * refactor: rename setup helper surfaces (cherry picked from commit 53ccc78) * Feishu: split setup adapter helpers (cherry picked from commit 61bcdcc) * refactor: share feishu webhook monitor harness (cherry picked from commit 6464149) * fix(ci): reset deep test runtime state (cherry picked from commit 83a267e) * Plugins: internalize matrix and feishu SDK imports (cherry picked from commit 889bb8a) * Feishu: break plugin-sdk setup cycle (cherry picked from commit 9b6859e) * fix(test): reduce startup-heavy hotspot retention (openclaw#52381) (cherry picked from commit dbd26e4) * feat(feishu): structured cards with identity header, note footer, and streaming enhancements (openclaw#29938) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: nszhsl <512639+nszhsl@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit df3a247) * test: dedupe feishu startup preflight waits (cherry picked from commit 1ea5bba) * test: flatten feishu docx hoisted mocks (cherry picked from commit 285f903) * Feishu: move outbound session routing behind plugin boundary (cherry picked from commit 2a02337) * fix(test): split feishu bot helpers (cherry picked from commit 383d5ac) * Security: preserve Feishu reaction chat type (openclaw#44088) * Feishu: preserve looked-up chat type * Feishu: fail closed on ambiguous reaction chats * Feishu: cover reaction chat type fallback * Changelog: note Feishu reaction hardening * Feishu: fail closed without resolved chat type * Feishu: normalize reaction chat type at runtime (cherry picked from commit 3e730c0) * test: reduce feishu reply dispatcher duplication (cherry picked from commit 3ffb9f1) * test: add Feishu ACP failure lifecycle regression (cherry picked from commit 628b55a) * Feishu: lazy-load runtime-heavy channel paths (cherry picked from commit 66a8c25) * fix(test): repair extensions lane regressions (cherry picked from commit 75ab4db) * test: add Feishu card-action lifecycle regression (cherry picked from commit 7d50e7f) * tests(feishu): inject client runtime seam (cherry picked from commit 8448f48) * test: dedupe feishu media account setup (cherry picked from commit 8ca510a) * test: dedupe feishu config schema checks (cherry picked from commit 9a14696) * refactor: share feishu reaction client setup (cherry picked from commit a14a326) * test: reuse feishu streaming merge helper (cherry picked from commit a474a9c) * test: dedupe feishu account resolution fixtures (cherry picked from commit a7e5925) * test: dedupe feishu probe fixtures (cherry picked from commit b23bfef) * test: add Feishu broadcast lifecycle regression (cherry picked from commit c7cebd6) * fix: adapt cherry-picks for fork TS strictness Remove upstream-only files (runtime-api, setup-wizard, message-tool-legacy) and fix import paths for fork's module structure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove setup-core.ts (DTS rootDir violation) and fix test mock path - Remove setup-core.ts that caused DTS build failure (extensions/ outside rootDir) - Update helpers.test.ts mock path from onboarding.js to setup.js (matching rename) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove extensions/ exports from plugin-sdk (DTS rootDir) and broken test - Remove feishuOnboardingAdapter, zaloOnboardingAdapter, zalouserOnboardingAdapter re-exports from plugin-sdk/* (these pull extensions/ into DTS rootDir scope) - Remove vitest-extensions-config.test.ts (tests non-existent function) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> Co-authored-by: songlei <sl@yizhisec.com> Co-authored-by: nszhsl <512639+nszhsl@users.noreply.github.com> Co-authored-by: huntharo <harold@pwrdrvr.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(agents): normalize windows workspace path boundary checks (openclaw#30766) Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit ef89b48) * fix: bypass proxy for CDP localhost connections (openclaw#31219) When HTTP_PROXY / HTTPS_PROXY / ALL_PROXY environment variables are set, CDP connections to localhost/127.0.0.1 can be incorrectly routed through the proxy (e.g. via global-agent or undici proxy dispatcher), causing browser control to fail. Fix: - New cdp-proxy-bypass module with utilities for direct localhost connections - WebSocket (ws) CDP connections: pass explicit http.Agent to bypass any global proxy agent patching - fetch-based CDP probes: wrap in withNoProxyForLocalhost() to temporarily set NO_PROXY for the duration of the call - Playwright connectOverCDP: wrap in withNoProxyForLocalhost() since Playwright reads env vars internally - 13 new tests covering getDirectAgentForCdp, hasProxyEnv, and withNoProxyForLocalhost (env save/restore, error recovery) (cherry picked from commit c96234b) * fix(mattermost): pass mediaLocalRoots through reply delivery (openclaw#44021) Merged via squash. Prepared head SHA: 856f11f Co-authored-by: LyleLiu666 <31182860+LyleLiu666@users.noreply.github.com> Co-authored-by: mukhtharcm <56378562+mukhtharcm@users.noreply.github.com> Reviewed-by: @mukhtharcm (cherry picked from commit c965049) * fix(test): reduce startup-heavy hotspot retention (openclaw#52381) Extract applyMSTeamsWebhookTimeouts + constants from monitor.ts into standalone webhook-timeouts.ts module and update test import. Subset of upstream dbd26e4 — fork takes only the msteams-local changes. (cherry picked from commit dbd26e4) * fix(ci): split redact snapshot schema coverage (cherry picked from commit 5841e3b) * fix(logging): make logger import browser-safe (cherry picked from commit df3a190) * fix: resume orphaned subagent sessions after SIGUSR1 reload Closes openclaw#47711 After a SIGUSR1 gateway reload aborts in-flight subagent LLM calls, the gateway now scans for orphaned sessions and sends a synthetic resume message to restart their work. Also makes the deferral timeout configurable via gateway.reload.deferralTimeoutMs (default: 5 minutes, up from 90s). (cherry picked from commit 304703f) * fix(gateway): pin plugin webhook route registry (openclaw#47902) (cherry picked from commit a69f619) * fix: validate edge tts output file is non-empty before reporting success (openclaw#43385) thanks @Huntterxx Merged after review.\n\nSmall, scoped fix: treat 0-byte Edge TTS output as failure so provider fallback can continue. (cherry picked from commit 946c24d) * fix(config): regenerate base schema + add label after deferralTimeoutMs port Follow-up to cherry-pick 304703f (fix: resume orphaned subagent sessions after SIGUSR1 reload): - Regenerate src/config/schema.base.generated.ts (picks up new gateway.reload.deferralTimeoutMs field + help text) - Add FIELD_LABELS entry for gateway.reload.deferralTimeoutMs (schema.help.quality test enforces label parity) - Update infra-runtime timeout test to advance 5m instead of 90s (default raised by the fix) --------- Co-authored-by: Shawn <118158941+kevinWangSheng@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Marcus Widing <widing.marcus@gmail.com> Co-authored-by: Lyle <31182860+LyleLiu666@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> Co-authored-by: Altay <altay@uinaf.dev> Co-authored-by: Joey Krug <joeykrug@gmail.com> Co-authored-by: Peter Steinberger <peter@steipete.me> Co-authored-by: Hiago Silva <97215740+Huntterxx@users.noreply.github.com>
Summary
src/infra/outbound/message-action-runner.threading.test.ts,extensions/msteams/src/monitor.test.ts,extensions/feishu/index.test.ts,extensions/bluebubbles/src/setup-surface.test.ts, andsrc/plugins/provider-wizard.test.ts.singletonIsolatedscheduler support so startup-heavy extension tests can be peeled out of the shared lane.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
None.
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
OPENCLAW_TEST_MEMORY_TRACE=1 OPENCLAW_TEST_WORKERS=1 pnpm test -- <file>.pnpm build, andpnpm check.Expected
Actual
src/infra/outbound/message-action-runner.threading.test.ts:22.88s/518.6 MiB->2.39s/222.4 MiBextensions/msteams/src/monitor.test.ts:19.56s/584.8 MiB->1.20s/250.2 MiBsrc/plugins/provider-wizard.test.ts:317.8 MiB->237.0 MiB, and now isolated from sharedunit-fastextensions/feishu/index.test.tsandextensions/bluebubbles/src/setup-surface.test.tsremain startup-heavy, but are now isolated from the shared extensions laneextensions/msteams/src/monitor.test.tsshowed no meaningful retained growth, so that case was startup/import cost rather than a real leakEvidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm buildpnpm checkpnpm testReview Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
4d7706e64cRisks and Mitigations
scripts/test-parallel.mjsnow creates explicit isolated extension entries, andtest/vitest-extensions-config.test.tscovers the include-file behavior.