Skip to content

Commit 22044af

Browse files
committed
fix(config): keep command alias validation cold
1 parent a9d2433 commit 22044af

4 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai
6767
- Plugins/compat: mark `OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY` as a deprecated break-glass switch and point operators at registry repair instead. Thanks @vincentkoc.
6868
- 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.
6969
- 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.
70+
- Config/plugins: keep plugin command-alias validation on cold manifest metadata instead of importing the runtime alias resolver. Thanks @vincentkoc.
7071
- 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.
7172
- 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.
7273
- 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.

‎src/config/config.web-search-provider.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ vi.mock("../plugin-sdk/telegram-command-config.js", () => ({
1414
resolveTelegramCustomCommands: () => ({ commands: [], issues: [] }),
1515
}));
1616

17-
vi.mock("../plugins/manifest-command-aliases.runtime.js", () => ({
18-
resolveManifestCommandAliasOwner: () => undefined,
19-
}));
20-
2117
const getScopedWebSearchCredential = (key: string) => (search?: Record<string, unknown>) =>
2218
(search?.[key] as { apiKey?: unknown } | undefined)?.apiKey;
2319
const getConfiguredPluginWebSearchConfig =
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import { describe, expect, it } from "vitest";
5+
6+
const repoRoot = fileURLToPath(new URL("../..", import.meta.url));
7+
8+
describe("config validation cold imports", () => {
9+
it("keeps validation command-alias guidance on manifest metadata", () => {
10+
const source = fs.readFileSync(path.join(repoRoot, "src/config/validation.ts"), "utf8");
11+
12+
expect(source).not.toMatch(/\bfrom\s+["'][^"']*manifest-command-aliases\.runtime\.js["']/);
13+
expect(source).not.toMatch(/\bfrom\s+["'][^"']*providers\.runtime\.js["']/);
14+
expect(source).not.toMatch(/\bfrom\s+["'][^"']*loader\.js["']/);
15+
});
16+
});

‎src/config/validation.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
collectRelevantDoctorPluginIdsForTouchedPaths,
1313
listPluginDoctorLegacyConfigRules,
1414
} from "../plugins/doctor-contract-registry.js";
15-
import { resolveManifestCommandAliasOwner } from "../plugins/manifest-command-aliases.runtime.js";
15+
import { resolveManifestCommandAliasOwnerInRegistry } from "../plugins/manifest-command-aliases.js";
1616
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
1717
import { loadPluginManifestRegistryForPluginRegistry } from "../plugins/plugin-registry.js";
1818
import { validateJsonSchemaValue } from "../plugins/schema-validator.js";
@@ -1119,7 +1119,7 @@ function validateConfigObjectWithPluginsBase(
11191119
continue;
11201120
}
11211121
if (!knownIds.has(pluginId)) {
1122-
const commandAlias = resolveManifestCommandAliasOwner({
1122+
const commandAlias = resolveManifestCommandAliasOwnerInRegistry({
11231123
command: pluginId,
11241124
registry,
11251125
});

0 commit comments

Comments
 (0)