feat(M5-004,M5-005,M5-006,M5-007): session-conversation binding, session:info broadcast, agent creation from TUI, and session metrics (#321)
Some checks failed
ci/woodpecker/push/ci Pipeline failed

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #321.
This commit is contained in:
2026-03-23 00:58:07 +00:00
committed by jason.woltje
parent b18976a7aa
commit 1035d13fc0
10 changed files with 3159 additions and 12 deletions

View File

@@ -19,6 +19,8 @@ const mockRegistry = {
const mockAgentService = {
getSession: vi.fn(() => undefined),
applyAgentConfig: vi.fn(),
updateSessionModel: vi.fn(),
};
const mockSystemOverride = {
@@ -38,6 +40,33 @@ const mockRedis = {
del: vi.fn(),
};
const mockAgentConfig = {
id: 'my-agent-id',
name: 'my-agent-id',
model: 'claude-sonnet-4-6',
provider: 'anthropic',
systemPrompt: null,
allowedTools: null,
isSystem: false,
ownerId: 'user-123',
status: 'idle',
createdAt: new Date(),
updatedAt: new Date(),
};
const mockBrain = {
agents: {
// findByName resolves with the agent when name matches, undefined otherwise
findByName: vi.fn((name: string) =>
Promise.resolve(name === 'my-agent-id' ? mockAgentConfig : undefined),
),
findById: vi.fn((id: string) =>
Promise.resolve(id === 'my-agent-id' ? mockAgentConfig : undefined),
),
create: vi.fn(),
},
};
function buildService(): CommandExecutorService {
return new CommandExecutorService(
mockRegistry as never,
@@ -45,6 +74,7 @@ function buildService(): CommandExecutorService {
mockSystemOverride as never,
mockSessionGC as never,
mockRedis as never,
mockBrain as never,
null,
null,
);