Files
taojianmin f38f662316
All checks were successful
技能自动化发布 / release (push) Successful in 8s
v1.1.5: platform_collector 修复登录等待太短导致采集不到数据
问题:sandbox RPA 采集时,给用户登录态的等待时间太短(settle_ms=0 /
input timeout=10s / wait_for_url 20s / click 后 0ms 路由稳定时间),SPA
异步跳转被打断,session 没保住,最终 40s 内找不到表格、fetched_rows=0。

修复(核心 5 处):
- _fill_spa_login:settle_ms 默认 4000ms、input timeout 20s、wait_for_url 30s、
  URL 判断覆盖 /auth/ 中间态
- _goto(SPA_LOGIN_URL) 后 wait 3000ms(SPA hydration)
- 登录按钮 click 后 wait 2000ms(等 token 写入 cookie 再 goto home)
- 步骤 4 改为 retry 循环(最多 2 次)
- 步骤 5.6:刷新后若 URL 在 /login 重新登录一次

健壮性修复(5 处):
- 侧边栏 link 等待 15s → 30s
- reload timeout 20s → 30s
- 「续聘材料包」click 后 wait 1500ms → 3000ms
- 抽出 _dump_page helper,自动 mkdir(parents=True) 修 5 处 dump 父目录缺失
- 移除残留 dump_path / html 引用

版本对齐:
- SKILL.md version 1.1.4 → 1.1.5
- constants.py SKILL_VERSION 1.1.4 → 1.1.5
- CHANGELOG.md 加 1.1.5 条目

测试:21/21 通过

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-14 17:06:28 +08:00

46 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""技能标识、版本与阈值常量。
复制到新 skill 时必须修改:
- SKILL_SLUG 与 SKILL.md metadata.openclaw.slug 保持一致
- SKILL_VERSION 与 SKILL.md version 保持一致
"""
SKILL_SLUG = "alert-contract-expiring-hr"
SKILL_VERSION = "1.1.5"
LOG_LOGGER_NAME = "openclaw.skill.alert_contract_expiring_hr"
PLATFORM_KIT_MIN_VERSION = "1.2.11"
# 预警阈值(黄/橙/红):距到期日 <= yellow 天 = 黄色预警
# 顺序:red < orange < yellow
DEFAULT_THRESHOLDS = (90, 60, 30)
# 预警等级名称(与 thresholds 顺序一一对应)
ALERT_LEVELS = ("yellow", "orange", "red")
ALERT_LEVEL_LABELS = {"yellow": "黄色", "orange": "橙色", "red": "红色"}
# 续聘建议
SUGGESTIONS = ("renew", "observe", "non_renew")
SUGGESTION_LABELS = {
"renew": "建议续聘",
"observe": "常规续聘评审",
"non_renew": "不建议续聘",
}
# 合同状态
CONTRACT_STATUSES = ("可续聘", "预警中", "已续签", "已驳回", "已过期", "已撤回")
# 续签材料清单
DEFAULT_MATERIALS = [
"近 3 年年度考核表(盖章)",
"师德师风考评记录",
"学历学位证书复印件",
"岗位聘任登记表",
"劳动合同文本(一式三份)",
"个人述职报告(不少于 2000 字)",
]
# AI 续聘建议规则阈值
MORAL_FAIL_THRESHOLD = 60 # 师德 < 60 直接 non_renew
PERFORMANCE_FAIL_THRESHOLD = 60 # 单年考核 < 60 算不合格
PERFORMANCE_RENEW_MIN = 80 # 全部 >= 80 且逐年上升 → renew