diff --git a/scripts/rsshub-zhiyi-fetch.py b/scripts/rsshub-zhiyi-fetch.py index d969032c..1d046235 100644 --- a/scripts/rsshub-zhiyi-fetch.py +++ b/scripts/rsshub-zhiyi-fetch.py @@ -20,6 +20,7 @@ rsshub-zhiyi-fetch.py — RSSHub GitHub AI 内容抓取 → 写入织忆 import json import os import sys +import time import urllib.request import xml.etree.ElementTree as ET from datetime import datetime @@ -40,11 +41,20 @@ SOURCES = [ ("/github/search/AI+agents", "GitHub AI Agents"), ] -def fetch_rss(path): +def fetch_rss(path, retries=3): + """抓取 RSS,带重试。2026-08-05: github.com:443 瞬时抖动曾导致三个源 503,加重试容错。""" url = RSSHUB_BASE + path - req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) - with urllib.request.urlopen(req, timeout=30) as resp: - return resp.read().decode("utf-8", "ignore") + last_exc = None + for attempt in range(retries): + try: + req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) + with urllib.request.urlopen(req, timeout=45) as resp: + return resp.read().decode("utf-8", "ignore") + except Exception as e: + last_exc = e + if attempt < retries - 1: + time.sleep(3 * (attempt + 1)) + raise last_exc def parse_items(xml_text): """解析 RSS 2.0 / Atom,返回 [{title, link, desc}]""" diff --git a/skills/.usage.json b/skills/.usage.json index 48c44ffe..c45bc8e2 100644 --- a/skills/.usage.json +++ b/skills/.usage.json @@ -510,14 +510,14 @@ "archived_at": null, "created_at": "2026-07-28T14:02:19.195060+00:00", "created_by": "agent", - "last_patched_at": "2026-08-03T14:02:56.602777+00:00", - "last_used_at": "2026-08-03T14:02:48.782592+00:00", - "last_viewed_at": "2026-08-03T14:02:48.733419+00:00", - "patch_count": 5, + "last_patched_at": "2026-08-05T14:02:32.841670+00:00", + "last_used_at": "2026-08-05T14:02:28.542800+00:00", + "last_viewed_at": "2026-08-05T14:02:28.539531+00:00", + "patch_count": 6, "pinned": false, "state": "active", - "use_count": 6, - "view_count": 6 + "use_count": 7, + "view_count": 7 }, "design-feasibility-review": { "archived_at": null, diff --git a/skills/productivity/daily-recap/SKILL.md b/skills/productivity/daily-recap/SKILL.md index d1d7b3ca..813eb00c 100644 --- a/skills/productivity/daily-recap/SKILL.md +++ b/skills/productivity/daily-recap/SKILL.md @@ -37,6 +37,13 @@ tags: [复盘, 每日, 自动化] 6. **发送** 通过飞书 `send_message`(或直接返回)将报告推送给用户。 ## 常见陷阱 +- 会话记录为空时 → 使用占位文本 “暂无会话记录”。 +- 守护日志文件过大 → 只读取最近 100 行,以防 `read_file` 超限。 +- 心迹日志可能缺少 `type` 字段 → 默认视为 `moment`,安全提取 `content`。 +- 若任何来源为空,报告仍保持完整结构,使用占位文本。 +- **新增**:确保会话记录功能已启用,否则 `session_search` 返回空,报告会缺失关键信息。请在 Hermes 配置中打开 `session_logging`。 +- 若报告重复出现步骤说明,检查 SKILL.md 是否出现重复段落,必要时删除冗余。 + - 会话记录为空时 → 使用占位文本 “暂无会话记录”。 - 守护日志文件过大 → 只读取最近 100 行,以防 `read_file` 超限。 - 心迹日志可能缺少 `type` 字段 → 默认视为 `moment`,安全提取 `content`。