Commit Graph
206 Commits
Author SHA1 Message Date
Peter Steinberger 4b2b261367 fix(plugins): preserve source activation config 2026-04-22 19:26:12 +01:00
Peter Steinberger 9d27d09d47 fix: add plugin load debug shape 2026-04-22 18:31:37 +01:00
Peter Steinberger a2512f0243 fix: load staged dist-runtime plugins in docker 2026-04-22 18:22:39 +01:00
Vincent Koc 91ac485246 feat(tokenjuice): bundle the native adapter (#69946)
* feat(plugins): register embedded extension factories

* feat(tokenjuice): bundle the native adapter

* fix(tokenjuice): gate the bundled embedded extension seam

* fix(tokenjuice): refresh runtime sidecar baseline

* fix(plugins): harden bundled embedded extensions

* fix(plugins): install source bundled runtime deps

* fix(tokenjuice): sync lockfile importer

* fix(plugins): validate reused runtime dep versions

* fix(plugins): restore tokenjuice CI contract

* fix(plugins): remove tokenjuice dts bridge

* fix(tokenjuice): repair openclaw type shim

* fix(plugins): harden bundled runtime deps

* fix(plugins): keep source checkout runtime deps local

* fix(plugins): isolate bundled runtime dep installs

* fix(cli): keep plugin startup registration non-activating

* fix(cli): keep loader overrides out of plugin cli options
2026-04-21 23:58:37 -07:00
Peter Steinberger a99490fba4 fix(plugins): support root-owned bundled runtime deps 2026-04-22 05:02:35 +01:00
Gustavo Madeira Santana 24db09a19b fix(cli): keep channel status checks off plugin runtimes (#69479)
Merged via squash.

Prepared head SHA: 63f6e416a900bee095128f2ab09d03a6f6ddb4c7
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-21 13:53:08 -04:00
Alex Knight 4407df6c03 perf(plugin-sdk): per-phase + per-jiti-call probes for bundled channel entries (#69537)
* perf(plugin-sdk): per-phase + per-jiti-call probes for bundled channel entries

Extends the existing OPENCLAW_PLUGIN_LOAD_PROFILE infrastructure (see
src/plugins/loader.ts `profilePluginLoaderSync` and src/plugins/source-loader.ts)
with two new probe sites inside src/plugin-sdk/channel-entry-contract.ts:

1. `bundled-register:<phase>` — wraps each phase of `defineBundledChannelEntry`'s
   register() callback (`setChannelRuntime`, `loadChannelPlugin`, `registerChannel`,
   `registerCliMetadata`, `registerFull`). Lets us pinpoint which phase of plugin
   registration is responsible for cold-start cost on a per-plugin basis.

2. `bundled-entry-module-load` — instruments `loadBundledEntryModuleSync` and
   reports `getJitiMs` (jiti loader factory) vs `jitiCallMs` (actual graph walk
   + transpile + ESM linking) separately. Lets us distinguish alias-map / loader
   setup overhead from import-graph traversal cost on a per-module basis.

Both probes are gated on OPENCLAW_PLUGIN_LOAD_PROFILE=1 and have zero overhead
when the env flag is unset (early return before any `performance.now()` call).
Log format matches the existing `[plugin-load-profile]` line shape so existing
log scrapers continue to work.

The helper is a file-local mirror of `profilePluginLoaderSync` rather than a
new SDK export — keeps the SDK boundary narrow per src/plugin-sdk/AGENTS.md
and avoids cross-importing host internals.

Used to validate PR #69317 (slack startup perf) — measurements showed slack
`setChannelRuntime` dropping from 13183ms to 67ms after barrel narrowing,
which would have been undiagnosable without these per-phase probes.

* perf(plugins): per-plugin register() probe in plugin loader

Adds a `phase=${registrationMode}:register` probe wrapping each call to
`runPluginRegisterSync(register, api)` in src/plugins/loader.ts. Emits the
established `[plugin-load-profile]` line shape via `profilePluginLoaderSync`,
gated on OPENCLAW_PLUGIN_LOAD_PROFILE=1.

Two call sites are wrapped:
- The main load path (registrationMode is dynamic: "snapshot", "validate",
  "full") at the post-snapshot register block. Emits e.g.
  `phase=full:register plugin=slack elapsedMs=14102.1 source=...`
- The cli-metadata-only path (registrationMode hardcoded to "cli-metadata")
  for fast `--metadata` boot flows.

Together with the existing `phase=full` (entire load) and `phase=source-loader`
probes plus the `bundled-register:*` and `bundled-entry-module-load` probes
added in the previous commit, this gives a full breakdown:

- `phase=full plugin=slack` — total cost from import through register return
- `phase=full:register plugin=slack` — just the register() callback (NEW)
- `phase=bundled-register:setChannelRuntime plugin=slack` — sub-phase
- `phase=bundled-register:loadChannelPlugin plugin=slack` — sub-phase
- `phase=bundled-entry-module-load plugin=(bundled-entry)` — per-module load

Lets you `sort -k4 -n -r` the log output to find the slowest plugin's
register() call across all bundled+third-party plugins, then drill in via
the sub-phase probes for bundled entries.

* perf(plugins): consolidate plugin-load-profile primitives in shared module

Extracts the previously duplicated `shouldProfilePluginLoader` /
`profilePluginLoaderSync` helpers into a new `src/plugins/plugin-load-profile.ts`
module. Removes 3 file-local copies of the same env-flag check and 2
near-duplicate `try { run() } finally { console.error(...) }` wrappers.

Files updated:
- NEW src/plugins/plugin-load-profile.ts — sole owner of:
    shouldProfilePluginLoader()
    profilePluginLoaderSync<T>({phase, pluginId?, source, run, extras?})
    formatPluginLoadProfileLine({phase, pluginId?, source, elapsedMs, extras?})
- src/plugins/loader.ts — drop file-local copies, import shared helper
  (existing 4 + new 2 call sites unchanged in shape)
- src/plugins/source-loader.ts — drop renamed local copy
  (`shouldProfilePluginSourceLoader`), use shared helper with
  `pluginId: "(direct)"` to preserve the existing `plugin=(direct)` field
- src/plugin-sdk/channel-entry-contract.ts — drop file-local copies and
  inline `profileStep` closure; use shared `profilePluginLoaderSync` directly
  at all 5 `bundled-register:*` call sites; dual-timing
  `bundled-entry-module-load` probe uses `formatPluginLoadProfileLine` with
  ordered `extras` for `getJitiMs`/`jitiCallMs`

Log line format is byte-for-byte identical to before (validated against
3 cases: standard, with pluginId, dual-timing). The `extras` API is
intentionally an ordered tuple list (not a record) so that scrapers see
deterministic field order between `elapsedMs=` and `source=`.

Net: +155/-87 lines across 4 files, removing ~60 lines of duplication
while exposing a stable, documented probe surface.

Verified:
- pnpm tsgo (core) — 0 errors
- pnpm lint on all 4 files — 0 warnings, 0 errors
- pnpm test src/plugins/loader.test.ts — 102/102
- pnpm test src/plugins/contracts/plugin-entry-guardrails.test.ts — 7/7
- pnpm test src/plugin-sdk/channel-entry-contract.test.ts — 4/4
- Standalone formatter smoke test — output matches existing format byte-for-byte

* refactor(plugins): rename profilePluginLoaderSync to withProfile and bind scope at register sites

* fix(plugin-sdk): zero jiti sub-step timings on Win32 nodeRequire fast-path
2026-04-21 22:06:13 +10:00
Peter Steinberger 8bb4dd7d08 fix: quiet bundled plugin runtime dep repairs 2026-04-21 05:36:09 +01:00
Edward Abrams 8595e6c872 fix(plugins): preserve memory capability across snapshot plugin loads
Preserve the active memory capability when non-activating plugin snapshot loads run, and add a regression test.\n\nThanks @zeroaltitude.
2026-04-20 20:43:08 +01:00
Peter Steinberger f76b426e2b perf: reduce jiti loader alias work 2026-04-20 18:06:45 +01:00
Peter Steinberger 47d42606ac fix: repair bundled plugin runtime deps on startup 2026-04-20 17:47:55 +01:00
Mariano bd3ad3436e tasks: add detached runtime plugin registration contract (#68915)
* tasks: register detached runtime plugins

* tasks: harden detached runtime ownership

* tasks: extract detached runtime contract types

* changelog: note detached runtime contract

* changelog: attribute detached runtime contract
2026-04-19 13:13:11 +02:00
Ayaan Zaidi c95507978f fix(plugins): tighten register rollback 2026-04-17 10:14:00 +05:30
Ayaan Zaidi e8fd148437 fix(plugins): roll back failed register side effects 2026-04-17 10:14:00 +05:30
Ayaan Zaidi 2a283e87a7 fix(plugins): enforce synchronous registration 2026-04-17 10:14:00 +05:30
Gustavo Madeira Santana 78ac118427 fix(plugins): stabilize bundled setup runtimes (#67200)
Merged via squash.

Prepared head SHA: e8d6738fd08d850f1685c8f14d4c6df39ba2d34e
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-15 12:35:18 -04:00
Vincent Koc f366c38df8 fix(plugins): share loader jiti cache overrides 2026-04-14 17:07:41 +01:00
Mason Huang 1558a352f8 fix(plugins): support bundled setup-entry contract in loader (#66261)
Merged via squash.

Prepared head SHA: 0a4201115c9a13767e8f7d1f7b3ff00743646463
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
2026-04-14 22:51:22 +08:00
Brian 143c1e81a2 fix(plugins): treat context-engine plugins as capabilities in status/inspect (#58766)
Merged via squash.

Prepared head SHA: 23269d2db53e43540fdd23c617280e73edc1ce50
Co-authored-by: zhuisDEV <95547369+zhuisDEV@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-13 07:32:24 -07:00
pradeep7127andVincent Koc 5fde14b844 fix(plugins): exempt dreaming engine from memory slot fast-path in loader (#65411)
* fix(plugins): exempt dreaming engine from memory slot fast-path in loader

* fix(plugins): handle dreaming engine as slot + add tests for slot coexistence

* fix(plugins): narrow dreaming sidecar loading

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-12 16:41:25 +01:00
Vincent Koc 6a189eec0b fix(plugins): centralize explicit plugin scope handling (#65298)
* fix(plugins): centralize explicit plugin scope handling

* fix(plugins): preserve explicit empty web scopes

* fix(plugins): preserve runtime web provider scopes without config

* fix(plugins): preserve web provider runtime filtering

* fix(plugins): preserve scoped web runtime fallback

* fix(plugins): harden plugin scope normalization
2026-04-12 16:16:37 +01:00
Sergio Cadavid 8f156df4ac fix(plugins): restore cached memory capability on cache hits (#65240)
Merged via squash.

Prepared head SHA: 4209f056a1d1f497f0816614f79f60488e8e1d17
Co-authored-by: sercada <24389792+sercada@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-04-12 11:54:55 +01:00
Vincent Koc a5689accc4 fix(plugins): preserve empty provider scopes 2026-04-12 11:04:58 +01:00
Tak Hoffman 49b42b4a45 fix(release): handle nested default-wrapped bundled channel entries 2026-04-11 11:36:44 -05:00
Vincent Koc 74e7b8d47b fix(cycles): bulk extract leaf type surfaces 2026-04-11 13:26:50 +01:00
Vincent Koc 7308e72fac fix(cycles): continue seam extraction 2026-04-11 10:43:22 +01:00
Vincent Koc 7198a9f0ee fix(cycles): reduce remaining static import seams 2026-04-11 02:46:41 +01:00
Peter Steinberger 44ec4d05de feat: add pluggable agent harness registry 2026-04-10 21:22:16 +01:00
Peter Steinberger fbbd644d7a plugins: load lightweight provider discovery entries 2026-04-09 00:33:33 +01:00
Peter Steinberger 4cfa4b95c3 refactor: dedupe plugin trimmed readers 2026-04-08 01:36:38 +01:00
DhruvBhatia0andjalehman 12331f0463 feat: add pluggable compaction provider registry (#56224)
Merged via squash.

Prepared head SHA: 0cc9cf3f30972ad86914ec9d439b3e68591e7130
Co-authored-by: DhruvBhatia0 <69252327+DhruvBhatia0@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-07 10:55:34 -07:00
Peter Steinberger 8c38c662c1 perf(test): trim bundled facade hot paths 2026-04-07 00:59:49 +01:00
Peter Steinberger 510fca655a fix(plugins): avoid helper reentry loads 2026-04-06 18:20:33 +01:00
Peter Steinberger 7d9a6b5572 fix(plugins): detect reentrant plugin loads 2026-04-06 18:05:33 +01:00
Peter Steinberger 725cbcc362 fix(plugins): narrow provider hook reentry guard 2026-04-06 17:57:49 +01:00
Peter Steinberger fa67ab2358 fix: preserve gateway-bindable loader compatibility 2026-04-06 15:28:41 +01:00
HansY c78defdc2f plugins: exclude runtimeSubagentMode from loader cache key
The plugin loader cache key included runtimeSubagentMode, which is
derived from allowGatewaySubagentBinding. Since different call sites in
the message processing pipeline pass different values for this flag,
each call produced a distinct cache key, triggering redundant
register() calls (40+ in 24 seconds after startup).

runtimeSubagentMode does not affect which plugins are loaded or how
they are configured — it is only metadata stored alongside the active
registry state. Removing it from the cache key lets all call sites
share the same cached registry regardless of their binding mode.

Fixes #61756
2026-04-06 15:28:41 +01:00
Peter Steinberger c39f061003 Revert "refactor(cli): remove bundled cli text providers"
This reverts commit 05d351c430.
2026-04-06 13:40:41 +01:00
Peter Steinberger 7f11941134 fix(windows): preserve plugin loader alias resolution (#61832) (thanks @Zeesejo)
# Conflicts:
#	CHANGELOG.md
#	src/plugins/loader.ts
2026-04-06 13:01:51 +01:00
Vincent Koc 5716d83336 feat(memory-wiki): restore llm wiki stack 2026-04-06 04:56:52 +01:00
Peter Steinberger dc0ee2e178 feat: add music generation tooling 2026-04-06 01:47:14 +01:00
Peter Steinberger 471d056e2f refactor: move browser runtime seams behind plugin metadata 2026-04-05 23:13:14 +01:00
Vincent Koc 94256ea1a0 revert(memory-wiki): back out llm wiki stack 2026-04-05 22:44:20 +01:00
Vincent Koc 2f72363984 feat(memory-core): bridge wiki corpus into memory tools 2026-04-05 22:34:02 +01:00
Vincent Koc c11e7a7420 feat(memory-wiki): add prompt supplement integration 2026-04-05 22:34:01 +01:00
Peter Steinberger 05d351c430 refactor(cli): remove bundled cli text providers 2026-04-05 18:46:36 +01:00
Gustavo Madeira Santanaandgumadeiras 8d3e557fc4 Plugins: suppress trust warning noise in snapshot loads (#61427)
Merged via squash.

Prepared head SHA: a3f484bebdb20be882c1ded6008d37eb45fa284e
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-05 13:08:43 -04:00
Peter Steinberger 629baf5fa7 refactor: move plugin setup and memory capabilities to registries 2026-04-05 14:53:53 +01:00
Jamil ZakirovandVincent Koc ffb5b99114 fix: propagate workspaceDir to snapshot plugin loads (#61138)
* plugins: include resolved workspaceDir in provider hook cache keys

resolveProviderPluginsForHooks, resolveProviderPluginsForCatalogHooks, and
resolveProviderRuntimePlugin used the raw params.workspaceDir for cache keys
and plugin-id discovery while resolvePluginProviders already fell back to
the active registry workspace. Resolve workspaceDir once at the top of each
function so cache keys, candidate filtering, and loading all use the same
workspace root.

* fix(plugins): inherit runtime workspace for snapshot loads

* test(gateway): stub runtime registry seam

* fix(plugins): restore workspace fallback after rebase

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-05 09:03:54 +01:00
Peter Steinberger e3ac0f43df feat(qwen): add qwen provider and video generation 2026-04-04 19:34:56 +01:00