fix: 应用退出时未正确停止自动战斗算子 - #2459
Merged
DoctorReid merged 1 commit intoJul 18, 2026
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughAutoBattleApp 新增对 OperationResult 的导入,并新增 after_operation_done 方法覆盖实现:操作完成时先调用 stop_auto_battle 停止自动战斗,再调用基类 ZApplication.after_operation_done 继续处理。 Changes自动战斗应用生命周期调整
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
kawayiYokami
force-pushed
the
fix/stop-auto-battle-on-exit
branch
from
July 7, 2026 09:48
718c967 to
f4ea44c
Compare
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/zzz_od/application/battle_assistant/auto_battle/auto_battle_app.py`:
- Around line 107-109: `after_operation_done()` needs a `try/finally` so the
base cleanup in `ZApplication.after_operation_done(self, result)` always runs
even if `self.ctx.auto_battle_context.stop_auto_battle()` fails. Update
`after_operation_done()` to keep the auto-battle stop call in the `try` block
and move the `ZApplication.after_operation_done(self, result)` invocation into
`finally`, preserving the existing cleanup flow and ensuring the
`APPLICATION_STOP` handling is not skipped.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 27dafc51-7783-41dc-83aa-356c6decfada
📒 Files selected for processing (1)
src/zzz_od/application/battle_assistant/auto_battle/auto_battle_app.py
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
修复了应用退出时,自动战斗算子没有正确停止的问题,避免资源泄漏。
Summary by CodeRabbit