fix(config): reject shared agentDir

This commit is contained in:
Peter Steinberger
2026-01-08 11:53:01 +01:00
parent aa34d7d5f2
commit f24a4626e3
4 changed files with 193 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
import {
findDuplicateAgentDirs,
formatDuplicateAgentDirError,
} from "./agent-dirs.js";
import {
applyIdentityDefaults,
applyModelDefaults,
@@ -32,6 +36,18 @@ export function validateConfigObject(
})),
};
}
const duplicates = findDuplicateAgentDirs(validated.data as ClawdbotConfig);
if (duplicates.length > 0) {
return {
ok: false,
issues: [
{
path: "routing.agents",
message: formatDuplicateAgentDirError(duplicates),
},
],
};
}
return {
ok: true,
config: applyModelDefaults(