























@@ -4,15 +4,48 @@ import { CONFIG_PRESETS, detectActivePreset } from "./config-presets.ts";
4455describe("detectActivePreset", () => {
66it("keeps every preset patch valid for the runtime config schema", () => {
7-for (const preset of CONFIG_PRESETS) {
8-const defaults = preset.patch.agents.defaults;
7+expect(
8+CONFIG_PRESETS.map((preset) => ({
9+id: preset.id,
10+defaults: preset.patch.agents.defaults,
11+})),
12+).toStrictEqual([
13+{
14+id: "personal",
15+defaults: {
16+bootstrapMaxChars: 20_000,
17+bootstrapTotalMaxChars: 150_000,
18+contextInjection: "always",
19+},
20+},
21+{
22+id: "codeAgent",
23+defaults: {
24+bootstrapMaxChars: 50_000,
25+bootstrapTotalMaxChars: 300_000,
26+contextInjection: "always",
27+},
28+},
29+{
30+id: "teamBot",
31+defaults: {
32+bootstrapMaxChars: 10_000,
33+bootstrapTotalMaxChars: 80_000,
34+contextInjection: "continuation-skip",
35+},
36+},
37+{
38+id: "minimal",
39+defaults: {
40+bootstrapMaxChars: 5_000,
41+bootstrapTotalMaxChars: 30_000,
42+contextInjection: "continuation-skip",
43+},
44+},
45+]);
94647+for (const preset of CONFIG_PRESETS) {
1048expect(OpenClawSchema.safeParse(preset.patch).success, preset.id).toBe(true);
11-expect(defaults.bootstrapMaxChars, preset.id).toBeGreaterThan(0);
12-expect(defaults.bootstrapTotalMaxChars, preset.id).toBeGreaterThan(0);
13-expect(defaults.bootstrapTotalMaxChars, preset.id).toBeGreaterThanOrEqual(
14-defaults.bootstrapMaxChars,
15-);
1649}
1750});
1851此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。