dsh-cyber-im-avatar 0.18.1 → 0.18.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.
- package/README.md +2 -1
- package/lib/poller.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,7 +171,8 @@ agent 在这一轮里自己用 `lark-cli` 拉上下文、去绑定工作区核
|
|
|
171
171
|
判定在独立的**值守台**:cwd `<state.dir>/duty/`,私有、不注册工作区;插件安装/启动时
|
|
172
172
|
写入初始 `policy.md`(缺/空才补,已有内容不覆盖)。每次判断**新建会话、无历史**,agent 只写
|
|
173
173
|
`decisions/<event_id>.json`,插件校验后执行。`trial_hours=0` 默认关(严格两段式);
|
|
174
|
-
`session_max_turns` 保留为兼容键但不再生效;`max_group_members=10`(0
|
|
174
|
+
`session_max_turns` 保留为兼容键但不再生效;`max_group_members=10`(0=不限)只数人;自动路径在起分诊会话前先查人数,超过/未知
|
|
175
|
+
直接 ignore,不花 token;手动可强制。
|
|
175
176
|
`GET /api/duty` 看候选,`POST /api/duty/triage` 手动重判。详细契约见
|
|
176
177
|
`docs/specs/contracts/01-api.md`、`02-storage.md`、`03-config.md`。
|
|
177
178
|
|
package/lib/poller.js
CHANGED
|
@@ -953,6 +953,26 @@ export class Poller {
|
|
|
953
953
|
}
|
|
954
954
|
return { ok: false, reason: early.error };
|
|
955
955
|
}
|
|
956
|
+
// 自动路径先在插件侧筛人数:超过上限、或平台根本给不出人数时,agent 只能 ignore,
|
|
957
|
+
// 没必要为一次注定 ignore 的判断起 turn 花 token。手动事件保留(用户显式要求)。
|
|
958
|
+
const limit = Number(this.dutyCfg().max_group_members) || 0;
|
|
959
|
+
if (!review && d.trigger !== "manual") {
|
|
960
|
+
let count = Number(chat.duty.member_count) || 0;
|
|
961
|
+
if (!count) count = await this.memberCountFor(chat);
|
|
962
|
+
if (limit > 0 && (count === 0 || count > limit)) {
|
|
963
|
+
d.state = "ignore";
|
|
964
|
+
d.by = "system";
|
|
965
|
+
d.decided_at = nowSec();
|
|
966
|
+
d.reason = count > 0
|
|
967
|
+
? `群成员 ${count} 超过自动上限 ${limit}`
|
|
968
|
+
: "群成员数未知,自动只能 ignore";
|
|
969
|
+
d.review_at = 0;
|
|
970
|
+
d.error = "";
|
|
971
|
+
d.attempts = 0;
|
|
972
|
+
this.state.save();
|
|
973
|
+
return { ok: true, skipped: count > 0 ? "group_too_large" : "member_unknown", count };
|
|
974
|
+
}
|
|
975
|
+
}
|
|
956
976
|
d.state = "triaging";
|
|
957
977
|
d.attempts = Math.max(0, Number(d.attempts) || 0) + 1;
|
|
958
978
|
if (!review) d.triaged_at = nowSec();
|
package/package.json
CHANGED