fix: avoid synthesizing agent defaults
This commit is contained in:
@@ -269,7 +269,7 @@ describe("config identity defaults", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not synthesize session when absent", async () => {
|
it("does not synthesize agent/session when absent", async () => {
|
||||||
await withTempHome(async (home) => {
|
await withTempHome(async (home) => {
|
||||||
const configDir = path.join(home, ".clawdbot");
|
const configDir = path.join(home, ".clawdbot");
|
||||||
await fs.mkdir(configDir, { recursive: true });
|
await fs.mkdir(configDir, { recursive: true });
|
||||||
@@ -295,7 +295,7 @@ describe("config identity defaults", () => {
|
|||||||
expect(cfg.routing?.groupChat?.mentionPatterns).toEqual([
|
expect(cfg.routing?.groupChat?.mentionPatterns).toEqual([
|
||||||
"\\b@?Samantha\\b",
|
"\\b@?Samantha\\b",
|
||||||
]);
|
]);
|
||||||
expect(cfg.agent?.contextPruning?.mode).toBe("adaptive");
|
expect(cfg.agent).toBeUndefined();
|
||||||
expect(cfg.session).toBeUndefined();
|
expect(cfg.session).toBeUndefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ export function applyContextPruningDefaults(
|
|||||||
cfg: ClawdbotConfig,
|
cfg: ClawdbotConfig,
|
||||||
): ClawdbotConfig {
|
): ClawdbotConfig {
|
||||||
const agent = cfg.agent;
|
const agent = cfg.agent;
|
||||||
|
if (!agent) return cfg;
|
||||||
const contextPruning = agent?.contextPruning;
|
const contextPruning = agent?.contextPruning;
|
||||||
if (contextPruning?.mode) return cfg;
|
if (contextPruning?.mode) return cfg;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user