Skip to content

Report already closed human tasks as closed, not as the human's own - #249

Merged
danielehrhardt merged 1 commit into
mainfrom
fix/orphaned-human-tasks
Oct 25, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
fix/orphaned-human-tasks

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

When an agent is deleted, its open human tasks are withdrawn automatically. Cancelling one of them afterwards answered "H-177 is Daniel's own task", because withdrawHumanTask checked the author (now NULL) before the status. The status check now runs first, so the tool answers "H-177 is withdrawn already".

  • packages/core/src/services/humanTasks.ts: status check before the team lead check
  • packages/core/test/human-tasks.test.ts: deleting an agent, then cancelling its task, reads as withdrawn (fails without the fix)

bun test test/human-tasks.test.ts: 29 pass

…e it

Cancelling a task whose agent was deleted said it was the human's own task,
because the author check ran before the status check.
@danielehrhardt
danielehrhardt merged commit a07da92 into main Oct 25, 2026
8 checks passed
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