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
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:
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user