Skip to content

fix: 优雅停止后退出 MXU#161

Merged
MistEO merged 4 commits intoMistEO:mainfrom
overflow65537:fix/killproc-self-stop
Apr 7, 2026
Merged

fix: 优雅停止后退出 MXU#161
MistEO merged 4 commits intoMistEO:mainfrom
overflow65537:fix/killproc-self-stop

Conversation

@overflow65537
Copy link
Copy Markdown
Contributor

@overflow65537 overflow65537 commented Apr 7, 2026

将停止自身模式改为先请求 Maa tasker 停止并复用统一的前端停止流程,避免 kill 失败后任务队列继续执行。
close #158

Made-with: Cursor

将停止自身模式改为先请求 Maa tasker 停止并复用统一的前端停止流程,避免 kill 失败后任务队列继续执行。

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨,我已经审查了你的修改,看起来非常不错!


Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO MistEO requested a review from Copilot April 7, 2026 07:29
@MistEO
Copy link
Copy Markdown
Owner

MistEO commented Apr 7, 2026

冲突了

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 将“结束自身进程”能力改为“先请求 Maa Tasker 优雅停止任务队列,再走统一的前端停止流程,最终退出应用”,以避免直接 kill 失败导致队列继续执行(对应 #158)。

Changes:

  • 新增 taskStopService:抽取并复用“停止任务队列 → 等待停止 → 停止 agent → 清理状态”的统一流程。
  • Tauri 后端在 MXU_KILLPROC 的“结束自身”模式下改为请求 Tasker stop 并向前端 emit 事件,前端监听后执行 stop+exit。
  • 更新多语言文案,将“Kill Self/结束自身进程”调整为“停止任务后退出 MXU”。

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/services/taskStopService.ts 新增统一的停止任务/停止后退出封装,供多个入口复用
src/services/maaService.ts 增加 mxu-self-stop-requested 事件监听 API
src/services/index.ts 导出新增的 taskStopService
src/i18n/locales/zh-TW.ts 更新“结束自身”相关文案为“停止任务后退出 MXU”
src/i18n/locales/zh-CN.ts 同上(简中)
src/i18n/locales/ko-KR.ts 同上(韩文)
src/i18n/locales/ja-JP.ts 同上(日文)
src/i18n/locales/en-US.ts 同上(英文)
src/components/Toolbar.tsx 停止逻辑改为调用 stopInstanceTasks 以统一行为
src/components/DashboardView.tsx 停止逻辑改为调用 stopInstanceTasks 以统一行为
src/App.tsx 增加对后端“self-stop requested”事件的监听,触发 stop+exit
src-tauri/src/mxu_actions.rs MXU_KILLPROC 自身模式:请求 tasker stop + emit 前端事件;注册函数签名扩展
src-tauri/src/commands/maa_core.rs 资源加载时注册 MXU actions 传入 appinstance_id

合并主线最新的前置程序停止控制与任务兼容性改动,并保留当前分支对停止自身语义的修复。

Made-with: Cursor
在停止任务的过程中,调整了取消任务队列监控的时机,确保在请求停止任务后立即取消监控。此外,更新了自停止请求的事件发射函数,增加了返回值以指示成功与否,优化了错误处理逻辑。
@MistEO MistEO merged commit d7bf2e4 into MistEO:main Apr 7, 2026
9 checks passed
@overflow65537 overflow65537 deleted the fix/killproc-self-stop branch April 7, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

结束进程中的结束自身进程功能无法使用

3 participants