fix: 过滤权限变更通知,不写入相关智能纪要

This commit is contained in:
Benature
2026-11-29 20:47:55 +08:00
parent e2efcf900e
commit 80b1f10fc5
3 changed files with 24 additions and 6 deletions

View File

@ -43,6 +43,11 @@ def _extract_topic(text: str) -> str:
return match.group(1).strip() if match else ""
def _drop_permission_change(links: list[dict[str, Any]]) -> list[dict[str, Any]]:
"""Permission-change notices carry no title and are not new minutes."""
return [link for link in links if "permission_change" not in link["url"]]
def fetch_ai_notes_links(
client: Any,
target_day: date,
@ -104,10 +109,12 @@ def fetch_ai_notes_links(
# If we found links locally, return them sorted
if links:
links.sort(key=lambda x: x["create_time"])
return links
return _drop_permission_change(links)
# Otherwise pull from network
return _fetch_ai_notes_links_from_network(client, target_day, tz, chat_id, storage)
return _drop_permission_change(
_fetch_ai_notes_links_from_network(client, target_day, tz, chat_id, storage)
)
def _fetch_ai_notes_links_from_network(