mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:30:42 +00:00
fix(config): keep command alias validation cold
This commit is contained in:
@@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Plugins/compat: mark `OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY` as a deprecated break-glass switch and point operators at registry repair instead. Thanks @vincentkoc.
|
||||
- Plugins/compat: expand the central compatibility registry with dated owners, replacements, and removal targets for legacy SDK, manifest, setup, registry-migration, and agent-runtime surfaces. Thanks @vincentkoc.
|
||||
- Plugins/registry: ignore stale persisted registry reads when plugin policy no longer matches current config, and stamp generated registry files with a do-not-edit warning. Thanks @vincentkoc.
|
||||
- Config/plugins: keep plugin command-alias validation on cold manifest metadata instead of importing the runtime alias resolver. Thanks @vincentkoc.
|
||||
- Diagnostics/OTEL: surface provider request identifiers as bounded hashes on model-call diagnostics and span events, without exporting raw request IDs or metric labels. Thanks @Lidang-Jiang and @vincentkoc.
|
||||
- Plugins/diagnostics: add metadata-only `model_call_started` and `model_call_ended` hooks for provider/model call telemetry without exposing prompts, responses, headers, request bodies, or raw provider request IDs. Thanks @vincentkoc.
|
||||
- Diagnostics/OTEL: emit bounded context assembly diagnostics and export `openclaw.context.assembled` spans with prompt/history sizes but no prompt, history, response, or session-key content. Thanks @vincentkoc.
|
||||
|
||||
@@ -14,10 +14,6 @@ vi.mock("../plugin-sdk/telegram-command-config.js", () => ({
|
||||
resolveTelegramCustomCommands: () => ({ commands: [], issues: [] }),
|
||||
}));
|
||||
|
||||
vi.mock("../plugins/manifest-command-aliases.runtime.js", () => ({
|
||||
resolveManifestCommandAliasOwner: () => undefined,
|
||||
}));
|
||||
|
||||
const getScopedWebSearchCredential = (key: string) => (search?: Record<string, unknown>) =>
|
||||
(search?.[key] as { apiKey?: unknown } | undefined)?.apiKey;
|
||||
const getConfiguredPluginWebSearchConfig =
|
||||
|
||||
16
src/config/validation.cold-imports.test.ts
Normal file
16
src/config/validation.cold-imports.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const repoRoot = fileURLToPath(new URL("../..", import.meta.url));
|
||||
|
||||
describe("config validation cold imports", () => {
|
||||
it("keeps validation command-alias guidance on manifest metadata", () => {
|
||||
const source = fs.readFileSync(path.join(repoRoot, "src/config/validation.ts"), "utf8");
|
||||
|
||||
expect(source).not.toMatch(/\bfrom\s+["'][^"']*manifest-command-aliases\.runtime\.js["']/);
|
||||
expect(source).not.toMatch(/\bfrom\s+["'][^"']*providers\.runtime\.js["']/);
|
||||
expect(source).not.toMatch(/\bfrom\s+["'][^"']*loader\.js["']/);
|
||||
});
|
||||
});
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
collectRelevantDoctorPluginIdsForTouchedPaths,
|
||||
listPluginDoctorLegacyConfigRules,
|
||||
} from "../plugins/doctor-contract-registry.js";
|
||||
import { resolveManifestCommandAliasOwner } from "../plugins/manifest-command-aliases.runtime.js";
|
||||
import { resolveManifestCommandAliasOwnerInRegistry } from "../plugins/manifest-command-aliases.js";
|
||||
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
import { loadPluginManifestRegistryForPluginRegistry } from "../plugins/plugin-registry.js";
|
||||
import { validateJsonSchemaValue } from "../plugins/schema-validator.js";
|
||||
@@ -1119,7 +1119,7 @@ function validateConfigObjectWithPluginsBase(
|
||||
continue;
|
||||
}
|
||||
if (!knownIds.has(pluginId)) {
|
||||
const commandAlias = resolveManifestCommandAliasOwner({
|
||||
const commandAlias = resolveManifestCommandAliasOwnerInRegistry({
|
||||
command: pluginId,
|
||||
registry,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user