set finished and cleanup state properly for operations#3214
Conversation
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in operation state management where auto-closed operations with cleanup commands would incorrectly display cleanup commands in a "collected" state instead of updating properly as the agent executed them. The fix ensures operations transition to the cleanup state when cleanup commands are present and only mark as finished after cleanup completes successfully.
- Modified the
is_closeable()method to remove premature state setting to "finished" - Updated
_cleanup_operation()to properly set operation state to "cleanup" when cleanup commands exist - Added logging to track cleanup start and completion
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/objects/c_operation.py | Modified operation state management logic and added cleanup logging |
| tests/objects/test_operation.py | Added test fixture for planning service and test case to verify cleanup state behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.



Description
Type of change
How Has This Been Tested?
Manually and auto-closed operations and verified cleanup commands were updated accordingly
Checklist: