myagent-ai 1.47.14 → 1.47.15
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/package.json
CHANGED
|
@@ -1374,8 +1374,11 @@ async function sendMessage(opts) {
|
|
|
1374
1374
|
|
|
1375
1375
|
// [v1.23.35] Create session if needed — 使用 UUID 防止 ID 重复/乱串
|
|
1376
1376
|
let sessionId = state.activeSessionId;
|
|
1377
|
-
// [v1.
|
|
1378
|
-
|
|
1377
|
+
// [v1.47.14] 修复:新对话状态下不调用 loadSessions()!
|
|
1378
|
+
// loadSessions() 会通过 _pendingSessionRestore 或 URL 参数 auto-select
|
|
1379
|
+
// 历史会话,导致用户在"新对话"页面发消息时被跳转到历史会话。
|
|
1380
|
+
// 只有 activeSessionId 完全为空(不是 '__new__')时才需要等待 loadSessions。
|
|
1381
|
+
if (!sessionId && sessionId !== '__new__' && typeof loadSessions === 'function' && state.activeAgent) {
|
|
1379
1382
|
console.log('[sendMessage] activeSessionId is empty, waiting for loadSessions...');
|
|
1380
1383
|
await loadSessions();
|
|
1381
1384
|
sessionId = state.activeSessionId;
|