@sleep2agi/commhub-server 0.9.0-preview.196 → 0.9.0-preview.197

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/commhub-server",
3
- "version": "0.9.0-preview.196",
3
+ "version": "0.9.0-preview.197",
4
4
  "description": "CommHub Server — AI Agent communication hub with MCP protocol, multi-network isolation, user auth, and MCP tools (17 collaboration-core + node/provider ops tools; authoritative list: docs-site/docs/api/mcp-tools.md).",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -40,6 +40,14 @@ describe("#2840 节点连续确定性失败告警", () => {
40
40
  expect(classifyDeterministicFailure("codex-app-server 错误: Missing environment variable: `DEEPSEEK_KEY`")).toBe("missing_env");
41
41
  expect(classifyDeterministicFailure("spawn ENOENT")).toBe("binary_missing");
42
42
  expect(classifyDeterministicFailure("401 Unauthorized")).toBe("login_required");
43
+ // #2964 —— 这是生产里真实出现的那一句(agent-node 的 codex-health 生成),
44
+ // 原来的正则在它上面返回 null ⇒ 凭据过期的节点一条告警都发不出去。
45
+ expect(classifyDeterministicFailure(
46
+ "codex-app-server 错误: model login expired: this node's CODEX_HOME (/home/user/.anet/nodes/n/codex-home) needs a fresh login — log in again there: CODEX_HOME=/x codex login. Not taking work until then (do not copy another node's auth.json).",
47
+ )).toBe("login_required");
48
+ expect(classifyDeterministicFailure("model login revoked: this node's CODEX_HOME needs a fresh login")).toBe("login_required");
49
+ // 反例:非登录类的失败不能被吸进来
50
+ expect(classifyDeterministicFailure("model login ok")).toBeNull();
43
51
  expect(classifyDeterministicFailure("codex request 'turn/start' timed out")).toBeNull();
44
52
  // #2891 —— 额度耗尽单列一类;限流(会自愈)**不能**混进来
45
53
  expect(classifyDeterministicFailure("opencode 错误: 模型调用失败(provider.quota: The usage limit has been reached)")).toBe("quota_exhausted");
@@ -27,7 +27,13 @@ const PATTERNS: Array<{ category: Category; re: RegExp; label: string; hint: str
27
27
  hint: "在节点所在机器补上该变量后重启节点(anet node start <alias>)" },
28
28
  { category: "binary_missing", re: /ENOENT|No such file or directory/i, label: "二进制/文件缺失",
29
29
  hint: "检查该节点的运行时是否安装完整,必要时重装后重启节点" },
30
- { category: "login_required", re: /login required|Unauthorized|\b401\b/i, label: "凭据/登录失效",
30
+ // #2964 —— 真实的登录失效文案长这样(agent-node/src/runtime/codex-health.ts 生成):
31
+ // "model login expired: this node's CODEX_HOME (/…/codex-home) needs a fresh login — log in again there: …"
32
+ // 原来的 /login required|Unauthorized|\b401\b/ **匹配不到这一句**:它写的是
33
+ // "needs a fresh login",不是 "login required"。实测 2026-10-29 一个凭据过期的节点
34
+ // 启动后每轮都以这句话失败,而 #2840 的告警一条都不会发 —— 分类器看不见它。
35
+ // 补两种状态词(expired / revoked)与那句固定结尾,仍然只认登录态,不扩大到泛化的 auth 字样。
36
+ { category: "login_required", re: /login required|Unauthorized|\b401\b|model login (?:expired|revoked)|needs a fresh login/i, label: "凭据/登录失效",
31
37
  hint: "重新登录该节点(anet node codex login-status 可先自检)" },
32
38
  // #2891 —— 额度耗尽:与前三类同性质(不会自愈、必须人处理),但**必须与「限流」分开**。
33
39
  //