Skip to content

bug(platform): moving a live workflow parent to To do is blocked by its open subtasks #3738

Closed

Description

@yannickmonney

Moving a workflow-owned parent task from In progress to To do can fail solely because it has an open child. The choreography first moves through terminal Cancelled, so the closure guard refuses the request before the requested nonterminal move occurs.

Reproduce locally

  1. Have a workflow-owned parent in In progress with a live waiting automation run and an open child.
  2. Choose To do and confirm stopping the live workflow.
  3. Observe the status transition result and persisted task/run state.

Expected: stop the live workflow and move the parent to To do while retaining its open child. Open subtasks should prevent closing the parent, as documented; the requested destination is not a closed state.

Observed: useTaskStatusChoreography chooses {kind:"cancel", alsoMove:true} and calls POST /api/app/tasks/{id}/workflow/cancel?orgId={org}. That route tries to set Cancelled and returns 400 TASK_HAS_OPEN_SUBTASKS. The hook returns blocked and shows its generic error. Parent remains In progress, run remains waiting, and the To do request is never performed.

Independent evidence and controls

Parent replay ran the actual transition decision and hook against native Hono task routes, domain services and a fresh local PostgreSQL database with 127 migrations. Query/action boundaries were supplied by adapters to those native routes, auth identity was a synthetic session fixture, and confirmation returned true. No rendered board/drag interaction is claimed.

  • Same parent/open child: native run-only cancellation followed by the ordinary To do update both return 200 and persist task=todo/run=cancelled.
  • Same hook with a terminal child: it returns move; the final native status write succeeds, producing task=todo/run=cancelled.
  • Failing hook path: 400 from workflow/cancel, no final status call, no partial cancellation committed.

Cause and repair boundary

app/features/tasks/hooks/use-task-status-choreography.ts:64 uses the terminal cancel route for every move away from a live In progress workflow. backend/domains/tasks/routes.ts:1145 intentionally combines run cancellation and setting task=cancelled in one transaction. That is appropriate for Cancelled, but not as an intermediate state for To do.

Carry the actual destination into an atomic stop-and-move operation, or use a correctly scoped nonterminal cancellation path. Preserve the atomic rollback and real closure guard. The guide docs/en/platform/projects/tasks.md:67 restricts parent closure, not all nonterminal moves. Count this common choreography defect once.

Audit scope and reproduction record

  • Tested source: 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d; local-only audit on 2026-09-28.
  • Relevant source compared with origin/main 2be6c267eaf8b7a67d0e5abe1b0b3d655eb2ca25. The cause remains present; the only changes in the compared Inbox UI files are unrelated accent/filter-error affordances.
  • Full-body dedup reviewed against the all-state issue snapshot and the existing 102-finding baseline. This is one distinct cause, not an endpoint/locale variant or documented debt.
  • Parent replay log: /Users/yannick/.codex/notes/tale-1000-additional/runs-next/parent-choreography.log. Retained proof code lives in the same notes directory outside the repository. No production testing, real customer data, provider calls or application source edits.
  • Source links are rooted at the tested commit.
  • Severity: P2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions