fix: task_manager close action supports archiving done tasks (#359)#355
Merged
Merged
Conversation
- close action now archives tasks already in "done" status instead of returning an error — agents can archive any task regardless of current state - returns failure only if the task is already archived - new close_all action bulk-archives all non-archived done tasks, with optional assigned_to filter - logs an "archived" event for each archived task - tool schema updated to expose close_all in the action enum - specs updated: replaced the "already done = error" expectation with correct archive behavior, added full coverage for close_all
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.
Summary
closeaction now archives tasks already indonestatus instead of returning an error — agents can archive any task regardless of its current statusclose_allaction bulk-archives all non-archived done tasks, with optionalassigned_tofilterclose_allin the action enumalready done = errorexpectation with correct archive behavior, full coverage added forclose_allRoot cause
close_taskcalledTransitionServicewithnew_status: "done".TransitionServicerejects the call when the task is already in that status ("Task is already 'done'"). TheTask#archive!method existed but was never wired up in the executor.Changes
app/services/tools/task_manager_executor.rb—close_taskdetects done status and callsarchive!; newclose_all_tasksmethod for bulk archivaldb/seeds/tools.rb—close_alladded to the action enumspec/services/tools/task_manager_executor_spec.rb— updated + new specsTest plan
closeon a non-done task: transitions to done as beforecloseon a done task: archives it, returns successcloseon an already-archived task: returns failureclose_allwith done tasks: archives all non-archived done tasksclose_allwith no done tasks: returns informational messageclose_allwithassigned_tofilter: only archives that agent's done tasks