Skip to content

test: make suites safe without isolation - #78834

Merged
steipete merged 3 commits into
mainfrom
test/no-isolation-audit-20260507
May 7, 2026
Merged

steipete merged 3 commits into
mainfrom
test/no-isolation-audit-20260507

Conversation

@steipete

@steipete steipete commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove remaining forced Vitest isolation from plugin, gateway-server, and UI test configs
  • clean leaked env/globals/module mocks/timers across the audited suites so tests run safely without per-file isolation
  • retire stale/duplicate skipped tests, re-enable fixed coverage, and fix memory hybrid search so keyword-only FTS matches survive vector min-score filtering

Verification

  • rg -n "isolate:\s*true" test src extensions packages ui -> no matches
  • /tmp/openclaw-tests.md audit tracker: 0 unchecked entries; 5,183 current *.test.ts covered, plus one stale test file removed
  • git diff --check
  • git diff --name-only --diff-filter=ACM | xargs pnpm exec oxfmt --check --threads=1
  • Crabbox/Testbox non-isolated suite proof:
    • pnpm test extensions/telegram -- --isolate=false --reporter=verbose -> 108 files / 1,490 tests passed
    • pnpm test extensions/thread-ownership extensions/tlon extensions/together extensions/tokenjuice extensions/tts-local-cli extensions/twitch extensions/venice extensions/vercel-ai-gateway extensions/video-generation-core extensions/vllm extensions/voice-call extensions/volcengine extensions/vydra -- --isolate=false --reporter=verbose -> 6 shards passed
    • pnpm test extensions/video-generation-providers.live.test.ts extensions/web-readability extensions/webhooks extensions/whatsapp extensions/xai extensions/xiaomi extensions/zai extensions/zalo extensions/zalouser -- --isolate=false --reporter=verbose -> 6 shards passed
    • pnpm test extensions/acpx extensions/active-memory extensions/alibaba extensions/amazon-bedrock-mantle extensions/amazon-bedrock extensions/anthropic-vertex extensions/anthropic extensions/arcee extensions/azure-speech extensions/bluebubbles extensions/bonjour extensions/brave extensions/browser -- --isolate=false --reporter=verbose -> 7 shards passed
    • pnpm test extensions/byteplus extensions/chutes extensions/cloudflare-ai-gateway extensions/codex extensions/comfy extensions/deepgram extensions/deepinfra extensions/deepseek extensions/device-pair extensions/diagnostics-otel extensions/diagnostics-prometheus extensions/diffs extensions/discord extensions/document-extract extensions/duckduckgo extensions/elevenlabs extensions/exa extensions/fal extensions/feishu extensions/file-transfer extensions/firecrawl extensions/fireworks extensions/github-copilot extensions/google-meet extensions/google extensions/googlechat extensions/gradium extensions/groq extensions/huggingface extensions/image-generation-core extensions/imessage extensions/inworld extensions/irc extensions/kilocode extensions/kimi-coding extensions/line extensions/litellm extensions/llm-task extensions/lmstudio extensions/lobster -- --isolate=false --reporter=verbose -> 11 shards passed
    • pnpm --dir ui test -- --reporter=verbose -> 112 files / 1,255 tests passed
    • pnpm --dir ui exec vitest run --config vitest.node.config.ts --reporter=verbose -> 23 files / 323 tests passed
    • plugin config non-isolated -> 144 files / 1,804 tests passed
    • gateway-server config non-isolated -> 101 files / 902 tests passed

Real behavior proof

  • Behavior addressed: OpenClaw’s Vitest suites can run with isolation disabled, and the memory hybrid search path keeps keyword-only FTS hits instead of dropping them when vector scoring is unavailable or below the minimum score.
  • Real environment tested: Crabbox/Testbox remote Linux workers running the OpenClaw checkout after this patch, plus the local macOS checkout for the narrow rebase-conflict validation.
  • Exact steps or command run after this patch: after enabling isolate: false in the plugin, gateway-server, and UI configs, ran the non-isolated suite buckets listed above on Crabbox/Testbox; after rebasing onto latest main, ran pnpm test extensions/amazon-bedrock/index.test.ts extensions/google/video-generation-provider.test.ts -- --isolate=false --reporter=verbose locally.
  • Evidence after fix: copied terminal output from the after-fix remote worker runs reported: Telegram 108 files / 1,490 tests passed; UI browser config 112 files / 1,255 tests passed; UI node config 23 files / 323 tests passed; plugin config 144 files / 1,804 tests passed; gateway-server config 101 files / 902 tests passed; extension buckets completed across 6, 6, 7, and 11 Vitest shards without isolation.
  • Observed result after fix: the after-fix non-isolated commands completed successfully with no remaining isolate: true config override and no unchecked files in /tmp/openclaw-tests.md; the local rebase validation passed 2 files / 44 tests.
  • What was not tested: no benchmark run; Peter explicitly said no benchmark was needed.

@openclaw-barnacle openclaw-barnacle Bot added channel: bluebubbles Channel integration: bluebubbles channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web channel: zalouser Channel integration: zalouser app: web-ui App: web-ui extensions: diagnostics-otel Extension: diagnostics-otel extensions: llm-task Extension: llm-task extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb agents Agent runtime and tooling channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch extensions: device-pair channel: irc extensions: acpx extensions: anthropic extensions: openai extensions: minimax extensions: cloudflare-ai-gateway extensions: huggingface extensions: volcengine extensions: xiaomi extensions: kilocode labels May 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eed0555383

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 107 to 110
function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory {
const override = (
globalThis as typeof globalThis & {
[JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory;
}
)[JITI_FACTORY_OVERRIDE_KEY];
if (override) {
return override;
}
if (createJitiLoaderFactory) {
return createJitiLoaderFactory;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore Jiti factory override support

Removing the global openclaw.pluginModuleLoaderJitiFactoryOverride check from loadCreateJitiLoaderFactory breaks existing tests that still inject a fake loader via that symbol (for example src/channels/plugins/module-loader.test.ts and src/plugin-sdk/channel-entry-contract.test.ts). In that setup, getCachedPluginModuleLoader now always uses the real jiti loader, so the TypeScript fallback test executes the fixture module and fails with Error: native source load failed when running the channels suite (pnpm test src/channels/plugins/module-loader.test.ts -- --isolate=false).

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: test: make suites safe without isolation This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete force-pushed the test/no-isolation-audit-20260507 branch from 719f905 to d40859d Compare May 7, 2026 07:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d40859d69c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 107 to 110
function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory {
const override = (
globalThis as typeof globalThis & {
[JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory;
}
)[JITI_FACTORY_OVERRIDE_KEY];
if (override) {
return override;
}
if (createJitiLoaderFactory) {
return createJitiLoaderFactory;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore Jiti loader override used by channel loader tests

loadCreateJitiLoaderFactory now always pulls createJiti from require("jiti"), but several suites still inject a fake loader through Symbol.for("openclaw.pluginModuleLoaderJitiFactoryOverride") (for example src/channels/plugins/module-loader.test.ts and src/plugin-sdk/channel-entry-contract.test.ts). With this hook removed, those tests hit the real Jiti path and execute the fixture source module instead of the stubbed loader, which reintroduces deterministic failures in the TypeScript fallback scenario (native source load failed) when running the affected suites with --isolate=false.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 1ef85c7 into main May 7, 2026
114 checks passed
@steipete
steipete deleted the test/no-isolation-audit-20260507 branch May 7, 2026 07:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9407bda32f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 107 to 110
function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory {
const override = (
globalThis as typeof globalThis & {
[JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory;
}
)[JITI_FACTORY_OVERRIDE_KEY];
if (override) {
return override;
}
if (createJitiLoaderFactory) {
return createJitiLoaderFactory;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore Jiti factory override hook in loader cache

Removing the globalThis[Symbol.for("openclaw.pluginModuleLoaderJitiFactoryOverride")] check means suites that still stub that symbol can no longer inject a fake loader and will execute real source modules via jiti, which breaks the non-isolated channel-entry contract coverage path when it expects stubbed loading behavior. Fresh evidence in this commit: src/channels/plugins/module-loader.test.ts was migrated to a new per-module setter, but src/plugin-sdk/channel-entry-contract.test.ts still sets the symbol-based override (e.g. lines 289 and 419), so the remaining suite now loses its injection seam.

Useful? React with 👍 / 👎.

@steipete

steipete commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Landed.

  • Gate: GitHub PR checks green for head 9407bda32f5938932d1731eaa426b767d9d96d4f; local targeted checks included non-isolated channel/module-loader, Codex app-server auth bridge, UI package config tests, tsgo:extensions, tsgo:extensions:test, and extension package-boundary compile.
  • PR head: 9407bda32f5938932d1731eaa426b767d9d96d4f
  • Merge commit: 1ef85c7d4c30c05b7ef4191d00b50cdb7e4d8721

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* test: make suites safe without isolation

* fix: narrow auth profile credential types

* test: inject channel module loader factory locally
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* test: make suites safe without isolation

* fix: narrow auth profile credential types

* test: inject channel module loader factory locally
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* test: make suites safe without isolation

* fix: narrow auth profile credential types

* test: inject channel module loader factory locally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant