Merged
Conversation
将停止自身模式改为先请求 Maa tasker 停止并复用统一的前端停止流程,避免 kill 失败后任务队列继续执行。 Made-with: Cursor
Contributor
There was a problem hiding this comment.
嗨,我已经审查了你的修改,看起来非常不错!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Owner
|
冲突了 |
Contributor
There was a problem hiding this comment.
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 传入 app 与 instance_id |
合并主线最新的前置程序停止控制与任务兼容性改动,并保留当前分支对停止自身语义的修复。 Made-with: Cursor
在停止任务的过程中,调整了取消任务队列监控的时机,确保在请求停止任务后立即取消监控。此外,更新了自停止请求的事件发射函数,增加了返回值以指示成功与否,优化了错误处理逻辑。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
将停止自身模式改为先请求 Maa tasker 停止并复用统一的前端停止流程,避免 kill 失败后任务队列继续执行。
close #158
Made-with: Cursor