@myassis/gateway 1.0.102 → 1.0.104

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.
@@ -106,7 +106,7 @@ exports.appConfig = {
106
106
  /** 单次请求上下文字符预算(LLMClient 硬上限为 200000,此处留出余量) */
107
107
  contextMaxChars: parseInt(process.env.CONTEXT_MAX_CHARS || '180000', 10),
108
108
  /** 超出 toolPairKeep 的旧工具调用内容截断长度 */
109
- oldToolContentLimit: parseInt(process.env.OLD_TOOL_CONTENT_LIMIT || '500', 10),
109
+ oldToolContentLimit: parseInt(process.env.OLD_TOOL_CONTENT_LIMIT || '200', 10),
110
110
  /** 单次请求内最大工具调用轮数 */
111
111
  maxToolRounds: parseInt(process.env.MAX_TOOL_ROUNDS || '200', 10),
112
112
  /**
@@ -1347,6 +1347,12 @@ class Session {
1347
1347
  };
1348
1348
  await Promise.all(llmResult.toolCalls.map(x => startToolCall(x)));
1349
1349
  toolCalls.push(toolCall);
1350
+ // 重置 toolCall:下一轮工具调用必须开启新的分组。
1351
+ // 否则模型连续多轮只返回工具调用(无正文)时,所有轮次的结果会
1352
+ // 累积进同一个 toolCall 对象,并被重复 push 到 toolCalls 数组,
1353
+ // 导致持久化消息出现重复的工具调用组,历史回放时模型看到重复
1354
+ // 的 tool_calls/tool 结果对,进而重复执行工具。
1355
+ toolCall = null;
1350
1356
  // 本轮工具已执行完,增量落库一次。工具轮次可能很多且每轮都耗时,
1351
1357
  // 这里保存能让崩溃后仍保留已完成的工具调用记录。
1352
1358
  if (!childAgent) {
package/package.json CHANGED
@@ -1,95 +1,95 @@
1
- {
2
- "name": "@myassis/gateway",
3
- "version": "1.0.102",
4
- "description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
5
- "main": "dist/index.js",
6
- "bin": {
7
- "myassis-gateway": "dist/index.js",
8
- "gateway": "dist/index.js"
9
- },
10
- "files": [
11
- "dist",
12
- "scripts",
13
- "README.md",
14
- "LICENSE",
15
- "migrations"
16
- ],
17
- "exports": {
18
- ".": {
19
- "require": "./dist/index.js"
20
- }
21
- },
22
- "scripts": {
23
- "dev": "tsx watch src/index.ts",
24
- "start": "node dist/index.js",
25
- "build": "tsc --skipLibCheck",
26
- "postbuild": "node scripts/add-shebang.js && npx tsc-alias",
27
- "pkg:win": "node scripts/pkg-build-win.js node24-win-x64 myassis-gateway-win.exe",
28
- "pkg:linux": "npx @yao-pkg/pkg . --targets node24-linux-x64 --output myassis-gateway-linux",
29
- "pkg:all": "npm run pkg:win && npm run pkg:linux",
30
- "pkg:linux-analyze": "npx @yao-pkg/pkg . --targets node24-linux-x64 --output myassis-gateway-linux --public-packages got --debug",
31
- "test": "jest"
32
- },
33
- "keywords": [
34
- "myassis",
35
- "gateway",
36
- "ai",
37
- "local-ai",
38
- "websocket",
39
- "service"
40
- ],
41
- "author": "duzhengjie",
42
- "dependencies": {
43
- "@myassis/shared": "1.0.19",
44
- "@nut-tree/nut-js": "^4.2.0",
45
- "axios": "^1.15.2",
46
- "bcryptjs": "^2.4.3",
47
- "better-sqlite3": "12.9.0",
48
- "cheerio": "^1.2.0",
49
- "compression": "^1.7.4",
50
- "cors": "^2.8.5",
51
- "dotenv": "^16.3.1",
52
- "express": "^4.18.2",
53
- "helmet": "^7.1.0",
54
- "https-proxy-agent": "^9.0.0",
55
- "jsonwebtoken": "^9.0.2",
56
- "multer": "^2.1.1",
57
- "screenshot-desktop": "^1.15.4",
58
- "undici": "^8.2.0",
59
- "uuid": "^9.0.1",
60
- "ws": "^8.20.0"
61
- },
62
- "devDependencies": {
63
- "@types/bcryptjs": "^2.4.6",
64
- "@types/cors": "^2.8.17",
65
- "@types/express": "^4.17.21",
66
- "@types/jsonwebtoken": "^9.0.6",
67
- "@types/multer": "^1.4.11",
68
- "@types/node": "^20.11.0",
69
- "@types/uuid": "^9.0.8",
70
- "@types/ws": "^8.5.10",
71
- "@yao-pkg/pkg": "^6.20.0",
72
- "tsc-alias": "^1.8.10",
73
- "tsx": "^4.7.0",
74
- "typescript": "^5.3.3",
75
- "@yao-pkg/pkg-fetch": "3.6.3"
76
- },
77
- "pkg": {
78
- "scripts": [
79
- "dist/index.js"
80
- ],
81
- "assets": [
82
- "dist/**/*",
83
- "migrations/**/*",
84
- "README*",
85
- "node_modules/better-sqlite3/build/Release/better_sqlite3.node",
86
- "node_modules/.pnpm/@nut-tree+libnut-linux@2.7.1/node_modules/@nut-tree/libnut-linux/build/Release/libnut.node",
87
- "node_modules/.pnpm/@nut-tree+libnut-win32@2.7.1/node_modules/@nut-tree/libnut-win32/build/Release/libnut.node",
88
- "nssm.exe"
89
- ],
90
- "targets": [
91
- "node24-win-x64",
92
- "node24-linux-x64"
93
- ]
94
- }
95
- }
1
+ {
2
+ "name": "@myassis/gateway",
3
+ "version": "1.0.104",
4
+ "description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "myassis-gateway": "dist/index.js",
8
+ "gateway": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "scripts",
13
+ "README.md",
14
+ "LICENSE",
15
+ "migrations"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "require": "./dist/index.js"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "dev": "tsx watch src/index.ts",
24
+ "start": "node dist/index.js",
25
+ "build": "tsc --skipLibCheck",
26
+ "postbuild": "node scripts/add-shebang.js && npx tsc-alias",
27
+ "pkg:win": "node scripts/pkg-build-win.js node24-win-x64 myassis-gateway-win.exe",
28
+ "pkg:linux": "npx @yao-pkg/pkg . --targets node24-linux-x64 --output myassis-gateway-linux",
29
+ "pkg:all": "npm run pkg:win && npm run pkg:linux",
30
+ "pkg:linux-analyze": "npx @yao-pkg/pkg . --targets node24-linux-x64 --output myassis-gateway-linux --public-packages got --debug",
31
+ "test": "jest"
32
+ },
33
+ "keywords": [
34
+ "myassis",
35
+ "gateway",
36
+ "ai",
37
+ "local-ai",
38
+ "websocket",
39
+ "service"
40
+ ],
41
+ "author": "duzhengjie",
42
+ "dependencies": {
43
+ "@myassis/shared": "1.0.19",
44
+ "@nut-tree/nut-js": "^4.2.0",
45
+ "axios": "^1.15.2",
46
+ "bcryptjs": "^2.4.3",
47
+ "better-sqlite3": "12.9.0",
48
+ "cheerio": "^1.2.0",
49
+ "compression": "^1.7.4",
50
+ "cors": "^2.8.5",
51
+ "dotenv": "^16.3.1",
52
+ "express": "^4.18.2",
53
+ "helmet": "^7.1.0",
54
+ "https-proxy-agent": "^9.0.0",
55
+ "jsonwebtoken": "^9.0.2",
56
+ "multer": "^2.1.1",
57
+ "screenshot-desktop": "^1.15.4",
58
+ "undici": "^8.2.0",
59
+ "uuid": "^9.0.1",
60
+ "ws": "^8.20.0"
61
+ },
62
+ "devDependencies": {
63
+ "@types/bcryptjs": "^2.4.6",
64
+ "@types/cors": "^2.8.17",
65
+ "@types/express": "^4.17.21",
66
+ "@types/jsonwebtoken": "^9.0.6",
67
+ "@types/multer": "^1.4.11",
68
+ "@types/node": "^20.11.0",
69
+ "@types/uuid": "^9.0.8",
70
+ "@types/ws": "^8.5.10",
71
+ "@yao-pkg/pkg": "^6.20.0",
72
+ "tsc-alias": "^1.8.10",
73
+ "tsx": "^4.7.0",
74
+ "typescript": "^5.3.3",
75
+ "@yao-pkg/pkg-fetch": "3.6.3"
76
+ },
77
+ "pkg": {
78
+ "scripts": [
79
+ "dist/index.js"
80
+ ],
81
+ "assets": [
82
+ "dist/**/*",
83
+ "migrations/**/*",
84
+ "README*",
85
+ "node_modules/better-sqlite3/build/Release/better_sqlite3.node",
86
+ "node_modules/.pnpm/@nut-tree+libnut-linux@2.7.1/node_modules/@nut-tree/libnut-linux/build/Release/libnut.node",
87
+ "node_modules/.pnpm/@nut-tree+libnut-win32@2.7.1/node_modules/@nut-tree/libnut-win32/build/Release/libnut.node",
88
+ "nssm.exe"
89
+ ],
90
+ "targets": [
91
+ "node24-win-x64",
92
+ "node24-linux-x64"
93
+ ]
94
+ }
95
+ }