feat(chat): add parent message ID for proper message linking

This commit is contained in:
cogwheel0
2025-12-06 09:33:30 +05:30
parent ad9aa6407e
commit d7c36f3e0d
2 changed files with 29 additions and 2 deletions

View File

@@ -2697,6 +2697,7 @@ class ApiService {
Map<String, dynamic>? backgroundTasks,
String? responseMessageId,
Map<String, dynamic>? userSettings,
String? parentMessageId,
}) {
final streamController = StreamController<String>();
@@ -2870,6 +2871,11 @@ class ApiService {
if (conversationId != null) {
data['chat_id'] = conversationId;
}
// Include parent_id for proper message linking (required since OpenWebUI 0.6.41)
// This links the assistant response to the user message it's responding to
if (parentMessageId != null) {
data['parent_id'] = parentMessageId;
}
// Attach background_tasks if provided
if (backgroundTasks != null && backgroundTasks.isNotEmpty) {