@opentiny/next-sdk 0.1.15-beta.1 → 0.1.15-beta.2

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.
@@ -131,7 +131,8 @@ export class AgentModelProvider {
131
131
  try {
132
132
  const transport = client['__transport__']
133
133
 
134
- // 如果是 InMemoryTransport,不关闭传输层 因为它是配对的,关闭一端会影响另一端(服务端)
134
+ // 如果是 InMemoryTransport 或 MessageChannelTransport,不关闭传输层
135
+ // 因为它们是配对的,关闭一端会影响另一端(服务端)
135
136
  if (
136
137
  (transport && transport instanceof InMemoryTransport) ||
137
138
  (transport && transport instanceof MessageChannelTransport)
@@ -139,6 +140,11 @@ export class AgentModelProvider {
139
140
  return
140
141
  }
141
142
 
143
+ // 因为它们是基于 Chrome 扩展的消息传递机制,关闭会影响服务端的连接
144
+ if (transport && transport instanceof ExtensionClientTransport) {
145
+ return
146
+ }
147
+
142
148
  // 其他类型的传输正常关闭
143
149
  await transport?.terminateSession?.()
144
150
  await transport?.close?.()
@@ -45894,6 +45894,9 @@ class AgentModelProvider {
45894
45894
  if (transport && transport instanceof InMemoryTransport || transport && transport instanceof MessageChannelTransport) {
45895
45895
  return;
45896
45896
  }
45897
+ if (transport && transport instanceof ExtensionClientTransport) {
45898
+ return;
45899
+ }
45897
45900
  await transport?.terminateSession?.();
45898
45901
  await transport?.close?.();
45899
45902
  await client?.close?.();