mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	Fix missing messages on sibling navigation (#16408)
* fix: resolve message disappearing issue when navigating between regenerated siblings by using current leaf nodes instead of cached sibling IDs * chore: update webui build output * chore: update webui build output
This commit is contained in:
		 Aleksander Grygier
					Aleksander Grygier
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							2aaf0a2a20
						
					
				
				
					commit
					84c8e305e8
				
			
										
											Binary file not shown.
										
									
								
							| @@ -860,15 +860,18 @@ class ChatStore { | ||||
| 			this.currentResponse = ''; | ||||
|  | ||||
| 			try { | ||||
| 				const assistantMessage = await this.createAssistantMessage(); | ||||
| 				const parentMessageId = | ||||
| 					this.activeMessages.length > 0 | ||||
| 						? this.activeMessages[this.activeMessages.length - 1].id | ||||
| 						: null; | ||||
|  | ||||
| 				const assistantMessage = await this.createAssistantMessage(parentMessageId); | ||||
|  | ||||
| 				if (!assistantMessage) { | ||||
| 					throw new Error('Failed to create assistant message'); | ||||
| 				} | ||||
|  | ||||
| 				this.activeMessages.push(assistantMessage); | ||||
| 				await DatabaseStore.updateCurrentNode(this.activeConversation.id, assistantMessage.id); | ||||
| 				this.activeConversation.currNode = assistantMessage.id; | ||||
|  | ||||
| 				const conversationContext = this.activeMessages.slice(0, -1); | ||||
|  | ||||
| @@ -1124,8 +1127,10 @@ class ChatStore { | ||||
| 			(m) => m.role === 'user' && m.parent === rootMessage?.id | ||||
| 		); | ||||
|  | ||||
| 		await DatabaseStore.updateCurrentNode(this.activeConversation.id, siblingId); | ||||
| 		this.activeConversation.currNode = siblingId; | ||||
| 		const currentLeafNodeId = findLeafNode(allMessages, siblingId); | ||||
|  | ||||
| 		await DatabaseStore.updateCurrentNode(this.activeConversation.id, currentLeafNodeId); | ||||
| 		this.activeConversation.currNode = currentLeafNodeId; | ||||
| 		await this.refreshActiveMessages(); | ||||
|  | ||||
| 		// Only show title dialog if we're navigating between different first user message siblings | ||||
|   | ||||
		Reference in New Issue
	
	Block a user