@langgraph-js/sdk 4.6.5 → 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;
@@ -527,7 +527,7 @@ export class LangGraphClient extends EventEmitter {
527
527
  this.tools.doneWaiting(tool_id, result);
528
528
  if (this.humanInTheLoop) {
529
529
  this.humanInTheLoop.result[action_request_id] = result;
530
- if (Object.keys(this.humanInTheLoop.result).length === this.humanInTheLoop.interruptData.length) {
530
+ if (Object.keys(this.humanInTheLoop.result).length === this.humanInTheLoop.interruptData?.[0]?.value?.actionRequests?.length) {
531
531
  setTimeout(() => {
532
532
  if (this.forceSkipToolLock) {
533
533
  console.warn("force kill tool lock");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "4.6.5",
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) {
@@ -649,7 +649,7 @@ export class LangGraphClient<TStateType = unknown> extends EventEmitter<LangGrap
649
649
  this.tools.doneWaiting(tool_id, result);
650
650
  if (this.humanInTheLoop) {
651
651
  this.humanInTheLoop.result[action_request_id] = result;
652
- if (Object.keys(this.humanInTheLoop.result).length === this.humanInTheLoop.interruptData.length) {
652
+ if (Object.keys(this.humanInTheLoop.result).length === this.humanInTheLoop.interruptData?.[0]?.value?.actionRequests?.length) {
653
653
  setTimeout(() => {
654
654
  if (this.forceSkipToolLock) {
655
655
  console.warn("force kill tool lock");