Fix pending token compile regressions

This commit is contained in:
OpenClaw committed 2026-03-07 14:24:44 +08:00
1 parent dcd4b2adbd
commit c26dc99ef1
1 file changed
+12 -1
@@ -36,6 +36,7 @@ private data class AttachmentRetryPayload(
val fileName: String, val fileName: String,
val bytes: ByteArray, val bytes: ByteArray,
val contentType: String?, val contentType: String?,
val fingerprint: String? = null,
) )
private data class TextRetryPayload( private data class TextRetryPayload(
@@ -199,6 +200,7 @@ class RemoteOpenClawRepository(
fileName = item.fileName, fileName = item.fileName,
bytes = bytes, bytes = bytes,
contentType = item.contentType, contentType = item.contentType,
fingerprint = item.fingerprint ?: attachmentFingerprint(item.fileName, bytes, item.contentType),
) )
attachmentOpenStore[item.messageId] = AttachmentOpenPayload( attachmentOpenStore[item.messageId] = AttachmentOpenPayload(
fileName = item.fileName, fileName = item.fileName,
@@ -307,7 +309,13 @@ class RemoteOpenClawRepository(
) { ) {
val currentMessages = messageStore[sessionId].orEmpty() val currentMessages = messageStore[sessionId].orEmpty()
val localId = "local-attachment-$sessionId-${currentMessages.size + 1}" 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) attachmentOpenStore[localId] = AttachmentOpenPayload(fileName, bytes, contentType)
pendingAttachmentQueue[localId] = PendingAttachmentSend( pendingAttachmentQueue[localId] = PendingAttachmentSend(
messageId = localId, messageId = localId,
@@ -937,6 +945,7 @@ class RemoteOpenClawRepository(
sessionId = sessionId, sessionId = sessionId,
text = domain.text, text = domain.text,
createdAt = domain.createdAt, createdAt = domain.createdAt,
clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()),
autoRetryEligible = true, autoRetryEligible = true,
) )
autoRetryMessageIds.add(domain.id) autoRetryMessageIds.add(domain.id)
@@ -949,6 +958,7 @@ class RemoteOpenClawRepository(
sessionId = sessionId, sessionId = sessionId,
text = domain.text, text = domain.text,
createdAt = domain.createdAt, createdAt = domain.createdAt,
clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()),
autoRetryEligible = false, autoRetryEligible = false,
) )
autoRetryMessageIds.remove(domain.id) autoRetryMessageIds.remove(domain.id)
@@ -961,6 +971,7 @@ class RemoteOpenClawRepository(
sessionId = sessionId, sessionId = sessionId,
text = domain.text, text = domain.text,
createdAt = domain.createdAt, createdAt = domain.createdAt,
clientToken = domain.clientToken ?: textClientToken(sessionId, domain.text, domain.id.hashCode()),
autoRetryEligible = false, autoRetryEligible = false,
) )
autoRetryMessageIds.remove(domain.id) autoRetryMessageIds.remove(domain.id)