Skip to content

BetterGI 与 ZZZ-OD 共 18 处仍调用 #295 已删除的 Config.send_websocket_message,运行时必抛 AttributeError #613

Description

@qiyinxi

由 Sentry 每日分诊自动建立。Sentry issue: AUTO-MAS-BACKEND-6R
https://auto-mas.sentry.io/issues/AUTO-MAS-BACKEND-6R

现象

AttributeError: 'AppConfig' object has no attribute 'send_websocket_message',任务一进 main_task 就抛,被 on_crash 降级成「BetterGI任务出现异常」。

  • 1 条事件 / release v9.9.9-alpha.1(测试包)/ CN 长春 / POST /api/dispatch/start
  • 事件只命中 BetterGI,但同一缺陷在 ZZZ-OD 上同样成立,而 ZZZ-OD 是今天才合进 dev 的。

定位

Config.send_websocket_message#295a671fdd1,2026-08-28「迁移全部后端调用方并删除旧机制」)连同旧 WS 机制一并删除,98 处调用当时全部迁到 Publisher。dev 上现在一处定义都没有git grep -n "def send_websocket_message" 无输出),但仍有 18 处调用:

文件
app/task/BetterGI/manager.py 145、183、265、300
app/task/BetterGI/AutoProxy.py 830
app/task/BetterGI/ScriptConfig.py 162
app/task/ZzzOd/manager.py 148、208、228、239、250、274、285、376、411
app/task/ZzzOd/AutoProxy.py 828、1421
app/task/ZzzOd/ScriptConfig.py 263

根因

两个专项分支都在 #295 之前拉出、之后合入,合并时没有跟随这次迁移:

AppConfig 没有 __getattr__,所以这 18 条路径无一例外在运行时抛 AttributeError。已迁移的模块(如 app/task/MAA/AutoProxy.py:599)用的是 await Publisher.send(...),改法可直接照抄。

复现与影响

BetterGI:check() 不通过时走 manager.py:145,异常把「配置检查为何不通过」的真实原因整个盖掉,用户只看到 AttributeError。ZZZ-OD 同理,且 manager.py 上有 9 处。两个专项凡是要推 WS 提示的路径都会在该处中断。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Sentry dailySentry daily issuesbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions