diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts index 1b28fdb4c..0069a3825 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/conversation/directCodexConversation.ts @@ -55,7 +55,10 @@ export function createDirectProjectTurnId() { // WebView 没有 crypto 时使用时间戳和页内序号。 } if (/^[a-z0-9][a-z0-9-]{5,159}$/iu.test(randomId)) return randomId; - return `${Date.now().toString(36)}-${directProjectTurnSequence.toString(36)}`; + // 回退路径也要有实例内唯一性:时间戳 + 页内序号在多 WebView 同毫秒首轮时会撞车, + // clientTurnId 是 Rust 侧的项目级唯一与历史关联键,所以再补一段随机串。 + const entropy = Math.random().toString(36).slice(2, 10); + return `${Date.now().toString(36)}-${directProjectTurnSequence.toString(36)}-${entropy}`; } export function directCodexConversationMessageId(