fix(config): reject shared agentDir
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user