mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 05:01:15 +00:00
perf(test): trim bundled facade hot paths
This commit is contained in:
@@ -2814,38 +2814,6 @@ module.exports = {
|
||||
expectSetupLoaded: true,
|
||||
expectedChannels: 1,
|
||||
},
|
||||
{
|
||||
name: "can prefer setupEntry for configured channel loads during startup",
|
||||
fixture: {
|
||||
id: "setup-runtime-preferred-test",
|
||||
label: "Setup Runtime Preferred Test",
|
||||
packageName: "@openclaw/setup-runtime-preferred-test",
|
||||
fullBlurb: "full entry should be deferred while startup is still cold",
|
||||
setupBlurb: "setup runtime preferred",
|
||||
configured: true,
|
||||
startupDeferConfiguredChannelFullLoadUntilAfterListen: true,
|
||||
},
|
||||
load: ({ pluginDir }: { pluginDir: string }) =>
|
||||
loadOpenClawPlugins({
|
||||
cache: false,
|
||||
preferSetupRuntimeForChannelPlugins: true,
|
||||
config: {
|
||||
channels: {
|
||||
"setup-runtime-preferred-test": {
|
||||
enabled: true,
|
||||
token: "configured",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
load: { paths: [pluginDir] },
|
||||
allow: ["setup-runtime-preferred-test"],
|
||||
},
|
||||
},
|
||||
}),
|
||||
expectFullLoaded: false,
|
||||
expectSetupLoaded: true,
|
||||
expectedChannels: 1,
|
||||
},
|
||||
{
|
||||
name: "does not prefer setupEntry for configured channel loads without startup opt-in",
|
||||
fixture: {
|
||||
@@ -2887,6 +2855,26 @@ module.exports = {
|
||||
expect(registry.channels).toHaveLength(expectedChannels);
|
||||
});
|
||||
|
||||
it("prefers setupEntry for configured channel loads during startup when opted in", () => {
|
||||
expect(
|
||||
__testing.shouldLoadChannelPluginInSetupRuntime({
|
||||
manifestChannels: ["setup-runtime-preferred-test"],
|
||||
setupSource: "./setup-entry.cjs",
|
||||
startupDeferConfiguredChannelFullLoadUntilAfterListen: true,
|
||||
cfg: {
|
||||
channels: {
|
||||
"setup-runtime-preferred-test": {
|
||||
enabled: true,
|
||||
token: "configured",
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {},
|
||||
preferSetupRuntimeForChannelPlugins: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("blocks before_prompt_build but preserves legacy model overrides when prompt injection is disabled", async () => {
|
||||
useNoBundledPlugins();
|
||||
const plugin = writePlugin({
|
||||
|
||||
@@ -248,6 +248,7 @@ export const __testing = {
|
||||
resolvePluginSdkAliasCandidateOrder,
|
||||
resolvePluginSdkAliasFile,
|
||||
resolvePluginRuntimeModulePath,
|
||||
shouldLoadChannelPluginInSetupRuntime,
|
||||
shouldPreferNativeJiti,
|
||||
toSafeImportPath,
|
||||
getCompatibleActivePluginRegistry,
|
||||
|
||||
Reference in New Issue
Block a user