feat(ai): link memories to source messages

This commit is contained in:
digua committed 2026-08-26 22:23:04 +08:00
1 parent cc240c85f5
commit f4017b0adf
34 files changed
+1278 -72

No files matched your search

+1
View File
@@ -160,6 +160,7 @@ export function createCliRunAgentStream(
maxToolResultTokens: resolveCrossChatToolResultTokenBudget(contextWindow),
memoryService: options.memoryService,
aiChatId,
reportMemoryChange: (memoryId) => onEvent({ type: 'memory_change', memoryId }),
})
await runCrossChatAgent({
userMessage,
@@ -23,6 +23,7 @@ export function createCliCrossChatTools(options: {
maxToolResultTokens: number
memoryService: AIMemoryService
aiChatId: string
reportMemoryChange?: (memoryId: string) => void
}): AgentTool<any, any>[] {
const context: Omit<CrossChatToolExecutionContext, 'abortSignal' | 'reportProgress'> = {
locale: options.locale,
@@ -30,6 +31,7 @@ export function createCliCrossChatTools(options: {
analysisService: options.analysisService,
memoryService: options.memoryService,
aiChatId: options.aiChatId,
reportMemoryChange: options.reportMemoryChange,
maxToolResultTokens: options.maxToolResultTokens,
countTokens,
preprocessMessagesBySession: (sessionId, messages) =>