From 5ac75a9688b9354ff2e50d9ecd0eea5b26fd9bec Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sun, 28 Jun 2026 23:52:43 +0300 Subject: [PATCH] refactor(ai-chat): type getRun with concrete AiChatRun/AiChatMessage (#184) F4: getRun was typed Promise<{ run: unknown; message: unknown }> while its siblings are concrete. Import AiChatRun + AiChatMessage and return Promise<{ run: AiChatRun | null; message: AiChatMessage | null }>. Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/server/src/core/ai-chat/ai-chat.controller.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/server/src/core/ai-chat/ai-chat.controller.ts b/apps/server/src/core/ai-chat/ai-chat.controller.ts index 6abaae72..04a255c0 100644 --- a/apps/server/src/core/ai-chat/ai-chat.controller.ts +++ b/apps/server/src/core/ai-chat/ai-chat.controller.ts @@ -21,7 +21,13 @@ import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard'; import { AuthUser } from '../../common/decorators/auth-user.decorator'; import { AuthWorkspace } from '../../common/decorators/auth-workspace.decorator'; import { SkipTransform } from '../../common/decorators/skip-transform.decorator'; -import { AiChat, User, Workspace } from '@docmost/db/types/entity.types'; +import { + AiChat, + AiChatMessage, + AiChatRun, + User, + Workspace, +} from '@docmost/db/types/entity.types'; import { PaginationOptions } from '@docmost/db/pagination/pagination-options'; import { AiChatRepo } from '@docmost/db/repos/ai-chat/ai-chat.repo'; import { AiChatMessageRepo } from '@docmost/db/repos/ai-chat/ai-chat-message.repo'; @@ -160,7 +166,7 @@ export class AiChatController { @Body() dto: GetRunDto, @AuthUser() user: User, @AuthWorkspace() workspace: Workspace, - ): Promise<{ run: unknown; message: unknown }> { + ): Promise<{ run: AiChatRun | null; message: AiChatMessage | null }> { await this.assertOwnedChat(dto.chatId, user, workspace); const run = await this.aiChatRunService.getLatestForChat( dto.chatId,