mocode-ai 1.3.9 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repl/index.js +6 -2
- package/package.json +1 -1
package/dist/repl/index.js
CHANGED
|
@@ -1561,8 +1561,12 @@ export async function startRepl(initialHistory, sessionId, sandboxRootOverride,
|
|
|
1561
1561
|
if (line === '/clear') {
|
|
1562
1562
|
history.length = 1; // 保留 system 提示
|
|
1563
1563
|
resetState(); // 同步清空回滚轮次/快照
|
|
1564
|
-
|
|
1565
|
-
|
|
1564
|
+
// /clear 立刻换新会话 id:之前延后到 turn 收尾(line 1334)分配,但 runAgent 期间模型
|
|
1565
|
+
// 调 plan_update / note_append 会命中「no active session」——它们写 notes.md 靠
|
|
1566
|
+
// getNotesFilePath(getCurrentSessionId()),而下一个 turn 还没走完。改为与启动对齐
|
|
1567
|
+
// 立即分配(对照 line 1019):notes.md 由写入时按需建文件,这里预分配 id 不触盘。
|
|
1568
|
+
currentSessionId = newSessionId();
|
|
1569
|
+
setCurrentSessionId(currentSessionId, process.cwd()); // 同步到 session/state
|
|
1566
1570
|
turnCount = 0; // 反思 cadence 重新计数
|
|
1567
1571
|
contextState.lastUsage = undefined;
|
|
1568
1572
|
contextState.lifecycleStats = undefined;
|