Skip to content

Fix task reset API environment validation#10

Closed
anish749 wants to merge 1 commit intomainfrom
claude/fix-task-reset-validation-L0nvr
Closed

Fix task reset API environment validation#10
anish749 wants to merge 1 commit intomainfrom
claude/fix-task-reset-validation-L0nvr

Conversation

@anish749
Copy link
Owner

Previously, ResetTask would silently succeed even if a task didn't exist or was in a different environment. This could lead to confusion where users think a reset succeeded when it didn't.

Changes:

  • Add ResetStatus enum and ResetResult/ResetTasksResult types
  • Update ResetTasksByIds to return ResetTasksResult with detailed status for each task (Success, NotFound, DifferentEnv, NotTerminal, Error)
  • Update ResetTask to check the result status and return appropriate errors for NotFound and DifferentEnv cases
  • Add helper methods ResetCount() and Errors() to ResetTasksResult
  • Update interface and documentation to reflect new behavior
  • Add comprehensive tests documenting the new validation behavior

Breaking change: ResetTasksByIds now returns ResetTasksResult instead of (int, error). This is acceptable as there are no production users yet.

The new design is more efficient (no extra queries) and provides better visibility into what happened to each task during bulk operations.

Fixes issue where resetting a task in a different environment would silently succeed without actually resetting anything.

Previously, ResetTask would silently succeed even if a task didn't
exist or was in a different environment. This could lead to confusion
where users think a reset succeeded when it didn't.

Changes:
- Add ResetStatus enum and ResetResult/ResetTasksResult types
- Update ResetTasksByIds to return ResetTasksResult with detailed
  status for each task (Success, NotFound, DifferentEnv, NotTerminal, Error)
- Update ResetTask to check the result status and return appropriate
  errors for NotFound and DifferentEnv cases
- Add helper methods ResetCount() and Errors() to ResetTasksResult
- Update interface and documentation to reflect new behavior
- Add comprehensive tests documenting the new validation behavior

Breaking change: ResetTasksByIds now returns ResetTasksResult instead
of (int, error). This is acceptable as there are no production users yet.

The new design is more efficient (no extra queries) and provides better
visibility into what happened to each task during bulk operations.

Fixes issue where resetting a task in a different environment would
silently succeed without actually resetting anything.
@anish749 anish749 closed this Jan 13, 2026
@anish749 anish749 deleted the claude/fix-task-reset-validation-L0nvr branch January 13, 2026 23:50
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.

2 participants