diff --git a/AgentCompany-New/src/main/services/organization-service.ts b/AgentCompany-New/src/main/services/organization-service.ts index 0833e7a7..912c1748 100644 --- a/AgentCompany-New/src/main/services/organization-service.ts +++ b/AgentCompany-New/src/main/services/organization-service.ts @@ -226,11 +226,13 @@ export class OrganizationService { .get(input.modelProviderId, input.orgId) as { id: string } | undefined; if (!provider) throw new Error("Agent provider was not found."); } + const department = input.department.trim(); + const budgetCents = Math.max(0, Math.round(input.budgetCents)); const result = this.db.prepare(` update agents - set role = ?, title = ?, role_level = ?, model_provider_id = ?, model_id = ? + set role = ?, title = ?, role_level = ?, department = ?, budget_cents = ?, model_provider_id = ?, model_id = ? where id = ? and org_id = ? - `).run(role, input.title.trim() || role, input.roleLevel.trim() || "staff", input.modelProviderId, input.modelId, input.agentId, input.orgId); + `).run(role, input.title.trim() || role, input.roleLevel.trim() || "staff", department || "General", budgetCents, input.modelProviderId, input.modelId, input.agentId, input.orgId); if (result.changes === 0) throw new Error("Agent update failed."); this.audit.record({ orgId: input.orgId, diff --git a/AgentCompany-New/src/renderer/src/pages/TeamPage.tsx b/AgentCompany-New/src/renderer/src/pages/TeamPage.tsx index 749e847a..583d8eb6 100644 --- a/AgentCompany-New/src/renderer/src/pages/TeamPage.tsx +++ b/AgentCompany-New/src/renderer/src/pages/TeamPage.tsx @@ -83,6 +83,8 @@ export function TeamPage({ snapshot, actions }: PageProps) { role: text(form, "role"), title: text(form, "title") || text(form, "role"), roleLevel: text(form, "roleLevel") || "staff", + department: text(form, "department") || editingAgent.department, + budgetCents: Math.max(0, Math.round(Number(text(form, "budget")) * 100)), modelProviderId: optional(form, "modelProviderId"), modelId: optional(form, "modelId"), })).then((result) => { if (result) setEditAgentId(null); }); @@ -163,6 +165,8 @@ export function TeamPage({ snapshot, actions }: PageProps) { setEditAgentId(null)} onSubmit={submitEdit}> + + - diff --git a/AgentCompany-New/src/shared/commands.ts b/AgentCompany-New/src/shared/commands.ts index aca3b673..3c1ba8d2 100644 --- a/AgentCompany-New/src/shared/commands.ts +++ b/AgentCompany-New/src/shared/commands.ts @@ -42,6 +42,8 @@ export interface UpdateAgentInput { role: string; title: string; roleLevel: string; + department: string; + budgetCents: number; modelProviderId: string | null; modelId: string | null; }