Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/db/agent-groups.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { AgentGroup } from '../types.js';
import { getDb } from './connection.js';
import { ensureContainerConfig } from './container-configs.js';

export function createAgentGroup(group: AgentGroup): void {
getDb()
Expand All @@ -8,6 +9,7 @@ export function createAgentGroup(group: AgentGroup): void {
VALUES (@id, @name, @folder, @agent_provider, @created_at)`,
)
.run(group);
ensureContainerConfig(group.id);
}

export function getAgentGroup(id: string): AgentGroup | undefined {
Expand Down
8 changes: 8 additions & 0 deletions src/db/db-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
runMigrations,
createAgentGroup,
getAgentGroup,
getContainerConfig,
getAgentGroupByFolder,
getAllAgentGroups,
updateAgentGroup,
Expand Down Expand Up @@ -105,6 +106,13 @@ describe('agent groups', () => {
createAgentGroup(ag());
expect(() => createAgentGroup({ ...ag(), id: 'ag-dup' })).toThrow();
});

it('should create a default container_configs row', () => {
createAgentGroup(ag());
const config = getContainerConfig('ag-1');
expect(config).toBeDefined();
expect(config!.agent_group_id).toBe('ag-1');
});
});

// ── Messaging Groups ──
Expand Down
Loading