Commit Graph
187 Commits
Author SHA1 Message Date
jxxghp da9f1d297a refactor: keep message handler within complexity budget 2026-08-24 07:40:29 +08:00
jxxghp c03b45eed7 refactor: inject plugin interaction event publisher 2026-08-24 07:36:50 +08:00
jxxghp 40d4a10c99 refactor: own agent session cleanup tasks 2026-08-24 05:40:35 +08:00
jxxghp 1bb6e36e8c refactor: complete runtime configuration migration 2026-08-22 19:07:07 +08:00
InfinityPacer 1c07333909 fix: 收敛 Agent 会话队列与 worker 关闭 (#6386) 2026-08-22 10:09:01 +08:00
jxxghp 5128ae9e1e refactor: 推进后端分层架构治理 2026-08-18 00:29:14 +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
InfinityPacer 5b367011c5 refactor(agent): 按需加载 Agent 运行时 (#6336) 2026-08-16 19:25:24 +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
jxxghp a66cbe6192 refactor(wechatclawbot): 渠道管理改为模块方法契约,endpoint 不再接触客户端对象
- 收消息方向保持 Telegram 模式:模块自建连接轮询网关,转发本地消息 API
- 管理方向(状态/二维码/退出/连通性)封装为 wechatclawbot_status 等模块契约方法,
  实例解析与临时客户端回退封闭在模块内部,统一返回 {success, message} dict
- 新建 NotificationChain 薄分发链,MessageChain 移除全部 clawbot 方法
- notification endpoint 改为纯 chain 调用,不再获取任何客户端对象
2026-08-16 05:45:58 +08:00
jxxghp 4345fcfa22 refactor(chain): chain 与 module 仅经 run_module 契约互联,实现模块内容封闭
- mTorrent 字幕链接解析下沉为 IndexerModule.site_subtitle_links,subtitle 模块自行跳过 API 站点
- TMDB/MusicBrainz 识别缓存管理改为模块方法(tmdb_cache_*/music_cache_*)经 run_module 分发
- WechatClawBot 客户端查找/临时客户端/缓存迁移内聚为 wechatclawbot_* 模块方法,
  chain 移除 WechatClawBot 类与 ModuleManager 内省
- LISTENBRAINZ_* 常量迁至 schemas/types.py,模块与链层再导入保持兼容
- TMDbException 升为 schemas/exception.py 跨层契约,vendored 异常保持类身份一致
- 架构守护测试新增 test_chain_does_not_import_module_internals(共 18 项)
- 文档同步:chain->module 仅允许 run_module 分发,直接导入禁止
2026-08-16 05:25:28 +08:00
jxxghp 02f0dd0b9a refactor(architecture): 修复模块依赖违规并强化架构守护
- 字幕编排上移 DownloadChain.download_site_subtitles,SubtitleModule 仅保留站点链接解析
- TransferChain.recommend_name 上移 TV episodes_info 获取,filemanager 模块不再导入 TmdbChain
- endpoint 穿透修复:WXBizMsgCrypt3 迁至 adapters/external/wechat_crypt.py;
  music/tmdb 缓存管理、listenbrainz 常量、TMDbException、WechatClawBot 辅助统一经 chain 包装
- RuleParser 与 builtin_rules 合并为 application/filter_rules.py;
  fsproxy/fsworker 迁至 adapters/system/
- chain/__init__.py 删除 qbittorrentapi/transmission_rpc 导入,消除后端协议类型泄漏
- 架构守护测试新增三项检查:模块间隔离、入口层穿透、下载器 SDK 泄漏
- 文档同步:05-architecture.md 记录 DB/Oper 聚合例外与迁移文件位置,AGENTS.md 更新所有权表
2026-08-16 04:59:17 +08:00
jxxghp dd38c16400 refactor(messaging): 拆分用户交互模块到 application/messaging 层
- 新增 application/messaging 交互层:router.py 统一会话优先级与回调分发,
  site/subscribe/skill/media/plugin 各交互状态与视图从 Chain 迁出
- MessageChain 改为通过 InteractionRouter 派发文本会话与按钮回调,
  新增结构化 callback_data 通道(兼容 CALLBACK: 文本前缀)
- Transfer 失败重试/AI 接管回调归入 TransferChain
- MediaInteractionChain 拆出为 app/chain/interaction.py(旧路径保留兼容别名)
- WebAgent Endpoint 去重,统一使用 agent.py 回调协议函数
- 删除 app/chain/skills.py(交互逻辑并入 SkillInteractionHandler)
- 同步更新架构文档与测试,全量 4476 通过
2026-08-15 16:36:39 +08:00
jxxghp 96118e73e7 refactor(string): split utilities by responsibility 2026-08-15 08:03:55 +08:00
Aqr-K 8a11214a43 refactor(db): 修复异步连接池无界增长,并完成 SQLAlchemy 2.0 迁移与分层归位 (#6320) 2026-08-15 06:58:38 +08:00
jxxghp 369d7d6448 refactor: reorganize backend module boundaries 2026-08-14 19:53:33 +08:00
jxxghp 7b3444c366 refactor backend module architecture 2026-08-14 15:45:38 +08:00
InfinityPacer 3aed078bbb fix(agent): bind channel admin identity (#6294) 2026-08-13 14:53:59 +08:00
InfinityPacer f979274c07 feat(agent): 增加最终模型请求预算观测 (#6290) 2026-08-13 13:52:30 +08:00
InfinityPacer 591a1d420d fix(agent): close secret confirmation delivery gaps (#6285) 2026-08-13 08:20:14 +08:00
InfinityPacer a6e8ba8b57 feat(agent): 敏感设置读取增加宿主二次确认 (#6283)
* feat(agent): require confirmation for secret settings

* fix(agent): preserve history during secret confirmation
2026-08-13 08:10:32 +08:00
jxxghp 8bf2f601a6 refactor(media): unify source identity and music browsing 2026-08-12 12:56:40 +08:00
jxxghp a52e1fdc1c feat(agent): improve prompt cache hit rate 2026-08-06 23:34:29 +08:00
jxxghp 3b709b7f2e feat: unify media source identity flow (#6129) 2026-07-21 20:20:09 +08:00
InfinityPacer 5588e37c6d fix: preserve season zero semantics (#6150) 2026-07-20 06:55:23 +08:00
qqcomeup 8c0afac5d1 feat: support prompt-bound plugin input replies (#6087) 2026-07-09 12:52:22 +08:00
qqcomeup 827ed8330c feat: add plugin-scoped text input sessions (#6068) 2026-07-07 05:15:18 +08:00
jxxghp a9197c434e Skip download dir selection for single matches 2026-06-27 22:29:55 +08:00
jxxghp 7d2a730b0c feat(web-agent): enhance message handling with edit capabilities and button descriptions 2026-06-26 13:44:49 +08:00
jxxghp f9ea0118d9 Handle Telegramify 1.2 compatibility 2026-06-22 20:16:37 +08:00
jxxghp 3306d196b7 Refine existing implementation 2026-06-22 18:21:20 +08:00
InfinityPacer 6b21abd547 add: AnySearch-Skill 2026-06-21 08:17:32 +08:00
jxxghp d2103f91b8 fix(message): keep auto directory matching for interactive downloads 2026-06-20 12:59:37 +08:00
jxxghp e1ba9a2c97 feat: conditionally save message history based on save_history flag 2026-06-17 21:00:40 +08:00
jxxghp cff22924b1 feat: add message download path selection 2026-06-17 19:04:41 +08:00
jxxghp d4b6d3f332 refactor: remove persist_output_message functionality and related database save logic 2026-06-17 16:14:35 +08:00
jxxghp 0f42a0fb8c 支持全局 AI 下绕过传统搜索 2026-06-15 07:50:45 +08:00
jxxghp 64cb5742d2 feat: add explicit handling for /ai messages to bypass media interactions 2026-06-03 06:52:25 +08:00
InfinityPacer 7c73a57bbc fix(chain): use history_id key in manual transfer redo prompt context (#5876) 2026-06-02 12:50:42 +08:00
jxxghp 855681ff35 feat(agent): mark and propagate voice input metadata in agent messages; clarify terminal tool usage in prompts
- Add `has_audio_input` flag to agent message handling and propagate through processing pipeline
- Structure agent input payloads to include `input.mode` and `input.transcribed` for voice messages
- Update prompts and tool descriptions to clarify that `send_voice_message` and `ask_user_choice` are terminal tools and should not be followed by redundant text replies
- Enhance tests to cover voice input metadata propagation and prompt updates
2026-05-31 18:04:02 +08:00
jxxghp 79539760da fix: bound long-lived cache state 2026-05-24 18:03:42 +08:00
jxxghp 9190699cd1 fix: remove choice callback status passthrough 2026-05-23 00:38:37 +08:00
jxxghp 4f107a7cc8 fix: resume agent after choice callback 2026-05-23 00:28:42 +08:00
jxxghp a74f04a149 fix: simplify message typing lifecycle 2026-05-23 00:11:56 +08:00
jxxghp f7b78721c3 fix: 统一消息 typing 生命周期 2026-05-22 22:59:20 +08:00
jxxghp 737bcb5c62 refactor(agent): move feedback issue flow into skill scripts 2026-05-21 19:22:27 +08:00
InfinityPacer 0245c8db80 feedback-issue: 拆三步、入口意图门、消息可靠性、日志脱敏与噪音过滤 (#5810) 2026-05-21 13:57:12 +08:00
jxxghp b2a18f9ae4 feat(message-processing-status): unified processing status indicator for Telegram, Slack, Discord, Feishu
- Add ChannelCapability.PROCESSING_STATUS and capability detection for supported channels
- Implement mark_message_processing_started/finished in Telegram, Slack, Discord, Feishu modules
  - Telegram: manage typing lifecycle with max duration and explicit stop
  - Slack: add/remove reaction as processing indicator
  - Discord: start/stop typing indicator with async task management
  - Feishu: add/remove reaction for processing status
- Refactor message chain to invoke processing status hooks for supported channels
- Ensure processing status is properly finished on sync and async message handling paths
- Add tests for processing status lifecycle and capability detection across channels
2026-05-15 12:45:41 +08:00
jxxghp 7b27b7fd16 feat: add extensible agent audio capabilities 2026-05-14 19:37:13 +08:00