

























@@ -47,6 +47,7 @@ type SetupAutoEnableProbeEntry = {
4747};
48484949export type PluginSetupRegistryDiagnosticCode =
50+| "setup-descriptor-runtime-disabled"
5051| "setup-descriptor-provider-missing-runtime"
5152| "setup-descriptor-provider-runtime-undeclared"
5253| "setup-descriptor-cli-backend-missing-runtime"
@@ -189,7 +190,10 @@ function buildSetupCliBackendCacheKey(params: {
189190});
190191}
191192192-function resolveSetupApiPath(rootDir: string): string | null {
193+function resolveSetupApiPath(
194+rootDir: string,
195+options?: { includeBundledSourceFallback?: boolean },
196+): string | null {
193197const orderedExtensions = RUNNING_FROM_BUILT_ARTIFACT
194198 ? SETUP_API_EXTENSIONS
195199 : ([...SETUP_API_EXTENSIONS.slice(3), ...SETUP_API_EXTENSIONS.slice(0, 3)] as const);
@@ -209,6 +213,10 @@ function resolveSetupApiPath(rootDir: string): string | null {
209213return direct;
210214}
211215216+if (options?.includeBundledSourceFallback === false) {
217+return null;
218+}
219+212220const bundledExtensionDir = path.basename(rootDir);
213221const repoRootCandidates = [path.resolve(path.dirname(CURRENT_MODULE_PATH), "..", "..")];
214222for (const repoRoot of repoRootCandidates) {
@@ -283,14 +291,27 @@ function resolveRegister(mod: OpenClawPluginModule): {
283291return {};
284292}
285293294+function resolveLoadableSetupRuntimeSource(record: PluginManifestRecord): string | null {
295+return record.setupSource ?? resolveSetupApiPath(record.rootDir);
296+}
297+298+function resolveDeclaredSetupRuntimeSource(record: PluginManifestRecord): string | null {
299+return (
300+record.setupSource ??
301+resolveSetupApiPath(record.rootDir, {
302+includeBundledSourceFallback: false,
303+})
304+);
305+}
306+286307function resolveSetupRegistration(record: PluginManifestRecord): {
287308setupSource: string;
288309register: (api: ReturnType<typeof buildPluginApi>) => void | Promise<void>;
289310} | null {
290311if (record.setup?.requiresRuntime === false) {
291312return null;
292313}
293-const setupSource = record.setupSource ?? resolveSetupApiPath(record.rootDir);
314+const setupSource = resolveLoadableSetupRuntimeSource(record);
294315if (!setupSource) {
295316return null;
296317}
@@ -399,6 +420,21 @@ function mapNormalizedIds(ids: readonly string[]): Map<string, string> {
399420return mapped;
400421}
401422423+function pushDescriptorRuntimeDisabledDiagnostic(params: {
424+record: PluginManifestRecord;
425+diagnostics: PluginSetupRegistryDiagnostic[];
426+}): void {
427+if (!resolveDeclaredSetupRuntimeSource(params.record)) {
428+return;
429+}
430+params.diagnostics.push({
431+pluginId: params.record.id,
432+code: "setup-descriptor-runtime-disabled",
433+message:
434+"setup.requiresRuntime is false, so OpenClaw ignored the plugin setup runtime entry. Remove setup-api/openclaw.setupEntry or set requiresRuntime true if setup lookup still needs plugin code.",
435+});
436+}
437+402438function pushSetupDescriptorDriftDiagnostics(params: {
403439record: PluginManifestRecord;
404440providers: readonly ProviderPlugin[];
@@ -504,6 +540,13 @@ export function resolvePluginSetupRegistry(params?: {
504540if (selectedPluginIds && !selectedPluginIds.has(record.id)) {
505541continue;
506542}
543+if (record.setup?.requiresRuntime === false) {
544+pushDescriptorRuntimeDisabledDiagnostic({
545+ record,
546+ diagnostics,
547+});
548+continue;
549+}
507550const setupRegistration = resolveSetupRegistration(record);
508551if (!setupRegistration) {
509552continue;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。