Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

style(console): format group chat test fixtures with oxfmt

raullopez-sandbox5310538deb46
diff --git a/console/apps/switch-console-desktop/src/main/core/chats/chat-stream.test.ts b/console/apps/switch-console-desktop/src/main/core/chats/chat-stream.test.ts
index 2e597d306..2042547fb 100644
--- a/console/apps/switch-console-desktop/src/main/core/chats/chat-stream.test.ts
+++ b/console/apps/switch-console-desktop/src/main/core/chats/chat-stream.test.ts
@@ -14,7 +14,9 @@ function summary(roomId: string, seq: number | null): ChatSummary {
channelName: null,
agents: [],
canManage: true,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage:
seq === null ? null : { seq, sentAt: '2026-01-01T00:00:00Z', preview: '', senderName: '' },
};
@@ -32,7 +34,10 @@ function message(roomId: string, seq: number): ChatMessage {
format: null,
threadRootId: null,
attachments: [],
- clientTxn: null, namedAgentIds: [], threadReplyCount: 0, threadLastReplySeq: null,
+ clientTxn: null,
+ namedAgentIds: [],
+ threadReplyCount: 0,
+ threadLastReplySeq: null,
};
}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/chats/stores/empty-chat-finder.test.ts b/console/apps/switch-console-desktop/src/renderer/features/chats/stores/empty-chat-finder.test.ts
index d34fcd63d..af25d4312 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/chats/stores/empty-chat-finder.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/chats/stores/empty-chat-finder.test.ts
@@ -8,9 +8,22 @@ const makeChat = (overrides: Partial<ChatSummary> = {}): ChatSummary => ({
channelType: 'direct',
bridgeType: null,
channelName: null,
- agents: [{ id: 'agent-1', name: 'Agent', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'agent-1',
+ name: 'Agent',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
canManage: false,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage: null,
...overrides,
});
@@ -32,7 +45,10 @@ const makeMessage = (overrides: Partial<ChatMessage> = {}): ChatMessage => ({
format: null,
threadRootId: null,
attachments: [],
- clientTxn: null, namedAgentIds: [], threadReplyCount: 0, threadLastReplySeq: null,
+ clientTxn: null,
+ namedAgentIds: [],
+ threadReplyCount: 0,
+ threadLastReplySeq: null,
...overrides,
});
@@ -222,7 +238,18 @@ describe('EmptyChatFinder', () => {
const chat = makeChat({
roomId: 'room-1',
name: 'Chat with Agent',
- agents: [{ id: 'agent-1', name: 'Agent', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'agent-1',
+ name: 'Agent',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
lastMessage: {
seq: 1,
sentAt: '2024-01-01T00:00:00Z',
@@ -243,7 +270,18 @@ describe('EmptyChatFinder', () => {
const chat = makeChat({
roomId: 'room-1',
name: 'New Chat',
- agents: [{ id: 'agent-1', name: 'Agent', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'agent-1',
+ name: 'Agent',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
lastMessage: {
seq: 1,
sentAt: '2024-01-01T00:00:00Z',
@@ -264,7 +302,18 @@ describe('EmptyChatFinder', () => {
const chat = makeChat({
roomId: 'room-1',
name: 'New chat',
- agents: [{ id: 'agent-1', name: 'Agent', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'agent-1',
+ name: 'Agent',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
lastMessage: {
seq: 1,
sentAt: '2024-01-01T00:00:00Z',
@@ -285,7 +334,18 @@ describe('EmptyChatFinder', () => {
const chat = makeChat({
roomId: 'room-1',
name: 'Chat with Ada',
- agents: [{ id: 'agent-1', name: 'ada', displayName: 'Ada', iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'agent-1',
+ name: 'ada',
+ displayName: 'Ada',
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
lastMessage: {
seq: 1,
sentAt: '2024-01-01T00:00:00Z',
@@ -347,8 +407,26 @@ describe('EmptyChatFinder', () => {
roomId: 'room-1',
name: 'Chat with Ada, Bob',
agents: [
- { id: 'agent-1', name: 'ada', displayName: 'Ada', iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false },
- { id: 'agent-2', name: 'bob', displayName: 'Bob', iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false },
+ {
+ id: 'agent-1',
+ name: 'ada',
+ displayName: 'Ada',
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ {
+ id: 'agent-2',
+ name: 'bob',
+ displayName: 'Bob',
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
],
lastMessage: {
seq: 1,
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/room-filters.test.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/room-filters.test.ts
index 0d17dbbe5..60b85f608 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/room-filters.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/room-filters.test.ts
@@ -8,7 +8,16 @@ import {
withConsoleGroupChats,
} from './room-filters';
-const agent = { id: 'a', name: 'a', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false };
+const agent = {
+ id: 'a',
+ name: 'a',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+};
describe('isConsoleDirectChat', () => {
it('returns true for a direct unbridged room with one agent', () => {
@@ -61,7 +70,9 @@ const chat = (roomId: string, extra: Partial<ChatSummary> = {}): ChatSummary =>
channelName: null,
agents: [agent],
canManage: false,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage: null,
...extra,
});
@@ -97,7 +108,12 @@ describe('withConsoleGroupChats', () => {
it('adds the group chats not already listed, sorted by name', () => {
const listed = withConsoleGroupChats(
[room('b'), room('d')],
- [chat('a'), chat('b'), chat('c', { channelType: 'direct' }), chat('e', { bridgeType: 'slack' })]
+ [
+ chat('a'),
+ chat('b'),
+ chat('c', { channelType: 'direct' }),
+ chat('e', { bridgeType: 'slack' }),
+ ]
);
expect(listed.map((each) => each.id)).toEqual(['a', 'b', 'd']);
expect(listed[1].ownerId).toBe('u');
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/chat-agent-conversations.test.ts b/console/apps/switch-console-desktop/src/renderer/tests/chat-agent-conversations.test.ts
index 2a80bdbe6..dc2594791 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/chat-agent-conversations.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/tests/chat-agent-conversations.test.ts
@@ -11,7 +11,10 @@ const agent = (id: string, name: string, displayName: string | null = null) => (
name,
displayName,
iconUrl: null,
- provider: null, alias: null, ownerName: null, ownedByViewer: false,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
});
const summary = (overrides: Partial<ChatSummary>): ChatSummary => ({
@@ -22,7 +25,9 @@ const summary = (overrides: Partial<ChatSummary>): ChatSummary => ({
channelName: null,
agents: [],
canManage: false,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage: null,
...overrides,
});
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/chat-timeline-store.test.ts b/console/apps/switch-console-desktop/src/renderer/tests/chat-timeline-store.test.ts
index 2f990bd06..5e4a4c644 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/chat-timeline-store.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/tests/chat-timeline-store.test.ts
@@ -20,7 +20,10 @@ function message(seq: number, extra: Partial<ChatMessage> = {}): ChatMessage {
format: null,
threadRootId: null,
attachments: [],
- clientTxn: null, namedAgentIds: [], threadReplyCount: 0, threadLastReplySeq: null,
+ clientTxn: null,
+ namedAgentIds: [],
+ threadReplyCount: 0,
+ threadLastReplySeq: null,
...extra,
};
}
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/chat-titler.test.ts b/console/apps/switch-console-desktop/src/renderer/tests/chat-titler.test.ts
index 57df553d4..a1803211d 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/chat-titler.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/tests/chat-titler.test.ts
@@ -9,9 +9,22 @@ function summary(roomId: string, channelType: ChatSummary['channelType'] = 'dire
channelType,
bridgeType: null,
channelName: null,
- agents: [{ id: 'a1', name: 'ada', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'a1',
+ name: 'ada',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
canManage: true,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage: null,
};
}
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/chats-store.test.ts b/console/apps/switch-console-desktop/src/renderer/tests/chats-store.test.ts
index e06938aa5..239fbbef1 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/chats-store.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/tests/chats-store.test.ts
@@ -20,9 +20,22 @@ function summary(roomId: string, seq: number): ChatSummary {
channelType: 'direct',
bridgeType: null,
channelName: null,
- agents: [{ id: 'a1', name: 'ada', displayName: null, iconUrl: null, provider: null, alias: null, ownerName: null, ownedByViewer: false }],
+ agents: [
+ {
+ id: 'a1',
+ name: 'ada',
+ displayName: null,
+ iconUrl: null,
+ provider: null,
+ alias: null,
+ ownerName: null,
+ ownedByViewer: false,
+ },
+ ],
canManage: true,
- ownsAgent: false, memberUserIds: [], memberCount: 0,
+ ownsAgent: false,
+ memberUserIds: [],
+ memberCount: 0,
lastMessage: { seq, sentAt: '2026-01-01T00:00:00Z', preview: 'hi', senderName: 'Ada' },
};
}
@@ -39,7 +52,10 @@ function message(roomId: string, seq: number): ChatMessage {
format: null,
threadRootId: null,
attachments: [],
- clientTxn: null, namedAgentIds: [], threadReplyCount: 0, threadLastReplySeq: null,
+ clientTxn: null,
+ namedAgentIds: [],
+ threadReplyCount: 0,
+ threadLastReplySeq: null,
};
}