Skip to content

fix: task_manager close action supports archiving done tasks (#359)#355

Merged
MatthewSuttles merged 1 commit into
mainfrom
fix/359-task-manager-close-done-tasks
Jun 8, 2026
Merged

fix: task_manager close action supports archiving done tasks (#359)#355
MatthewSuttles merged 1 commit into
mainfrom
fix/359-task-manager-close-done-tasks

Conversation

@MatthewSuttles

Copy link
Copy Markdown
Collaborator

Summary

  • close action now archives tasks already in done status instead of returning an error — agents can archive any task regardless of its current status
  • New close_all action bulk-archives all non-archived done tasks, with optional assigned_to filter
  • Tool schema updated to expose close_all in the action enum
  • Specs updated: replaced the already done = error expectation with correct archive behavior, full coverage added for close_all

Root cause

close_task called TransitionService with new_status: "done". TransitionService rejects the call when the task is already in that status ("Task is already 'done'"). The Task#archive! method existed but was never wired up in the executor.

Changes

  • app/services/tools/task_manager_executor.rbclose_task detects done status and calls archive!; new close_all_tasks method for bulk archival
  • db/seeds/tools.rbclose_all added to the action enum
  • spec/services/tools/task_manager_executor_spec.rb — updated + new specs

Test plan

  • close on a non-done task: transitions to done as before
  • close on a done task: archives it, returns success
  • close on an already-archived task: returns failure
  • close_all with done tasks: archives all non-archived done tasks
  • close_all with no done tasks: returns informational message
  • close_all with assigned_to filter: only archives that agent's done tasks

- 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
@MatthewSuttles MatthewSuttles merged commit ac98133 into main Jun 8, 2026
2 of 3 checks passed
@MatthewSuttles MatthewSuttles deleted the fix/359-task-manager-close-done-tasks branch June 8, 2026 21:21
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.

1 participant