Commit Graph
1953 Commits
Author SHA1 Message Date
InfinityPacerandjxxghp be7dfd77a3 fix(runtime): 收敛模块关闭线程所有权 (#6443)
* fix(runtime): bound module shutdown owners

* fix(runtime): declare blocking shutdown owners

---------

Co-authored-by: jxxghp <jxxghp@gmail.com>
2026-08-25 06:58:31 +08:00
jxxghp 415335b215 refactor: unify message channel shutdown convergence 2026-08-24 14:08:06 +08:00
jxxghp 009631b8ee refactor: unify capability shutdown convergence 2026-08-24 13:48:11 +08:00
jxxghp af9a141f34 fix: isolate feishu websocket event loops 2026-08-24 12:54:06 +08:00
jxxghp 2274a354dc fix: retain discord typing task owners 2026-08-24 09:43:17 +08:00
jxxghp ecbd39a0bb fix: isolate telegram typing lifecycle 2026-08-24 08:51:49 +08:00
Aqr-K 4a5958c3c2 fix(modules): 默认服务配置改为尊重显式标记,不再按读取顺序取第一个 (#6431) 2026-08-24 08:03:28 +08:00
jxxghp 1047bfa821 refactor: unify emby family item formatting 2026-08-24 06:08:04 +08:00
jxxghp 8555d0da3e refactor: use explicit system config getter 2026-08-24 04:04:35 +08:00
jxxghp 371383f0a8 refactor: unify host threadpool boundary 2026-08-24 03:28:10 +08:00
jxxghp e1230c0277 refactor: unify message ingress forwarding 2026-08-24 03:01:17 +08:00
jxxghp 52fd495d38 refactor: normalize downloader file contracts 2026-08-24 02:10:04 +08:00
jxxghp 9ce4533761 refactor: own fanart cache cleanup 2026-08-24 00:37:09 +08:00
jxxghp 6b65dc5d12 refactor: unify module runtime settings 2026-08-24 00:19:57 +08:00
InfinityPacer f64030a074 fix(imports): use concrete modules for internal symbols (#6427) 2026-08-23 21:28:37 +08:00
InfinityPacer 7d10483961 fix(discord): preserve cleanup during startup stop (#6426) 2026-08-23 21:28:12 +08:00
InfinityPacer c72b4fe88e fix(discord): close bot event loop on shutdown (#6421) 2026-08-23 20:11:13 +08:00
jxxghp ba193cce08 fix(imdb): register async cache cleanup 2026-08-23 15:29:42 +08:00
InfinityPacer e8cfe272c4 fix(async): offload file metadata checks 2026-08-23 12:06:52 +08:00
SayItDitto b1a55b76e5 feat: 用户数据解析器自动探测 + Gazelle/NexusProject 变种兼容 (#6403) 2026-08-23 09:13:55 +08:00
jxxghp baf4e883b2 refactor: route storage adapter settings through runtime 2026-08-23 03:25:08 +08:00
jxxghp c89066d96f refactor: route media source settings through runtime 2026-08-23 03:20:03 +08:00
jxxghp 061a92eab0 refactor: route chat and subtitle settings through runtime 2026-08-23 03:17:40 +08:00
jxxghp 55c80c87da refactor: route indexer module settings through runtime 2026-08-23 03:15:21 +08:00
jxxghp dd6405389c refactor: route storage module settings through runtime 2026-08-23 03:12:51 +08:00
jxxghp ac32adc7b6 refactor: route media and chat module settings through runtime 2026-08-23 03:09:59 +08:00
jxxghp 4098cc1eec refactor: route music module settings through runtime 2026-08-23 03:03:26 +08:00
jxxghp 4641db7f5b refactor: route metadata module settings through runtime 2026-08-23 03:01:29 +08:00
InfinityPacer d131f8d571 feat(network): migrate async HTTP client to HTTPX2 (#6394) 2026-08-22 16:48:23 +08:00
jxxghp c765604b36 feat(notification): add DingTalk robot channel 2026-08-22 12:02:24 +08:00
jxxghp 1a7c3cfff8 feat(media): add native IMDb source module 2026-08-22 11:22:59 +08:00
jxxghp 9273d68aa7 feat(telegram): support rich Agent messages 2026-08-22 10:11:18 +08:00
jxxghp 97d2dcd7fb fix(ci): align architecture and pylint gates 2026-08-22 08:50:25 +08:00
jxxghp ff0ce8d1c1 refactor: add configuration dependency ratchet 2026-08-21 21:20:56 +08:00
InfinityPacer 307d54bf68 fix(acoustid): accept non-fatal fpcalc output (#6362) 2026-08-19 22:44:35 +08:00
InfinityPacer f700db5ac8 feat(database): add managed backup and offline restore (#6359) 2026-08-19 17:34:32 +08:00
jxxghp 8472bcff43 refactor: 收口 V3 分层架构与插件兼容边界 2026-08-18 13:22:02 +08:00
jxxghp 5128ae9e1e refactor: 推进后端分层架构治理 2026-08-18 00:29:14 +08:00
jxxghp 23ca70fa37 fix(acoustid): 测试函数独立检测本地 fpcalc 依赖而非仅校验网络
原先 test() 依赖 init_module() 一次性缓存的 self._fpcalc_path,初始化之后再安装或移除 fpcalc 都不会反映在测试结果中,导致 UI 测试可能错误显示为通过。

- 抽出静态方法 _resolve_fpcalc() 基于 shutil.which 定位可执行 fpcalc,init_module() 复用
- test() 每次自行重新定位 fpcalc,缺失则直接失败且不发起网络请求,并写回 self._fpcalc_path
- 新增 3 个回归用例覆盖本地依赖检测与独立于 init 缓存的行为
2026-08-17 11:07:13 +08:00
jxxghp 1402626a4a refactor(tmdb): 空结果缓存过期时间收敛为设置项 EMPTY_RESULT_CACHE_TTL
- ConfigModel TMDB 配置区新增 EMPTY_RESULT_CACHE_TTL(默认 30 分钟),支持环境变量覆盖
- request/async_request/discover/TmdbCache 统一改读 settings,移除模块级常量与跨模块导入
2026-08-16 21:20:32 +08:00
jxxghp fa06a4ac03 fix(tmdb): 空结果缓存使用独立短 TTL,故障恢复后快速自愈,关闭 #6332
- cached 装饰器新增 empty_ttl/empty_if,空结果按独立短 TTL 写入
- TMDB request/async_request/discover 空结果快照 30 分钟过期
- TmdbCache 未识别负缓存(id=0)同步改用 30 分钟短 TTL,正缓存不变
2026-08-16 20:50:55 +08:00
jxxghp 54f093a099 Merge remote-tracking branch 'origin/v3' into v3
# Conflicts:
#	app/api/endpoints/agent.py
#	app/api/endpoints/anthropic.py
#	app/api/endpoints/openai.py
#	app/chain/__init__.py
#	app/chain/message.py
#	app/chain/site.py
#	app/chain/subscribe.py
#	app/chain/transfer.py
#	app/modules/discord/__init__.py
#	app/modules/qqbot/__init__.py
#	app/modules/slack/__init__.py
#	app/modules/telegram/__init__.py
#	app/modules/wechat/__init__.py
#	app/runtime/extensions/module_manager.py
#	app/runtime/extensions/service_registry.py
#	tests/test_agent_interaction.py
#	tests/test_slash_command_interactions.py
#	tests/test_web_agent_stream.py
2026-08-16 19:44:43 +08:00
jxxghp 240a4dffe6 refactor(schemas): 统一 message/notification 命名边界,旧名收敛至兼容映射表
- notification 域:渠道能力(MessageChannel→NotificationChannel、ChannelCapability* 迁入 notification.py)
- message 域:消息收发(Notification→Message、NotificationType→MessageType、CommingMessage→IncomingMessage、NotificationHistoryItem→MessageHistoryItem、NotificationClear*→MessageClear*)
- Agent 工具契约:send_notification_message→send_message、notification_callback→message_callback
- 源码不保留旧名物理别名,旧导入经 app/runtime/compat/manifest.py SYMBOL_ALIASES 惰性解析
- API 路径与持久化键冻结不变,前端零改动
- 新增兼容守护测试与 docs/rules/07 命名边界规范
2026-08-16 19:32:20 +08:00
jxxghp 5810f6bc2b refactor(application): filter_rules.py 更名 rules.py 并合并 RuleHelper
规则域收敛为单一事实来源 app/application/rules.py:
- filter_rules.py 更名为 rules.py(内置规则集 + RuleParser)
- filter.py 仅含 66 行 RuleHelper(用户规则组配置访问),并入 rules.py
- 同步更新 5 处引用方导入、nettest stub 目标与架构文档
- 兼容映射 app.helper.rule 指向新路径,legacy 导入仍可用
2026-08-16 17:13:51 +08:00
jxxghp 6424f76e70 fix(notification): 飞书/QQ/爪爪机器人跳过命令注册,修复 AttributeError
通知基类默认命令注册钩子调用 client.register_commands,但飞书 lark_oapi、
QQBot、WechatClawBot 客户端均无命令注册/删除 API(飞书机器人无斜杠命令概念),
启动时 FeishuModule.register_commands 抛 AttributeError。

三个模块覆写 _commands_enabled 返回 False 跳过注册,与企业微信走菜单 API
的钩子模式一致;Telegram/Slack/Discord 客户端具备该 API,不受影响。
2026-08-16 16:56:53 +08:00
jxxghp 7e851dbfa7 refactor(chain): 处理链功能域 mixin 化,清理未使用导入并根治兼容层循环导入
- ChainBase 拆分为 RecognitionMixin/MessageProcessingMixin/NotificationMixin
- TransferChain 拆分为 7 个功能 mixin(_mixins.py),SubscribeChain 音乐订阅域拆出 _music.py
- 斜杠命令交互四件套收敛为 InteractionChainMixin 委托,会话管理器移至 application 层,chain 层不再 re-export
- 模块基础类收敛到 app/modules/_base(notification/mediaserver 语义重命名)
- 清理 app/chain/__init__.py 24 个未使用导入,修正 49 处测试 patch 目标到实际命名空间
- 兼容层 legacy 符号不再并入 __all__,根治 schemas 初始化反向拉起 application.transfer 的循环导入
- 修复 bangumi 集数为字符串时 set_bangumi_info 抛 TypeError
- 新增重复代码等架构门禁测试;capability 清单校验排除下划线内部目录
2026-08-16 16:30:16 +08:00
InfinityPacer 24671f8f18 refactor(runtime): lazily activate host modules (#6331) 2026-08-16 16:07:38 +08:00
jxxghp 7d0cf76d9c fix(storage): 修复通用管理契约下存储页报未知错误
- usage 动作返回的 StorageUsage pydantic 模型无法透过
  Response[Dict[str, Any]] 开放映射校验导致 500,统一转为 dict
- support_transtype 返回值恢复 transtype 包装结构,与前端期望一致
- 空结果(无用量/无整理方式)恢复成功空结构语义,
  不再因 bool(结果) 被前端客户端当作业务失败弹窗
- dashboard 用量聚合改为 dict 取值;新增响应校验与空结果回归测试
2026-08-16 07:50:29 +08:00
jxxghp a6dbd799d5 refactor(api): 渠道与存储管理端点通用化,端点层零目标特色
- schemas 新增公共 ManageRequest(target+action+params) 与 StorageAction 词汇表
- endpoint 层收敛为 POST /notification/manage、/storage/manage 两个通用接口,
  不再定义任何渠道/存储特定的名称、参数与响应字段,前端上送参数原样透传
- chain 层 manage_channel/manage_storage 接受字符串标识纯透明转发,
  StorageChain 移除全部特色管理方法
- FileManagerModule 新增 storage_manage 统一入口,模块返回归一化为
  {success, message, data};wechatclawbot channel_manage 同步归一化,
  路由标识兼容枚举名/值/对象
- dashboard 与 agentopsassistant 的用量查询改走 manage_storage(usage)
- 新增 10 项存储契约守护测试,通知侧补充 3 项链透传与字符串路由测试,
  API 守护测试对 ManageRequest 开放映射按设计豁免
2026-08-16 07:18:49 +08:00
jxxghp 5b0c631f80 refactor(notification): 建立通知渠道通用管理契约 channel_manage
- schemas 层新增 NotificationAction 公共动作词汇表(状态/二维码/退出/连通性/缓存迁移)
- 模块实现统一 channel_manage(channel, action, **params),按渠道名路由,
  非本渠道返回 None;动作语义、表单参数解释与临时参数初始化封闭在模块内
- NotificationChain 收敛为单一 manage_channel 纯透明转发,
  chain 层不再出现任何渠道名与模块特色
- endpoint 路由路径保持前端兼容,内部统一走通用接口
- 新增 6 项契约守护测试,文档记录通用模式:新渠道接入无需改 chain
2026-08-16 06:35:46 +08:00