diff --git a/src/main/services/organization-service.ts b/src/main/services/organization-service.ts
index 08ac6215..3cd99051 100644
--- a/src/main/services/organization-service.ts
+++ b/src/main/services/organization-service.ts
@@ -1,3 +1,4 @@
+import { assertModelHasProvider } from "../../shared/agent-model";
import { setAutonomousPaused, updateUiPreferences } from "./app-state";
import { updateOrganizationProfile } from "./organization-profile";
import { setGoalDueDate, validDueAt } from "./goal-due-date";
@@ -88,6 +89,7 @@ export class OrganizationService {
createAgent(input: CreateAgentInput): string {
assertUsableMentionName(input.name);
this.assertAgentNameAvailable(input.orgId, input.name, null);
+ assertModelHasProvider(input.modelProviderId, input.modelId);
this.governance.assertRank(input.orgId, null, input.roleLevel ?? "staff");
const hiringPolicy = this.governance.enforceHiringPolicy(input);
const id = createId("agt");
@@ -173,6 +175,7 @@ export class OrganizationService {
assertUsableMentionName(name);
this.assertAgentNameAvailable(input.orgId, name, input.agentId);
}
+ assertModelHasProvider(input.modelProviderId, input.modelId);
if (input.modelProviderId) {
const provider = this.db.prepare("select id from providers where id = ? and org_id = ?")
.get(input.modelProviderId, input.orgId) as { id: string } | undefined;
diff --git a/src/renderer/src/pages/TeamPage.tsx b/src/renderer/src/pages/TeamPage.tsx
index 97c805c5..88b392db 100644
--- a/src/renderer/src/pages/TeamPage.tsx
+++ b/src/renderer/src/pages/TeamPage.tsx
@@ -5,7 +5,7 @@ import { AvatarField } from "../shared/AvatarField";
import { TopbarActions } from "../shared/TopbarActions";
import { Dialog } from "../shared/Dialog";
import { OrgChartTree } from "./team/OrgChartTree";
-import type { AgentRecord, EmployeeRecord, ProviderRecord } from "../../../shared/domain";
+import type { AgentRecord, EmployeeRecord, ProviderCatalogEntry, ProviderRecord } from "../../../shared/domain";
import type { PageProps } from "./types";
import { activeOrgId, money } from "./types";
import { t } from "../i18n/i18n";
@@ -148,8 +148,9 @@ export function TeamPage({ snapshot, actions }: PageProps) {
{t("Leave the model blank to use the provider's default. A changed model applies from the agent's next session.")}