From c26dc99ef1514b6554ffccab4bed3c6060e3e3e8 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 7 Mar 2026 14:24:44 +0800 Subject: [PATCH] Fix pending token compile regressions --- .../openclawapp/data/RemoteOpenClawRepository.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt index 5595b59..07ca3ee 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt @@ -36,6 +36,7 @@ private data class AttachmentRetryPayload( val fileName: String, val bytes: ByteArray, val contentType: String?, + val fingerprint: String? = null, ) private data class TextRetryPayload( @@ -199,6 +200,7 @@ class RemoteOpenClawRepository( fileName = item.fileName, bytes = bytes, contentType = item.contentType, + fingerprint = item.fingerprint ?: attachmentFingerprint(item.fileName, bytes, item.contentType), ) attachmentOpenStore[item.messageId] = AttachmentOpenPayload( fileName = item.fileName, @@ -307,7 +309,13 @@ class RemoteOpenClawRepository( ) { val currentMessages = messageStore[sessionId].orEmpty() val localId = "local-attachment-$sessionId-${currentMessages.size + 1}" - attachmentRetryStore[localId] = AttachmentRetryPayload(sessionId, fileName, bytes, contentType) + attachmentRetryStore[localId] = AttachmentRetryPayload( + sessionId = sessionId, + fileName = fileName, + bytes = bytes, + contentType = contentType, + fingerprint = attachmentFingerprint(fileName, bytes, contentType), + ) attachmentOpenStore[localId] = AttachmentOpenPayload(fileName, bytes, contentType) pendingAttachmentQueue[localId] = PendingAttachmentSend( messageId = localId, @@ -937,6 +945,7 @@ class RemoteOpenClawRepository( sessionId = sessionId, text = domain.text, createdAt = domain.createdAt, + clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()), autoRetryEligible = true, ) autoRetryMessageIds.add(domain.id) @@ -949,6 +958,7 @@ class RemoteOpenClawRepository( sessionId = sessionId, text = domain.text, createdAt = domain.createdAt, + clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()), autoRetryEligible = false, ) autoRetryMessageIds.remove(domain.id) @@ -961,6 +971,7 @@ class RemoteOpenClawRepository( sessionId = sessionId, text = domain.text, createdAt = domain.createdAt, + clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()), autoRetryEligible = false, ) autoRetryMessageIds.remove(domain.id)