fix(plugins): include selected context-engine slot plugin in gateway startup (#76576)#76636
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. from source inspection. Current main omits selected non-startup context-engine plugins from startup plugin ids, and the PR's #76598 path can still return a loaded-empty registry without reloading tool entries. Next step before merge Security Review findings
Review detailsBest possible solution: Land the #76576 startup-plan fix with its regression tests, and either correctly repair #76598 in the same branch or split/remove the tool fallback and changelog claim. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Current main omits selected non-startup context-engine plugins from startup plugin ids, and the PR's #76598 path can still return a loaded-empty registry without reloading tool entries. Is this the best way to solve the issue? No as submitted. The context-engine startup seam is the narrow maintainable fix for #76576, but the bundled #76598 change must reload loaded-empty registries or be removed from this PR. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 2b82c05a7fb1. |
326c63f to
8509f81
Compare
9d8a902 to
4d2e5af
Compare
…penclaw#76598) `resolvePluginTools` returned an empty tool list when no pre-warmed channel/active registry was found after startup — the on-demand fallback removed by PR openclaw#76004 was only added back for memory and capability-provider surfaces, leaving path-based (origin "config") plugin tool factories silent. Fix: when `resolvePluginToolRegistry` returns null, trigger a standalone registry load via `ensureStandaloneRuntimePluginRegistryLoaded`, then retry. Adds regression test asserting tools are resolved without pre-warming. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…startup (openclaw#76576) External context-engine plugins (e.g. lossless-claw) register via api.registerContextEngine at load time but ship without activation.onStartup in their manifest. The gateway startup planner only considered memory plugins and explicit sidecar plugins, so a selected non-legacy context engine was omitted from the startup load plan and never loaded before agent turns resolved the active engine, producing the "Context engine X is not registered; falling back to default engine legacy" warning. Fix: add resolveContextEngineSlotStartupPluginId mirroring the memory slot pattern; pass contextEngineSlotStartupPluginId into shouldConsiderForGatewayStartup so the selected context-engine plugin is included in pluginIds regardless of its manifest activation shape. Tests: added four regression cases covering include, exclude, legacy bypass, and id normalization. 82 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4d2e5af to
0db6c28
Compare
Root cause
resolveGatewayStartupPluginPlanFromRegistrybuilds the startup plugin set by filtering installed plugins. For memory plugins it usesshouldConsiderForGatewayStartupwhich checksactivation.onStartuporkind: "memory". External context-engine plugins (e.g.lossless-claw@0.9.2) havekind: "context-engine"but noactivation.onStartupin their manifest — they register viaapi.registerContextEngine()at load time. The planner skipped them, so the selected engine was never loaded before agent turns resolved the active engine, producing:Fix
Add
resolveContextEngineSlotStartupPluginIdmirroring the existingresolveMemorySlotStartupPluginIdpattern. PasscontextEngineSlotStartupPluginIdintoshouldConsiderForGatewayStartupso any plugin matchingplugins.slots.contextEngineis included in the gateway startup load plan regardless of its manifestactivationshape.Audit:
resolveMemorySlotStartupPluginIdis the existing helper — mirrored, not reused (different semantics: context engine has no built-in default override, no dreaming sub-case)shouldConsiderForGatewayStartuphas one non-test caller — change is purely additive, no contract changeTests
4 new cases in
channel-plugin-ids.test.ts:activation.onStartup(regression for [Bug]: Bug Report: Context engine plugin not registered despite being loaded #76576)"legacy"engine82/82 tests pass (
src/plugins/channel-plugin-ids.test.ts src/plugins/effective-plugin-ids.test.ts src/agents/runtime-plugins.test.ts).Fixes #76576. Thanks @hclsys.