forked from bai/curriculum-project-hub
feat: redesign Feishu project console
This commit is contained in:
@@ -177,6 +177,10 @@ export class DatabaseRuntimeSettings implements RuntimeSettings {
|
||||
if (project.organization.agentRoles.length === 0) {
|
||||
throw new Error(`no active Agent roles configured for organization ${project.organization.id}`);
|
||||
}
|
||||
const defaultRoles = project.organization.agentRoles.filter((role) => role.isDefault);
|
||||
if (defaultRoles.length !== 1) {
|
||||
throw new Error(`organization ${project.organization.id} must have exactly one active default Agent role`);
|
||||
}
|
||||
|
||||
const defaults = await this.envSettings.modelRegistry(scope);
|
||||
const enabledModels = new Set(defaults.listModels().map((model) => model.id));
|
||||
@@ -206,9 +210,6 @@ export class DatabaseRuntimeSettings implements RuntimeSettings {
|
||||
};
|
||||
}),
|
||||
}));
|
||||
if (!roles.some((role) => role.id === "draft")) {
|
||||
throw new Error(`default Agent role draft is not configured for organization ${project.organization.id}`);
|
||||
}
|
||||
return new InMemoryModelRegistry(defaults.listModels(), roles);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user