Skip to content

fix(models): reduce repeated provider lookup overhead - #155250

Merged
steipete merged 2 commits into
mainfrom
codex/team-provider-lookup-perf
Sep 21, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/team-provider-lookup-perf

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated model lookups do unnecessary provider work on the Gateway event thread.

User Impact

Reduces the work needed to normalize model references through managed providers. A same-machine fixture benchmark improved the managed paths; plain unwrapped hooks incurred about 0.5 microseconds more per call. Deployed latency and event-loop improvements have not yet been measured.

Why This Change Was Made

Provider selection now returns the existing registration. Model normalization reads its hook and receiver fields on demand instead of copying every provider field through the plugin view. The authoritative plugin ID, original getter and managed callback receivers, local writes, reflection, deletion, and revocation remain covered by regression tests. Consumers that need a full provider retain that behavior.

Bundled-directory lookups also check the explicit test-trust flag before probing the test environment, and avoid reading the same environment twice. Mutations and explicit/ambient fallback remain supported.

Evidence

  • 247 focused and sibling tests passed on a Blacksmith Testbox with Node 24.19.0, including managed receiver disposal and mutable data/callback views.
  • Transplanted regression tests fail on the original production code only for the two unwanted reads; seven receiver and environment controls pass there.
  • Independent managed P0–P2 review and the current-head ClawSweeper review are clean. Exact-head CI completed successfully, including type, lint, metadata, and build gates. The initial CI lint failure was corrected by renaming shadowed local bindings; a separate delta review verified unchanged behavior. The earlier duplicate supplemental Testbox run was intentionally stopped and is not reported as a completed gate.
  • ABBA measurements, 10,000 synthetic normalizeModelRef calls per run:
Provider shape Before mean After mean Before / after mean peak RSS
Managed, with hook 168.9 ms 62.0 ms 381.9 / 378.9 MiB
Managed, no hook 121.4 ms 23.7 ms 380.5 / 364.8 MiB
Plain, with hook 20.4 ms 25.6 ms 363.5 / 366.2 MiB

These are short synthetic measurements on one machine, not proof of deployed gains. The initial two-file test invocation took 28.13 seconds, including cold worker preparation; sibling invocations took 36.82 and 23.36 seconds. The focused files took 22.18 seconds (provider selection, including cold worker preparation) and 3.66 seconds (bundled directory) in the initial run.

@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 22:42
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 7:11 PM ET / 23:11 UTC.

ClawSweeper review

What this changes

The PR reduces repeated model lookup work by reading provider fields on demand and avoiding unnecessary test-environment checks during bundled-plugin directory resolution.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful performance improvement beyond current main. No blocking correctness or security defect was found in the introduced changes.

Priority: P2
Reviewed head: 7b3fe8d25da237c5cfe4e99823eba28199662b4a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with meaningful regression coverage, bounded benchmark claims, and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified maintainer-author exemption applies. Supplied evidence exercises synthetic normalization and receiver scenarios; deployed Gateway gains remain explicitly unmeasured, and no material authority change requires additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified maintainer-author exemption applies. Supplied evidence exercises synthetic normalization and receiver scenarios; deployed Gateway gains remain explicitly unmeasured, and no material authority change requires additional final-effect proof.
Evidence reviewed 9 items Pinned change ownership: Reviewed the introduced merge-base-to-head changes. The stale GitHub test merge was not used to infer removal of current-main behavior.
Current main still performs eager copying: Current main selects a registration and copies its enumerable provider fields before invoking normalization; the proposed lazy receiver is absent.
Latest release comparison: The supplied latest release also uses the previous normalization path rather than the proposed lazy receiver.
Findings None None.
Security None None.

How this fits together

OpenClaw normalizes model references using static rules and the selected provider’s runtime hook. The provider registry supplies the eligible registration, while plugin lifecycle wrappers govern executable callbacks.

flowchart LR
  A[Model reference] --> B[Static normalization]
  B --> C[Eligible provider registration]
  C --> D{Normalization hook present?}
  D -->|Yes| E[Lifecycle-managed callback]
  D -->|No| F[Canonical model reference]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +74, Tests +116. Total +190 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 99 25 +74
Tests 3 164 48 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 263 73 +190

Review metrics

Metric Value Why it matters
Production versus test growth production +74 net lines; tests +116 net lines Production growth preserves lazy receiver semantics and is justified by the reported managed-provider benchmark improvement.
Reported managed lookup cost 10,000 calls: 168.9 → 62.0 ms with hook; 121.4 → 23.7 ms without hook The fixture isolates the intended optimization; plain-hook overhead increases by approximately 0.52 microseconds per call.

Technical review

Best possible solution:

Keep normalization on the existing registry and lifecycle owners while avoiding unrelated provider reads and preserving full-provider consumers.

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

Yes, the unnecessary reads are source-reproducible: current main copies all enumerable selected-provider fields before normalization. No runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes, the change targets the repeated work without adding another cache or changing provider selection policy; the benchmark supports lookup savings, not deployed latency claims.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded runtime performance improvement with measured synthetic benefit and no demonstrated urgent user-facing failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified maintainer-author exemption applies. Supplied evidence exercises synthetic normalization and receiver scenarios; deployed Gateway gains remain explicitly unmeasured, and no material authority change requires additional final-effect proof.

Label justifications:

  • P2: This is a bounded runtime performance improvement with measured synthetic benefit and no demonstrated urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified maintainer-author exemption applies. Supplied evidence exercises synthetic normalization and receiver scenarios; deployed Gateway gains remain explicitly unmeasured, and no material authority change requires additional final-effect proof.

Evidence

What I checked:

  • Pinned change ownership: Reviewed the introduced merge-base-to-head changes. The stale GitHub test merge was not used to infer removal of current-main behavior. (7b3fe8d25da2)
  • Current main still performs eager copying: Current main selects a registration and copies its enumerable provider fields before invoking normalization; the proposed lazy receiver is absent. (src/plugins/provider-registry-selection.ts:44, e7f94eb36392)
  • Latest release comparison: The supplied latest release also uses the previous normalization path rather than the proposed lazy receiver. (src/agents/provider-model-normalization.runtime.ts:18, ec9c1a13db89)
  • Selection and lifecycle contracts: Eligibility remains evaluated during selection. Normalization reads the existing wrapped callback; the plugin value-view owner still binds its original receiver and admits calls through the instance lifecycle. Full-provider consumers retain their existing copies. No public SDK selector export or new authority path was found. (src/agents/provider-model-normalization.runtime.ts:24, 7b3fe8d25da2)
  • Focused regression coverage: Tests exercise normalizeModelRef, unused metadata reads, original getter receivers, invocation-local writes, reflection, deletion, and managed callback rejection after disposal. Bundled-directory cases retain mutable explicit/ambient environment fallback. Tests were inspected, not executed during this read-only review. (src/plugins/provider-registry-selection.test.ts:99, 7b3fe8d25da2)
  • Reported validation and bounded performance claims: The captured PR body reports 247 passing focused/sibling tests and original-code failures for the two unwanted reads. Its 10,000-call ABBA fixture measurements improve managed-hook time from 168.9 to 62.0 ms and managed-no-hook time from 121.4 to 23.7 ms; plain hooks increase from 20.4 to 25.6 ms. It explicitly does not claim deployed latency gains. (7b3fe8d25da2)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

@steipete
steipete merged commit 06ce6c4 into main Sep 21, 2026
192 checks passed
@steipete
steipete deleted the codex/team-provider-lookup-perf branch September 21, 2026 23:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
* fix(models): reduce repeated provider lookup overhead

* fix(models): avoid shadowed normalization bindings
steipete added a commit that referenced this pull request Sep 22, 2026
…dation (#155892)

## Problem

Full Release Validation run 35760444831 for 2026.9.6 fails two release-only lanes that regular PR CI never runs:

1. `checks-node-agentic-plugins` (Plugin Prerelease, `test/vitest/vitest.plugins.config.ts`): 12 files / 40 tests in `src/plugins/` fail with symptoms such as `Plugin fixture-speech capabilityCatalogEntry failed: Unexpected token 'export'`, `expected { values: [ undefined, 'javascript' ] } to match object { values: [ 'typescript', ... ] }`, and `expected undefined to be 'overloaded'`, alongside Node warnings `Failed to load the ES module: .../capability-catalog.js`.
2. `extensions shard 8`: `extensions/facetime/tests/package-manifest.test.ts` fails once the release version controller bumps the package to 2026.9.6 (`minHostVersion` expected `>=2026.9.6`, received `>=2026.9.4`).

## Root causes

**Plugins shard.** #153508 added a `--import tsx/esm` `execArgv` preload to every Node Vitest fork worker (`test/vitest/vitest.shared.config.ts`). The `src/plugins` suites exercise the plugin loader's own native `require()`/`import()` of `.ts`/`.js` fixtures (TS/JS peers, CJS/ESM interop, built capability catalogs, public surfaces). With the tsx hooks installed in the worker, Node's own module semantics under test change: a `.ts` peer in a `commonjs` package requires as an empty namespace, ESM `.js` catalogs in fixture packages fall through the CJS path, and loader ownership assertions fail. The shard is `RELEASE_ONLY_PLUGIN_SHARDS`, so the breakage surfaced only in Full Release Validation. A standalone probe (`createRequire(...)("./native.cjs")` requiring `peer.ts` + `peer.js`) returns `["typescript","javascript"]` on plain Node 24 and 26 and `[null,"javascript"]` with `--import scripts/tsx.mjs`.

**FaceTime manifest.** #155818 derived every host-contract field from `package.json#version`, but `scripts/sync-plugin-versions.ts` deliberately leaves `openclaw.install.minHostVersion` alone ("a compatibility floor, not release alignment metadata") while rewriting `peerDependencies.openclaw`, `compat.pluginApi`, and `build.openclawVersion`. The derived expectation therefore breaks on every release bump.

## Solution

- `test/vitest/vitest.scoped-config.ts`: accept an `execArgv` override.
- `test/vitest/vitest.plugins.config.ts`: split the shard into two inline projects (same pattern as `vitest.gateway-server.config.ts`): `plugins` keeps the shared preload (its suites load bundled plugins from source and need tsx's `.js` to `.ts` SDK resolution), and `plugins-native-loader` runs the eight loader-semantics suites (`plugin-module-generation*`, `capability-provider-runtime.generation`, `bundled-plugin-metadata.public-surfaces`, `manifest-registry`, `public-surface-loader`, `plugin-runtime-artifact-resolution`, `stage-bundled-plugin-runtime`) with `execArgv: []`. The root config keeps the complete inventory so planner discovery and `--project` routing are unchanged.
- `extensions/facetime/tests/package-manifest.test.ts`: expect the literal `>=2026.9.4` floor for `install.minHostVersion`; the controller-synced fields stay derived from the package version.

## Impact

Release-only validation lanes match what the runtime does in production for the loader suites (no tsx hooks in a Gateway process). No product code changes. Regular CI shards are unaffected; only the eight native-loader suites drop the preload.

## Evidence

- Baseline, exact job command (`pnpm test -- test/vitest/vitest.plugins.config.ts --`, Node 24.21.0, `OPENCLAW_VITEST_MAX_WORKERS=2`): 13 failed files / 41 failed tests (CI's 12 plus `plugin-graceful-init-failure`), matching FRV run 35760444831 job `checks-node-agentic-plugins` (also red in runs 35743778013 and 35761282770).
- Planner/routing owners with the split config: `test/scripts/ci-node-test-plan.test.ts`, `test-projects.test.ts`, `test-projects-routing.test.ts`, `plugin-prerelease-test-plan.test.ts`: 1811/1811 pass.
- Fixed, same command and Node: 5 failed files / 10 failed tests, 375 passed files / 6101 passed tests. All eight loader-semantics files are green. Dropping the preload for the whole shard instead (probe run) fixes the same eight files but breaks 11 other files on `Cannot find module '.../src/agents/defaults.js' imported from .../src/plugin-sdk/provider-model-metadata.ts`, which is why the shard is split rather than de-preloaded.
- Remaining red files are independent of the preload (identical failures with and without it, and with `providers.runtime-core.ts`, `provider-hook-runtime-core.ts`, `plugin-instance*.ts`, `host-hook-state.ts` reverted to their pre-#155711/#155250/#154625/#155714 versions): `provider-runtime.test.ts` (6: `resolveProviderPluginsForHooks`/`classifyProviderFailoverSignalWithPlugin` no longer read the `withPluginRuntimeRegistryScope` registry), `native-session-catalog-registration.test.ts` (1: abort surfaces `PluginInstanceUnavailableError` instead of the caller's retirement error), `plugin-instance-invocation.test.ts` (1), `provider-public-artifacts.test.ts` (1: listener count after bundled policy load), `plugin-graceful-init-failure.test.ts` (1: `Maximum call stack size exceeded`, local only). These are product/test contract drift from the plugin runtime refactors and need their owners; they are called out in the landing report.
- `extensions/facetime/tests/package-manifest.test.ts`: 2/2 pass at 2026.9.4 and 2/2 pass after a local `pnpm release:prepare -- --version 2026.9.6 --write` (bump reverted, not committed).
- `OPENCLAW_TESTBOX=1 pnpm check:changed`: in progress at PR creation; result recorded in the landing report.

Co-authored-by: Peter Steinberger <[email protected]>
steipete added a commit that referenced this pull request Sep 22, 2026
…dation (#155892)

## Problem

Full Release Validation run 35760444831 for 2026.9.6 fails two release-only lanes that regular PR CI never runs:

1. `checks-node-agentic-plugins` (Plugin Prerelease, `test/vitest/vitest.plugins.config.ts`): 12 files / 40 tests in `src/plugins/` fail with symptoms such as `Plugin fixture-speech capabilityCatalogEntry failed: Unexpected token 'export'`, `expected { values: [ undefined, 'javascript' ] } to match object { values: [ 'typescript', ... ] }`, and `expected undefined to be 'overloaded'`, alongside Node warnings `Failed to load the ES module: .../capability-catalog.js`.
2. `extensions shard 8`: `extensions/facetime/tests/package-manifest.test.ts` fails once the release version controller bumps the package to 2026.9.6 (`minHostVersion` expected `>=2026.9.6`, received `>=2026.9.4`).

## Root causes

**Plugins shard.** #153508 added a `--import tsx/esm` `execArgv` preload to every Node Vitest fork worker (`test/vitest/vitest.shared.config.ts`). The `src/plugins` suites exercise the plugin loader's own native `require()`/`import()` of `.ts`/`.js` fixtures (TS/JS peers, CJS/ESM interop, built capability catalogs, public surfaces). With the tsx hooks installed in the worker, Node's own module semantics under test change: a `.ts` peer in a `commonjs` package requires as an empty namespace, ESM `.js` catalogs in fixture packages fall through the CJS path, and loader ownership assertions fail. The shard is `RELEASE_ONLY_PLUGIN_SHARDS`, so the breakage surfaced only in Full Release Validation. A standalone probe (`createRequire(...)("./native.cjs")` requiring `peer.ts` + `peer.js`) returns `["typescript","javascript"]` on plain Node 24 and 26 and `[null,"javascript"]` with `--import scripts/tsx.mjs`.

**FaceTime manifest.** #155818 derived every host-contract field from `package.json#version`, but `scripts/sync-plugin-versions.ts` deliberately leaves `openclaw.install.minHostVersion` alone ("a compatibility floor, not release alignment metadata") while rewriting `peerDependencies.openclaw`, `compat.pluginApi`, and `build.openclawVersion`. The derived expectation therefore breaks on every release bump.

## Solution

- `test/vitest/vitest.scoped-config.ts`: accept an `execArgv` override.
- `test/vitest/vitest.plugins.config.ts`: split the shard into two inline projects (same pattern as `vitest.gateway-server.config.ts`): `plugins` keeps the shared preload (its suites load bundled plugins from source and need tsx's `.js` to `.ts` SDK resolution), and `plugins-native-loader` runs the eight loader-semantics suites (`plugin-module-generation*`, `capability-provider-runtime.generation`, `bundled-plugin-metadata.public-surfaces`, `manifest-registry`, `public-surface-loader`, `plugin-runtime-artifact-resolution`, `stage-bundled-plugin-runtime`) with `execArgv: []`. The root config keeps the complete inventory so planner discovery and `--project` routing are unchanged.
- `extensions/facetime/tests/package-manifest.test.ts`: expect the literal `>=2026.9.4` floor for `install.minHostVersion`; the controller-synced fields stay derived from the package version.

## Impact

Release-only validation lanes match what the runtime does in production for the loader suites (no tsx hooks in a Gateway process). No product code changes. Regular CI shards are unaffected; only the eight native-loader suites drop the preload.

## Evidence

- Baseline, exact job command (`pnpm test -- test/vitest/vitest.plugins.config.ts --`, Node 24.21.0, `OPENCLAW_VITEST_MAX_WORKERS=2`): 13 failed files / 41 failed tests (CI's 12 plus `plugin-graceful-init-failure`), matching FRV run 35760444831 job `checks-node-agentic-plugins` (also red in runs 35743778013 and 35761282770).
- Planner/routing owners with the split config: `test/scripts/ci-node-test-plan.test.ts`, `test-projects.test.ts`, `test-projects-routing.test.ts`, `plugin-prerelease-test-plan.test.ts`: 1811/1811 pass.
- Fixed, same command and Node: 5 failed files / 10 failed tests, 375 passed files / 6101 passed tests. All eight loader-semantics files are green. Dropping the preload for the whole shard instead (probe run) fixes the same eight files but breaks 11 other files on `Cannot find module '.../src/agents/defaults.js' imported from .../src/plugin-sdk/provider-model-metadata.ts`, which is why the shard is split rather than de-preloaded.
- Remaining red files are independent of the preload (identical failures with and without it, and with `providers.runtime-core.ts`, `provider-hook-runtime-core.ts`, `plugin-instance*.ts`, `host-hook-state.ts` reverted to their pre-#155711/#155250/#154625/#155714 versions): `provider-runtime.test.ts` (6: `resolveProviderPluginsForHooks`/`classifyProviderFailoverSignalWithPlugin` no longer read the `withPluginRuntimeRegistryScope` registry), `native-session-catalog-registration.test.ts` (1: abort surfaces `PluginInstanceUnavailableError` instead of the caller's retirement error), `plugin-instance-invocation.test.ts` (1), `provider-public-artifacts.test.ts` (1: listener count after bundled policy load), `plugin-graceful-init-failure.test.ts` (1: `Maximum call stack size exceeded`, local only). These are product/test contract drift from the plugin runtime refactors and need their owners; they are called out in the landing report.
- `extensions/facetime/tests/package-manifest.test.ts`: 2/2 pass at 2026.9.4 and 2/2 pass after a local `pnpm release:prepare -- --version 2026.9.6 --write` (bump reverted, not committed).
- `OPENCLAW_TESTBOX=1 pnpm check:changed`: in progress at PR creation; result recorded in the landing report.

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…dation (openclaw#155892)

## Problem

Full Release Validation run 35760444831 for 2026.9.6 fails two release-only lanes that regular PR CI never runs:

1. `checks-node-agentic-plugins` (Plugin Prerelease, `test/vitest/vitest.plugins.config.ts`): 12 files / 40 tests in `src/plugins/` fail with symptoms such as `Plugin fixture-speech capabilityCatalogEntry failed: Unexpected token 'export'`, `expected { values: [ undefined, 'javascript' ] } to match object { values: [ 'typescript', ... ] }`, and `expected undefined to be 'overloaded'`, alongside Node warnings `Failed to load the ES module: .../capability-catalog.js`.
2. `extensions shard 8`: `extensions/facetime/tests/package-manifest.test.ts` fails once the release version controller bumps the package to 2026.9.6 (`minHostVersion` expected `>=2026.9.6`, received `>=2026.9.4`).

## Root causes

**Plugins shard.** openclaw#153508 added a `--import tsx/esm` `execArgv` preload to every Node Vitest fork worker (`test/vitest/vitest.shared.config.ts`). The `src/plugins` suites exercise the plugin loader's own native `require()`/`import()` of `.ts`/`.js` fixtures (TS/JS peers, CJS/ESM interop, built capability catalogs, public surfaces). With the tsx hooks installed in the worker, Node's own module semantics under test change: a `.ts` peer in a `commonjs` package requires as an empty namespace, ESM `.js` catalogs in fixture packages fall through the CJS path, and loader ownership assertions fail. The shard is `RELEASE_ONLY_PLUGIN_SHARDS`, so the breakage surfaced only in Full Release Validation. A standalone probe (`createRequire(...)("./native.cjs")` requiring `peer.ts` + `peer.js`) returns `["typescript","javascript"]` on plain Node 24 and 26 and `[null,"javascript"]` with `--import scripts/tsx.mjs`.

**FaceTime manifest.** openclaw#155818 derived every host-contract field from `package.json#version`, but `scripts/sync-plugin-versions.ts` deliberately leaves `openclaw.install.minHostVersion` alone ("a compatibility floor, not release alignment metadata") while rewriting `peerDependencies.openclaw`, `compat.pluginApi`, and `build.openclawVersion`. The derived expectation therefore breaks on every release bump.

## Solution

- `test/vitest/vitest.scoped-config.ts`: accept an `execArgv` override.
- `test/vitest/vitest.plugins.config.ts`: split the shard into two inline projects (same pattern as `vitest.gateway-server.config.ts`): `plugins` keeps the shared preload (its suites load bundled plugins from source and need tsx's `.js` to `.ts` SDK resolution), and `plugins-native-loader` runs the eight loader-semantics suites (`plugin-module-generation*`, `capability-provider-runtime.generation`, `bundled-plugin-metadata.public-surfaces`, `manifest-registry`, `public-surface-loader`, `plugin-runtime-artifact-resolution`, `stage-bundled-plugin-runtime`) with `execArgv: []`. The root config keeps the complete inventory so planner discovery and `--project` routing are unchanged.
- `extensions/facetime/tests/package-manifest.test.ts`: expect the literal `>=2026.9.4` floor for `install.minHostVersion`; the controller-synced fields stay derived from the package version.

## Impact

Release-only validation lanes match what the runtime does in production for the loader suites (no tsx hooks in a Gateway process). No product code changes. Regular CI shards are unaffected; only the eight native-loader suites drop the preload.

## Evidence

- Baseline, exact job command (`pnpm test -- test/vitest/vitest.plugins.config.ts --`, Node 24.21.0, `OPENCLAW_VITEST_MAX_WORKERS=2`): 13 failed files / 41 failed tests (CI's 12 plus `plugin-graceful-init-failure`), matching FRV run 35760444831 job `checks-node-agentic-plugins` (also red in runs 35743778013 and 35761282770).
- Planner/routing owners with the split config: `test/scripts/ci-node-test-plan.test.ts`, `test-projects.test.ts`, `test-projects-routing.test.ts`, `plugin-prerelease-test-plan.test.ts`: 1811/1811 pass.
- Fixed, same command and Node: 5 failed files / 10 failed tests, 375 passed files / 6101 passed tests. All eight loader-semantics files are green. Dropping the preload for the whole shard instead (probe run) fixes the same eight files but breaks 11 other files on `Cannot find module '.../src/agents/defaults.js' imported from .../src/plugin-sdk/provider-model-metadata.ts`, which is why the shard is split rather than de-preloaded.
- Remaining red files are independent of the preload (identical failures with and without it, and with `providers.runtime-core.ts`, `provider-hook-runtime-core.ts`, `plugin-instance*.ts`, `host-hook-state.ts` reverted to their pre-openclaw#155711/openclaw#155250/openclaw#154625/openclaw#155714 versions): `provider-runtime.test.ts` (6: `resolveProviderPluginsForHooks`/`classifyProviderFailoverSignalWithPlugin` no longer read the `withPluginRuntimeRegistryScope` registry), `native-session-catalog-registration.test.ts` (1: abort surfaces `PluginInstanceUnavailableError` instead of the caller's retirement error), `plugin-instance-invocation.test.ts` (1), `provider-public-artifacts.test.ts` (1: listener count after bundled policy load), `plugin-graceful-init-failure.test.ts` (1: `Maximum call stack size exceeded`, local only). These are product/test contract drift from the plugin runtime refactors and need their owners; they are called out in the landing report.
- `extensions/facetime/tests/package-manifest.test.ts`: 2/2 pass at 2026.9.4 and 2/2 pass after a local `pnpm release:prepare -- --version 2026.9.6 --write` (bump reverted, not committed).
- `OPENCLAW_TESTBOX=1 pnpm check:changed`: in progress at PR creation; result recorded in the landing report.

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant