@langgraph-js/sdk 4.6.6 → 4.6.7

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/History.js CHANGED
@@ -106,10 +106,10 @@ export class History {
106
106
  * @en Deletes the specified session
107
107
  */
108
108
  async deleteSession(sessionId) {
109
- const session = this.sessions.get(sessionId);
110
- if (!session) {
111
- return false;
112
- }
109
+ // 注意:不要在此处检查 this.sessions.has(sessionId)
110
+ // this.sessions 只记录本次运行中创建/激活过的会话,
111
+ // 而历史列表中的 thread 是直接从远端拉取的,并不在本地 Map 里。
112
+ // 如果加了提前 return,历史列表中未被激活过的 thread 将永远无法删除。
113
113
  // 如果删除的是当前活跃会话,清空活跃会话
114
114
  if (this.activeSessionId === sessionId) {
115
115
  this.activeSessionId = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "4.6.6",
3
+ "version": "4.6.7",
4
4
  "description": "The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/History.ts CHANGED
@@ -151,10 +151,10 @@ export class History {
151
151
  * @en Deletes the specified session
152
152
  */
153
153
  async deleteSession(sessionId: string): Promise<boolean> {
154
- const session = this.sessions.get(sessionId);
155
- if (!session) {
156
- return false;
157
- }
154
+ // 注意:不要在此处检查 this.sessions.has(sessionId)
155
+ // this.sessions 只记录本次运行中创建/激活过的会话,
156
+ // 而历史列表中的 thread 是直接从远端拉取的,并不在本地 Map 里。
157
+ // 如果加了提前 return,历史列表中未被激活过的 thread 将永远无法删除。
158
158
 
159
159
  // 如果删除的是当前活跃会话,清空活跃会话
160
160
  if (this.activeSessionId === sessionId) {