feat(server): allow multiple session attach to doc (#12933)

fix AI-236
This commit is contained in:
DarkSky
2025-06-26 10:15:31 +08:00
committed by GitHub
parent e32c9a814a
commit 06f27e8d6a
14 changed files with 1304 additions and 306 deletions

View File

@@ -298,13 +298,16 @@ export class ChatSessionService {
const histories = await Promise.all(
sessions.map(
async ({
id,
userId: uid,
id,
workspaceId,
docId,
pinned,
promptName,
tokenCost,
messages,
createdAt,
updatedAt,
}) => {
try {
const prompt = await this.prompt.get(promptName);
@@ -341,10 +344,13 @@ export class ChatSessionService {
return {
sessionId: id,
workspaceId,
docId,
pinned,
action: prompt.action || null,
tokens: tokenCost,
createdAt,
updatedAt,
messages: preload.concat(ret.data).map(m => ({
...m,
attachments: m.attachments