From b9a16ec134d4e7eb72b3aaf36ed41b233116812e Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 7 Mar 2026 16:05:58 +0800 Subject: [PATCH] Clear stale local thinking placeholders --- .../xiaobai/openclawapp/data/RemoteOpenClawRepository.kt | 7 +++++++ docs/MVP_PROGRESS.md | 1 + 2 files changed, 8 insertions(+) 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 0ca17e3..1399c8c 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt @@ -702,6 +702,13 @@ class RemoteOpenClawRepository( pendingTextQueue.remove(targetId) textRetryStore.remove(targetId) autoRetryMessageIds.remove(targetId) + + val hasMorePendingText = pendingTextQueue.values.any { it.sessionId == sessionId } + if (!hasMorePendingText) { + val next = messageStore[sessionId].orEmpty().filterNot { it.id.startsWith("local-thinking-") } + messageStore = messageStore + (sessionId to next) + updateSessionPreview(sessionId, previewMessage(next)) + } } private fun matchesPendingLocalText(local: ChatMessage, remote: ChatMessage): Boolean { diff --git a/docs/MVP_PROGRESS.md b/docs/MVP_PROGRESS.md index a84148f..941549d 100644 --- a/docs/MVP_PROGRESS.md +++ b/docs/MVP_PROGRESS.md @@ -443,3 +443,4 @@ Android/iOS App - 2026-03-07:把详情页顶部导航头正式迁回 `Scaffold.topBar`:聊天页内部不再自己伪造导航栏,而是由 app 壳层根据 route 决定顶栏标题、返回、附件、刷新动作;这样详情页终于有了正经的二级页面导航结构。 - 2026-03-07:修正附件失败态的重试可见性:之前“重试”混在一排附件操作按钮最右侧,窄屏上很容易被挤掉;现在失败附件会单独前置一个主按钮“重新发送附件”,避免用户知道失败了却找不到怎么重发。 - 2026-03-07:补了一层附件上传响应 DTO 兼容:客户端 `UploadAttachmentResponseDto` 现在同时接受 `accepted/accept`、`fileName/filename`、`sizeBytes/sizebytes`、camelCase/snake_case 等字段名,先兜住线上回包字段不一致导致的反序列化失败。 +- 2026-03-07:收口一处“最后一条一直转圈”的本地状态残留:文本消息被服务端接受后,如果当前会话已经没有待发文本,就会立刻清掉本地 `thinking` 占位消息,避免附件已完成但时间线尾部仍像一直在生成回复。