refactor: convert to Lark Snooper script project
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
# LarkSniffer / 上游 LarkAgentX 共用数据目录(凭证和消息数据库)
|
||||
# Lark Snooper / 上游 LarkAgentX 共用数据目录(凭证和消息数据库)
|
||||
LARKX_HOME=~/.larkx
|
||||
LARKX_REGION=feishu
|
||||
# 留空 = ~/.larkx/messages.db;也可填 SQLAlchemy 连接串
|
||||
|
||||
100
README.md
100
README.md
@ -1,28 +1,50 @@
|
||||
# LarkSniffer
|
||||
# Lark Snooper
|
||||
|
||||
基于 [LarkAgentX](https://github.com/cv-cat/LarkAgentX) 的飞书历史消息同步与每日中文工作总结。LarkSniffer 是独立 Python 包,**不内置、不修改上游 `larkx` 源码**。
|
||||
基于 [LarkAgentX](https://github.com/cv-cat/LarkAgentX) 的飞书历史消息同步与每日中文工作总结。
|
||||
|
||||
上游固定为 commit `97ad48e69e34bd8c78ee30f795b7c3759dd81659`,通过 Git 依赖安装。自有功能位于 `larksniffer/`:
|
||||
Lark Snooper 是**独立脚本项目**:不内置或修改上游源码,也不把自身封装成 Python 包。只有 LarkAgentX 和其他运行库作为外部依赖安装到虚拟环境。
|
||||
|
||||
- 枚举可见 INBOX 会话,按自然日和 position 同步历史消息。
|
||||
- 只筛选 `direction=in` 的消息,按群聊或私聊分别总结,再合并日度总结。
|
||||
- 所有分块、对话摘要和最终汇总只允许实际模型段以大写 `EFundGPT` 开头,禁止跨模型回退。
|
||||
- 获取相关会话发送者和群成员,唯一匹配时补全姓名;重名或不确定时不猜。
|
||||
- 输出 Obsidian Wikilink:确认的人名为 `[[完整姓名]]`,会话来源为 `[[会话名]]`;标题井号后有空格,不生成 `#tag`。
|
||||
- Dry-run、私有 Markdown/JSON 输出、YAML 路径配置。
|
||||
上游固定为 commit `97ad48e69e34bd8c78ee30f795b7c3759dd81659`。
|
||||
|
||||
## 项目结构
|
||||
|
||||
```text
|
||||
lark_snooper.py # 唯一命令入口
|
||||
snooper_client.py # 上游客户端扩展
|
||||
snooper_storage.py # 上游存储查询扩展
|
||||
snooper_history.py # 按日期同步历史
|
||||
snooper_summary.py # 分组总结、模型校验、YAML 与 Obsidian 输出
|
||||
snooper_contacts.py # 相关会话通讯录
|
||||
requirements.txt # 运行依赖
|
||||
overrides.txt # Python 3.13 的上游依赖覆盖
|
||||
config.yaml # 本地输出配置(Git 忽略)
|
||||
tests/ # 全合成测试
|
||||
```
|
||||
|
||||
## 安装
|
||||
|
||||
需要 Python 3.10+ 和 [uv](https://docs.astral.sh/uv/):
|
||||
|
||||
```bash
|
||||
uv sync
|
||||
uv venv
|
||||
uv pip install --python .venv/bin/python \
|
||||
--override overrides.txt -r requirements.txt
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
联网执行 `uv sync` 会生成 `uv.lock` 锁定依赖。上游固定 `SQLAlchemy==2.0.30`,本项目仅通过 uv override 使用兼容 Python 3.13 的 `SQLAlchemy>=2.0.36,<2.1`,不复制或 patch 上游代码。
|
||||
开发工具:
|
||||
|
||||
升级旧结构时必须重新执行 `uv sync`,以安装新的 `larksniffer` 命令和外部 `larkx` 依赖。
|
||||
```bash
|
||||
uv pip install --python .venv/bin/python -r requirements-dev.txt
|
||||
```
|
||||
|
||||
运行脚本前激活虚拟环境:
|
||||
|
||||
```bash
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
上游固定 `SQLAlchemy==2.0.30`,这里只通过 uv override 使用兼容 Python 3.13 的 `SQLAlchemy>=2.0.36,<2.1`,不复制或 patch 上游代码。
|
||||
|
||||
## 配置
|
||||
|
||||
@ -50,15 +72,15 @@ MAGPIE_API_KEY=
|
||||
.venv/bin/lark auth check
|
||||
```
|
||||
|
||||
LarkSniffer 不提供 coding agent,也不需要为日度总结常驻 `listen`。
|
||||
Lark Snooper 不提供 coding agent,也不需要为日度总结常驻 `listen`。
|
||||
|
||||
### 2. 生成总结
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer summarize --date today
|
||||
.venv/bin/larksniffer summarize --date yesterday
|
||||
.venv/bin/larksniffer summarize --date 2026-11-04
|
||||
.venv/bin/larksniffer summarize --date today --chat '<chat_id>'
|
||||
./lark_snooper.py summarize --date today
|
||||
./lark_snooper.py summarize --date yesterday
|
||||
./lark_snooper.py summarize --date 2026-11-04
|
||||
./lark_snooper.py summarize --date today --chat '<chat_id>'
|
||||
```
|
||||
|
||||
默认流程:
|
||||
@ -72,43 +94,43 @@ EFundGPT 完整路由预检
|
||||
→ 合并最终日度总结
|
||||
```
|
||||
|
||||
同步有失败会话时停止后续总结,避免生成不完整日报。`--check` 只检查模型,不同步或读取消息。
|
||||
同步有失败会话时停止后续总结,避免生成不完整日报。
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer summarize --check
|
||||
```
|
||||
# 只检查模型,不同步或读取消息
|
||||
./lark_snooper.py summarize --check
|
||||
|
||||
明确只读本地库、不获取通讯录:
|
||||
# 明确只读本地库
|
||||
./lark_snooper.py summarize --date today --no-fetch
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer summarize --date today --no-fetch
|
||||
.venv/bin/larksniffer summarize --date today --no-contacts
|
||||
# 不获取相关会话通讯录
|
||||
./lark_snooper.py summarize --date today --no-contacts
|
||||
```
|
||||
|
||||
### 3. Dry-run
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer summarize --date today --dry-run
|
||||
./lark_snooper.py summarize --date today --dry-run
|
||||
```
|
||||
|
||||
Dry-run 默认同样先同步并入库,但只导出筛选后的 JSON,**不调用模型、不获取通讯录、不在终端显示正文**。只导出本地已有数据:
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer summarize --date today --dry-run --no-fetch
|
||||
./lark_snooper.py summarize --date today --dry-run --no-fetch
|
||||
```
|
||||
|
||||
### 4. 仅同步历史
|
||||
|
||||
```bash
|
||||
.venv/bin/larksniffer history --all --date today --save --count 50
|
||||
.venv/bin/larksniffer history --all --date yesterday --save --count 50
|
||||
./lark_snooper.py history --all --date today --save --count 50
|
||||
./lark_snooper.py history --all --date yesterday --save --count 50
|
||||
```
|
||||
|
||||
每批 position 数量由 `--count` 控制,不是消息总量上限;遇到早于目标自然日的消息即停止。
|
||||
|
||||
## YAML 输出配置
|
||||
## `config.yaml` 输出配置
|
||||
|
||||
当前目录存在 `larksniffer.yaml` 时自动读取,也可用 `--config` 指定。该文件被 Git 忽略,可安全保存本机绝对路径:
|
||||
当前目录存在 `config.yaml` 时自动读取,也可用 `--config` 指定。该文件被 Git 忽略,可保存本机绝对路径:
|
||||
|
||||
```yaml
|
||||
output:
|
||||
@ -120,24 +142,28 @@ output:
|
||||
|
||||
同一天重复运行会覆盖同路径的 Markdown/JSON;需要保留版本时使用不同的 `--output`。数据库按 `chat_id + msg_id` 去重,但默认仍会重新同步和调用模型。
|
||||
|
||||
## 姓名与 Obsidian
|
||||
|
||||
- 只获取相关会话发送者和群成员,不抓取无关企业通讯录。
|
||||
- 只有唯一匹配时才补全简称;重名、名单不足或不确定时保留原称呼。
|
||||
- 确认的完整姓名确定性输出为 `[[完整姓名]]`,不会重复包裹已有链接。
|
||||
- 会话来源使用 `[[会话名]]`。
|
||||
- 标题井号后有空格,不生成 `#tag` 等 Obsidian 标签。
|
||||
|
||||
## 隐私边界
|
||||
|
||||
- 真实消息、通讯录和对话摘要只进入经校验的 EFundGPT 模型链路。
|
||||
- 请求前检查 `/models`,发送前和响应后均校验实际模型段。
|
||||
- 请求前检查 `/models`,发送前和响应后均校验实际模型段,禁止跨模型回退。
|
||||
- HTTP 错误不打印可能回显消息的响应体,终端只输出路径和统计数。
|
||||
- 通讯录只覆盖相关会话发送者和群成员,不抓取无关企业通讯录。
|
||||
- 原始消息、通讯录、分块结果和对话摘要在提示词中均视为不可信数据。
|
||||
- 原始消息、通讯录、分块结果和对话摘要均视为不可信数据。
|
||||
- Dry-run 和总结文件可能包含敏感内容,仅应保存在受信任的本地位置。
|
||||
|
||||
## 开发
|
||||
|
||||
```bash
|
||||
uv sync
|
||||
.venv/bin/python -m pytest -q
|
||||
.venv/bin/ruff check larksniffer tests
|
||||
.venv/bin/ruff check lark_snooper.py snooper_*.py tests
|
||||
git diff --check
|
||||
```
|
||||
|
||||
测试全部使用合成消息和伪造模型响应,不读取真实数据库或凭证。
|
||||
|
||||
上游 LarkAgentX 的认证、协议和基础存储由 Git 依赖提供;本仓库只维护 LarkSniffer 自己的同步、总结、通讯录、CLI 和测试。
|
||||
|
||||
23
larksniffer/cli.py → lark_snooper.py
Normal file → Executable file
23
larksniffer/cli.py → lark_snooper.py
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
"""LarkSniffer CLI; upstream LarkAgentX remains a separate dependency."""
|
||||
#!/usr/bin/env python3
|
||||
"""Lark Snooper CLI; LarkAgentX is an external dependency."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
@ -8,8 +9,8 @@ from datetime import datetime
|
||||
|
||||
from larkx.auth import LarkAuth
|
||||
|
||||
from .client import SnifferLarkClient as LarkClient
|
||||
from .storage import SnifferStorage as Storage
|
||||
from snooper_client import SnifferLarkClient as LarkClient
|
||||
from snooper_storage import SnifferStorage as Storage
|
||||
|
||||
|
||||
def _print_json(value):
|
||||
@ -21,15 +22,15 @@ def cmd_history(args):
|
||||
if args.all or args.date:
|
||||
if not args.all or not args.date or args.chat_id or args.start is not None:
|
||||
print(
|
||||
"按日期批量拉取用法: larksniffer history --all --date today --save",
|
||||
"按日期批量拉取用法: ./lark_snooper.py history --all --date today --save",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 2
|
||||
if not args.save or args.json:
|
||||
print("按日期批量拉取必须 --save,且不支持 --json(不输出正文)", file=sys.stderr)
|
||||
return 2
|
||||
from .history import HistoryError, sync_all_chats_for_day
|
||||
from .summary import SummaryError, resolve_day
|
||||
from snooper_history import HistoryError, sync_all_chats_for_day
|
||||
from snooper_summary import SummaryError, resolve_day
|
||||
|
||||
try:
|
||||
target_day, _, _, tz = resolve_day(args.date, "Asia/Shanghai")
|
||||
@ -93,7 +94,7 @@ def cmd_history(args):
|
||||
|
||||
|
||||
def cmd_summarize(args):
|
||||
from .summary import (
|
||||
from snooper_summary import (
|
||||
DEFAULT_BASE_URL,
|
||||
DEFAULT_MODEL,
|
||||
DEFAULT_TIMEZONE,
|
||||
@ -129,7 +130,7 @@ def cmd_summarize(args):
|
||||
output_config = {} if args.output else load_output_config(getattr(args, "config", None))
|
||||
storage = Storage()
|
||||
if not args.no_fetch:
|
||||
from .history import sync_all_chats_for_day
|
||||
from snooper_history import sync_all_chats_for_day
|
||||
|
||||
try:
|
||||
fetch_stats = sync_all_chats_for_day(
|
||||
@ -174,7 +175,7 @@ def cmd_summarize(args):
|
||||
return 0
|
||||
contacts = None
|
||||
if rows and not args.no_contacts:
|
||||
from .contacts import ContactsError, fetch_contacts
|
||||
from snooper_contacts import ContactsError, fetch_contacts
|
||||
|
||||
try:
|
||||
contacts = fetch_contacts(LarkClient(LarkAuth()), rows)
|
||||
@ -208,7 +209,7 @@ def cmd_summarize(args):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="larksniffer", description="LarkAgentX 历史同步与 EFundGPT 日度总结"
|
||||
prog="lark_snooper.py", description="LarkAgentX 历史同步与 EFundGPT 日度总结"
|
||||
)
|
||||
subparsers = parser.add_subparsers(dest="cmd", required=True)
|
||||
|
||||
@ -232,7 +233,7 @@ def main():
|
||||
summarize.add_argument("--max-chars", type=int, default=80000, help="每个对话内每块消息最大字符数")
|
||||
summarize.add_argument("--no-contacts", action="store_true", help="不联网获取相关会话通讯录")
|
||||
summarize.add_argument("--no-fetch", action="store_true", help="只读取本地已入库记录")
|
||||
summarize.add_argument("--config", help="YAML 配置路径;默认读取当前目录 larksniffer.yaml")
|
||||
summarize.add_argument("--config", help="YAML 配置路径;默认读取当前目录 config.yaml")
|
||||
summarize.add_argument("-o", "--output", help="输出路径,优先级高于 YAML")
|
||||
mode = summarize.add_mutually_exclusive_group()
|
||||
mode.add_argument("--check", action="store_true", help="只检查模型,不同步或读取消息")
|
||||
@ -1,3 +0,0 @@
|
||||
"""LarkSniffer: LarkAgentX-based history sync and private daily summaries."""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
2
overrides.txt
Normal file
2
overrides.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# 仅为 Python 3.13 覆盖上游 SQLAlchemy==2.0.30 固定版本。
|
||||
SQLAlchemy>=2.0.36,<2.1
|
||||
@ -1,36 +0,0 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=64"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "larksniffer"
|
||||
version = "0.1.0"
|
||||
description = "基于 LarkAgentX 的飞书历史同步与 EFundGPT 日度总结"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"larkx @ git+https://github.com/cv-cat/LarkAgentX.git@97ad48e69e34bd8c78ee30f795b7c3759dd81659",
|
||||
"PyYAML==6.0.2",
|
||||
"requests==2.31.0",
|
||||
"SQLAlchemy>=2.0.36,<2.1",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
mysql = ["PyMySQL==1.1.0"]
|
||||
|
||||
[project.scripts]
|
||||
larksniffer = "larksniffer.cli:main"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pytest>=8,<9",
|
||||
"ruff>=0.8,<1",
|
||||
]
|
||||
|
||||
# 上游固定 SQLAlchemy==2.0.30;仅为 Python 3.13 兼容性覆盖该传递依赖,
|
||||
# 不修改上游源码;联网执行 uv sync 后生成 uv.lock。
|
||||
[tool.uv]
|
||||
override-dependencies = ["SQLAlchemy>=2.0.36,<2.1"]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["larksniffer*"]
|
||||
2
requirements-dev.txt
Normal file
2
requirements-dev.txt
Normal file
@ -0,0 +1,2 @@
|
||||
pytest>=8,<9
|
||||
ruff>=0.8,<1
|
||||
4
requirements.txt
Normal file
4
requirements.txt
Normal file
@ -0,0 +1,4 @@
|
||||
larkx @ git+https://github.com/cv-cat/LarkAgentX.git@97ad48e69e34bd8c78ee30f795b7c3759dd81659
|
||||
PyYAML==6.0.2
|
||||
requests==2.31.0
|
||||
SQLAlchemy>=2.0.36,<2.1
|
||||
@ -1,7 +1,6 @@
|
||||
"""Small upstream client extension for visible, date-bounded history sync."""
|
||||
|
||||
from larkx.client import LarkClient
|
||||
|
||||
from larkx.proto import decoders
|
||||
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
"""LarkSniffer-specific queries built on the upstream LarkAgentX storage."""
|
||||
|
||||
from larkx.storage.models import Message
|
||||
from sqlalchemy import asc
|
||||
"""Lark Snooper queries built on the upstream LarkAgentX storage."""
|
||||
|
||||
from larkx.storage import Storage
|
||||
from larkx.storage.models import Message
|
||||
from sqlalchemy import asc
|
||||
|
||||
|
||||
class SnifferStorage(Storage):
|
||||
@ -127,8 +127,8 @@ def resolve_day(day: str | None, timezone: str) -> tuple[date, datetime, datetim
|
||||
|
||||
|
||||
def load_output_config(path: Path | str | None = None) -> dict[str, Any]:
|
||||
"""Safely load output paths, defaulting to optional ./larksniffer.yaml."""
|
||||
config_path = Path(path or "larksniffer.yaml").expanduser()
|
||||
"""Safely load output paths, defaulting to optional ./config.yaml."""
|
||||
config_path = Path(path or "config.yaml").expanduser()
|
||||
if not config_path.exists():
|
||||
if path is not None:
|
||||
raise SummaryError(f"YAML 配置不存在: {config_path}")
|
||||
@ -33,7 +33,7 @@ class FakeClient:
|
||||
|
||||
|
||||
def test_fetch_contacts_scopes_members_to_relevant_chats():
|
||||
from larksniffer.contacts import fetch_contacts
|
||||
from snooper_contacts import fetch_contacts
|
||||
|
||||
client = FakeClient()
|
||||
rows = [
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from datetime import date
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from larksniffer.storage import SnifferStorage as Storage
|
||||
from snooper_storage import SnifferStorage as Storage
|
||||
|
||||
|
||||
class FakeClient:
|
||||
@ -78,7 +78,7 @@ class FakeClient:
|
||||
|
||||
|
||||
def test_sync_all_chats_for_day_saves_only_dated_messages_with_direction():
|
||||
from larksniffer.history import sync_all_chats_for_day
|
||||
from snooper_history import sync_all_chats_for_day
|
||||
|
||||
tz = ZoneInfo("Asia/Shanghai")
|
||||
start_ts = 1_792_000_000
|
||||
|
||||
@ -7,9 +7,9 @@ from zoneinfo import ZoneInfo
|
||||
|
||||
import pytest
|
||||
|
||||
from larksniffer.cli import cmd_summarize
|
||||
from larksniffer.storage import SnifferStorage as Storage
|
||||
from larksniffer.summary import (
|
||||
from lark_snooper import cmd_summarize
|
||||
from snooper_storage import SnifferStorage as Storage
|
||||
from snooper_summary import (
|
||||
DEFAULT_MODEL,
|
||||
MagpieClient,
|
||||
SummaryError,
|
||||
@ -277,9 +277,9 @@ def test_storage_selects_only_received_messages_inside_day_and_chat():
|
||||
|
||||
|
||||
def test_yaml_config_resolves_dated_output_paths(tmp_path):
|
||||
from larksniffer.summary import configured_output_path, load_output_config
|
||||
from snooper_summary import configured_output_path, load_output_config
|
||||
|
||||
config_file = tmp_path / "larksniffer.yaml"
|
||||
config_file = tmp_path / "config.yaml"
|
||||
config_file.write_text(
|
||||
"output:\n"
|
||||
f" summary: '{tmp_path}/summaries/{{date}}.md'\n"
|
||||
@ -327,7 +327,7 @@ def test_cli_end_to_end_with_synthetic_db_and_fake_magpie(
|
||||
session = FakeSession(
|
||||
completions=[(DEFAULT_MODEL, "单对话摘要"), (DEFAULT_MODEL, "# 合成总结")]
|
||||
)
|
||||
monkeypatch.setattr("larksniffer.summary.requests.Session", lambda: session)
|
||||
monkeypatch.setattr("snooper_summary.requests.Session", lambda: session)
|
||||
output = tmp_path / "summary.md"
|
||||
args = argparse.Namespace(
|
||||
date="2026-11-03",
|
||||
@ -374,9 +374,9 @@ def test_cli_dry_run_exports_records_without_calling_model(
|
||||
)
|
||||
monkeypatch.setenv("LARKX_STORAGE_URL", database_url)
|
||||
session = FakeSession(completions=[(DEFAULT_MODEL, "不应生成")])
|
||||
monkeypatch.setattr("larksniffer.summary.requests.Session", lambda: session)
|
||||
monkeypatch.setattr("snooper_summary.requests.Session", lambda: session)
|
||||
output = tmp_path / "from-yaml" / "2026-11-03.json"
|
||||
config_file = tmp_path / "larksniffer.yaml"
|
||||
config_file = tmp_path / "config.yaml"
|
||||
config_file.write_text(
|
||||
f"output:\n dry_run: '{tmp_path}/from-yaml/{{date}}.json'\n",
|
||||
encoding="utf-8",
|
||||
@ -407,16 +407,16 @@ def test_cli_dry_run_exports_records_without_calling_model(
|
||||
|
||||
|
||||
def test_cli_summarize_prefetches_before_reading(tmp_path, monkeypatch):
|
||||
from larksniffer.summary import resolve_day as resolve_summary_day
|
||||
from snooper_summary import resolve_day as resolve_summary_day
|
||||
|
||||
database_url = f"sqlite:///{tmp_path / 'synthetic.db'}"
|
||||
monkeypatch.setenv("LARKX_STORAGE_URL", database_url)
|
||||
session = FakeSession(
|
||||
completions=[(DEFAULT_MODEL, "单对话摘要"), (DEFAULT_MODEL, "# 合成总结")]
|
||||
)
|
||||
monkeypatch.setattr("larksniffer.summary.requests.Session", lambda: session)
|
||||
monkeypatch.setattr("larksniffer.cli.LarkClient", lambda auth: object())
|
||||
monkeypatch.setattr("larksniffer.cli.LarkAuth", lambda: object())
|
||||
monkeypatch.setattr("snooper_summary.requests.Session", lambda: session)
|
||||
monkeypatch.setattr("lark_snooper.LarkClient", lambda auth: object())
|
||||
monkeypatch.setattr("lark_snooper.LarkAuth", lambda: object())
|
||||
sync_calls = []
|
||||
|
||||
def fake_sync(client, storage, target_day, tz, batch_size=50, chat_ids=None):
|
||||
@ -438,7 +438,7 @@ def test_cli_summarize_prefetches_before_reading(tmp_path, monkeypatch):
|
||||
sync_calls.append({"batch_size": batch_size, "chat_ids": chat_ids})
|
||||
return {"failed": 0, "matched": 1, "saved": 1, "chats": 1, "requests": 1}
|
||||
|
||||
monkeypatch.setattr("larksniffer.history.sync_all_chats_for_day", fake_sync)
|
||||
monkeypatch.setattr("snooper_history.sync_all_chats_for_day", fake_sync)
|
||||
output = tmp_path / "summary.md"
|
||||
args = argparse.Namespace(
|
||||
date="2026-11-03",
|
||||
@ -471,7 +471,7 @@ def test_cli_model_failure_happens_before_storage_is_opened(monkeypatch):
|
||||
def storage_must_not_open():
|
||||
raise AssertionError("模型检查失败时不应打开消息库")
|
||||
|
||||
monkeypatch.setattr("larksniffer.cli.Storage", storage_must_not_open)
|
||||
monkeypatch.setattr("lark_snooper.Storage", storage_must_not_open)
|
||||
args = argparse.Namespace(
|
||||
date="2026-11-03",
|
||||
timezone="Asia/Shanghai",
|
||||
|
||||
Reference in New Issue
Block a user