diff --git a/desktop/src/workspace/local-workspace-conversations.cjs b/desktop/src/workspace/local-workspace-conversations.cjs index c68fd7c..b556f56 100644 --- a/desktop/src/workspace/local-workspace-conversations.cjs +++ b/desktop/src/workspace/local-workspace-conversations.cjs @@ -23,7 +23,6 @@ class LocalWorkspaceConversations { this.isGroupBusy = options.isGroupBusy this.clearSessionState = options.clearSessionState this.runLedger = options.runLedger - this.discardAttachments = options.discardAttachments this.agentLabel = options.agentLabel this.createId = options.createId this.now = options.now @@ -153,17 +152,11 @@ class LocalWorkspaceConversations { if (!state.groups.some(group => group.id === groupId)) { throw new Error('LOCAL_GROUP_NOT_FOUND') } - const attachmentIds = [...new Set(state.messages - .filter(message => message.groupId === groupId) - .flatMap(message => Array.isArray(message.attachments) ? message.attachments : []) - .map(attachment => attachment?.id) - .filter(id => typeof id === 'string'))] this.commit(() => { this.clearSessionState(groupId) state.groups = state.groups.filter(group => group.id !== groupId) state.messages = state.messages.filter(message => message.groupId !== groupId) }, () => this.runLedger?.deleteGroup?.(groupId)) - this.discardAttachments?.(attachmentIds) } deleteMessage(groupId, messageId) { diff --git a/desktop/src/workspace/local-workspace.cjs b/desktop/src/workspace/local-workspace.cjs index 616b3a0..1c19070 100644 --- a/desktop/src/workspace/local-workspace.cjs +++ b/desktop/src/workspace/local-workspace.cjs @@ -217,13 +217,6 @@ class LocalWorkspace extends EventEmitter { }) this.runLedgerCoordinator = new LocalWorkspaceRunLedger({ runLedger: this.runLedger, - discardAttachments: ids => { - const referenced = new Set(this.state.messages.flatMap(message => ( - Array.isArray(message.attachments) ? message.attachments : [] - )).map(attachment => attachment?.id).filter(Boolean)) - const orphaned = ids.filter(id => !referenced.has(id)) - if (orphaned.length) this.contentBlobStore.discard(orphaned) - }, state: () => this.state, save: () => this.save(), createId: () => this.createId(),