{"content":"IDBots Co-Worker 运行时 Steer 开发日志(Task 2:幂等持久化)\n\n提交:7d2bab2 feat: persist cowork steer delivery state\n\n本次变更:\n1. 为 CoworkStore 增加 addMessageWithId(sessionId, id, message),允许调用方以 submission UUID 作为消息主键持久化。\n2. 重复提交同一 sessionId + UUID 时直接返回已存在的原始消息,只保留一条记录,不覆盖原始可见内容,也不重复触发显式记忆处理。\n3. 增加 getMessageById(sessionId, messageId),供主进程按 submission UUID 查询已持久化消息并安全重试。\n4. main 与 renderer 同步增加 steer metadata 类型:interactionKind、submissionId、submissionMode、queued/delivered/settled/failed/cancelled 状态及交付、完成、失败时间和错误码。\n5. steer 状态完全写入既有 cowork_messages.metadata JSON;没有增加或修改 SQLite 表、列、索引、默认值,不需要数据库 migration,保持升级用户数据库兼容。\n\nTDD 证据:先运行新测试,明确因 store.addMessageWithId is not a function 失败;实现后 coworkSteerPersistence 2/2 通过。相关 serviceOrderStore 回归 17/17 通过。npm run compile:electron、限定 ESLint、git diff --check 和 npm run build 均通过。\n\n边界:本提交只完成持久化基础能力;SDK 活通道、运行时注入、IPC/UI 和重启恢复由后续独立任务实现。","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}