refactor: simplify plugin auto-enable structure

This commit is contained in:
Peter Steinberger
2026-04-05 09:33:57 +01:00
parent 22db77d2b6
commit 1afa076cfa
13 changed files with 1894 additions and 1792 deletions

View File

@@ -23,7 +23,7 @@ import {
DEFAULT_DANGEROUS_NODE_COMMANDS,
resolveNodeCommandAllowlist,
} from "../gateway/node-command-policy.js";
import { hasBundledWebSearchCredential } from "../plugins/bundled-web-search-registry.js";
import { hasConfiguredWebSearchCredential } from "../plugins/web-search-credential-presence.js";
import { inferParamBFromIdOrName } from "../shared/model-param-b.js";
import { pickSandboxToolPolicy } from "./audit-tool-policy.js";
@@ -326,7 +326,12 @@ function resolveToolPolicies(params: {
}
function hasWebSearchKey(cfg: OpenClawConfig, env: NodeJS.ProcessEnv): boolean {
return hasBundledWebSearchCredential({ config: cfg, env });
return hasConfiguredWebSearchCredential({
config: cfg,
env,
origin: "bundled",
bundledAllowlistCompat: true,
});
}
function isWebSearchEnabled(cfg: OpenClawConfig, env: NodeJS.ProcessEnv): boolean {