Repository navigation
fix(platform): recheck queued retries and move live workflow parents - #3908
Merged
yannickmonney merged 7 commits intoSep 29, 2026
Merged
Conversation
yannickmonney
added a commit
that referenced
this pull request
Sep 29, 2026
…ed-search-recovery The manual readme counts main's boxes plus this branch's six (989). Three of this branch's new boxes collided with IDs other open PRs add — TASK-F51 (#3813), TASK-B28 (#3881), TASK-B29 (#3908) — so they move to TASK-F52, TASK-B32 and TASK-B33, in the suite, pins.md and the automation register.
A task agent's automatic retry is a job queued when a run fails, and it admitted a new queued run and its turn job without looking at the project or at the person whose kick it continues. Archiving the project, or taking that person's access away, after the failure did not stop it, while the manual Start on the same task answers 403 PROJECT_ARCHIVED. The retry now passes deferredAgentKickRefusal inside its own transaction before it creates anything. It is the manual Start's work gate (mayWorkTask) run for the run's starter as things stand now, on a project row held FOR SHARE, so an archive, a sharing change or a delete orders around the admission instead of landing between the check and the run. A refusal is a logged skip, never a thrown job, because a retried job would only meet it again. The steer that misses its run and starts a fresh one checked its author outside its kick's transaction; it now runs the same helper inside it. The native lane checkTaskRetryProjectEligibility drives the production failure mark, retry handler, archive service and steer-miss kick on real Postgres with an inert queue, including duplicate delivery and an archive racing the retry.
Moving an automation-owned task out of In progress while its run was live went through the workflow cancel door, which parks the task at Cancelled, and only then made the move. Cancelled is a close, so a parent with an open subtask was refused on its way to To do with a generic error, and every move that did succeed recorded two status changes and fired two status events. The door now takes the destination and the drop position, and runs the run cancel and the board's own move (moveTask) in its one transaction. Without a body it still parks the task at Cancelled. Only Done and Cancelled meet the open-subtask guard, and a refused move takes the stop down with it, so the run, its question and its approval stay as they were. The choreography hook hands its target and placement to the door and shows the parent close guard's own sentence for that refusal, as the automation panel's Cancel run now does too. The native lane checkTaskWorkflowParentMoves drives the door over HTTP on real Postgres with parked runs, for open, finished and no subtasks and for open and closing moves. The guides say that only a close waits for subtasks, and the manual suite gains TASK-B29.
yannickmonney
force-pushed
the
fix/task-run-retry-archived-project-and-parent-moves
branch
from
September 29, 2026 14:33
b66ced4 to
faeafc5
Compare
…chived-project-and-parent-moves The task suite keeps main's new boxes (#3906) and this branch's TASK-B29 after them; its Cost is 99.
yannickmonney
commented
Sep 29, 2026
yannickmonney
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review at 38cd26a22d2c8e5d85943b4252a0f4358b0e370f: one non-blocking P3 placement finding below. No additional admission/security defect confirmed within the reviewed scope. Parent replay: 28 inert native-handler and 11 Chromium hook cases passed. The specialist also ran 61 exact-source unit cases. No merge/deployment or whole-application acceptance is implied.
…hed its column When another session moved the task into the target column while the stop dialog was open, the workflow-stop door skipped moveTask and with it the drop's beforeTaskId/afterTaskId, so the card stayed at its old rank. A default stop on a task already there still writes nothing; a drop that names a place now applies it.
The review fix makes the workflow stop door apply a drop's place when the task already sits in the target column. The native lane now drives that race: a first stop moves the parent to To do, then a second stop naming the drop's neighbours re-ranks it between them and records no status change. The check passes with the fix and fails with the previous condition, where the card kept its rank at the end of the column.
…chived-project-and-parent-moves The manual readme is recounted on the merged tree (1003 boxes), and the task suite's Cost is 100: main's TASK-F51 (#3813) and this branch's TASK-B29 each merged into a header both sides had set to 99.
yannickmonney
deleted the
fix/task-run-retry-archived-project-and-parent-moves
branch
September 29, 2026 16:35
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.
Two fixes for how task runs start and stop. Both reuse the task domain's existing admission and status choreography.
A queued retry rechecks the project before it starts work (#3737)
A task agent's automatic retry is a
task.agent_retryjob queued when a run fails. The handler (backend/jobs/task-list.ts) checked the task again under a lock (archived task, status, assignee, newest run, budget, agent), but never looked at the project or at who started the run. So a retry delivered after the project was archived still committed aqueuedauto_retryrun and itstask.agent_turnjob, while the manual Start on the same task answered403 PROJECT_ARCHIVED. The same held for a starter who had been removed from the organization, disabled, or dropped from the project's team, or who could no longer work the task.deferredAgentKickRefusalinbackend/domains/tasks/service.ts, next to the manual Start. It is the manual Start's work gate from feat(platform): let members create tasks and work their own #3810 (mayWorkTask: an editor of the project, or a member whose own task it is), run now for the person whose kick the retry continues, on an active project. The member lookup and auth context use the canonicalfindOrganizationMember+getProjectAuthContext. A trigger-started run names no person, so the project alone decides; a starter that names nobody is refused.FOR SHAREuntil the caller commits. An archive, a sharing change or a delete then orders around the admission, the same waylockRestProjectForWriteand thread creation order theirs.kickAgentRun, and keeps every existing guard. A refusal (project_archived,project_unavailable,not_permitted) is a logged skip, never a thrown job, so pg-boss never retries a refusal that is final.kickMentionRunAfterSteerMiss), already checked its author's work rights after feat(platform): let members create tasks and work their own #3810, but outside the kick's transaction. It now runs the same helper inside that transaction, so an archive can't land between the check and the run. An archived project also answersproject_archivedthere now;not_permittedkeeps its meaning.A live workflow parent moves to To do (#3738)
Moving an automation-owned task out of In progress while its run was live went through
POST /api/app/tasks/:taskId/workflow/cancel. That door parks the task at Cancelled, and the choreography hook made the plain move only afterwards. Cancelled is a close, so a parent with an open subtask was refused on its way to To do with the generic error. When there were no subtasks, the move recorded two status changes and fired twotask.status_changedevents (to Cancelled, then to To do).{status, beforeTaskId, afterTaskId}body (the move door's own fields). The destination can be anything butin_progress, and it defaults tocancelled, so a stop with no body behaves as before. In its one serializable transaction the door cancels the run (cancelRunInTx) and moves the task with the board's ownmoveTask, at the drop position. Only Done and Cancelled meet the open-subtask guard, and a refused move rolls the stop back with it: the run, its question, its approval, the task and its history stay as they were.taskCancellednow says whether the task sits at Cancelled.useTaskStatusChoreographysends the target (and the board drop's placement) with the stop, and returnshandled: the stop already moved the card, so no second write follows. Thecancelplan no longer carriesalsoMove.parentCloseRefusal), which the task dialog's existing guard now uses too.Docs (EN/DE/FR):
tasks.mdsays only Done and Cancelled wait for open subtasks.task-automation.mdsays an automatic retry, or a late mention, starts only while the project is active and the starter may still change the task, and that moving an automation's task stops its run and moves it in one step. The manual suite gainsTASK-B29, plus two rows inreference/automation.md. No UI strings were added: the copy reusestasks.detail.parentCloseGuard,tasks.run.cancelledandcommon.errors.generic.How I verified it
backend:integration, a filtered run; the harness is not a CI job). The queue and the engine are inert: every job these lanes cause is held a day inside the writing transaction and delivered by hand, runs are rows parked on a question, egress is blocked, and nothing executes.checkTaskRetryProjectEligibilitydrives the production failure mark, retry handler, archive/restore service and steer-miss kick. It covers:403 PROJECT_ARCHIVED), then restored before a later delivery;checkTaskWorkflowParentMovesdrives the door over HTTP. It covers open, finished and no subtasks; To do, Backlog, In review, Done, Cancelled and a stop with no body; the drop position; In progress as a destination; a read-only member; and a run that already ended. For refusals it checks that task, run, question, approval, history and audit rows stay identical. Since the review round it also covers a stop that finds the task already moved to its column by another session (the P3 finding, fixed in7424481e0): the drop's place still applies, as a reorder with no status change. That check passes with the fix and fails with the previous condition, where the card kept its end-of-column rank (the lane is 29/29 against 28/29).checkTasks,checkTasksOrgIsolation,checkTaskRunStartFenceand the two new lanes, rerun on the heade632755b8. With the implementation reverted tomainand the lanes kept: 25/41. 16 of the lanes' 24 checks fail, every one a case of the two bugs; the 8 that pass are the controls (an eligible retry, a member's own task, an archived task, the three closing-move refusals, the default stop, the refused requests). After feat(platform): let members create tasks and work their own #3810, main's steer-miss already refuses an archived project, but asnot_permittedand outside its transaction; the lane pins the share-locked check and its reason.task-list.agent-retry.test.ts(+12 cases),agent-turn-shim.steer-fallback.test.ts(+1, and its fake now answers the kick's transaction), newroutes.workflow-stop.test.ts(11), newuse-task-status-choreography.stop.test.tsx(10), plus cases inuse-task-status-choreography.test.ts,use-task-board-dnd.test.tsxandtask-subject-panel.test.tsx. With the fix reverted and the tests kept, 20 of 33 backend cases and 11 of 33 UI cases fail.backend/domains/tasks+ the job tests (50 files, 537 tests) andapp/features/tasks(58 files, 424 tests), the error-message and single-toast guards (61), the docs suite (36 files, 200 tests), oxlint--type-awareand oxfmt on every changed file, and a scopedtscover the changed app files, the changed backend files andintegration-check.ts. Alsobun run lint:manualandcheck-guide.tson the tasks suite. The host was shared and loaded (load average 40–150): a handful of jsdom cases hit the 5 s timeout and one vitest worker failed to start. Each of those files passed when re-run alone with--maxWorkers=1 --testTimeout=120000.c9a04259a:7424481e0's condition reverted, the same flow shows the same toast, but the card stays at the end of the column.visual-aspect-analyzer, signed in, the production bundle, the To do and Done drags). In its full mode the instrumented board page stalled on this shared host, even for a screenshot, while the log-in page scored 100. With pixel capture off it completed: 99 for both drags on this branch, against 98 and 79 onmain's bundle. The defects left are the same page-load layout shifts in both runs (the board's "Loading content" skeleton, the Automations and Environment tabs, an icon), plus a 0.002 shift of the neighbouring card while a refused drag snaps back.main's run showed jank on that same snap-back.The workspace-wide gates (full
tsc, the full suites, knip, the e2e shards) are left to CI.Not changed here
Merge order
This is meant to land after #3881. Both change
task-subject-panel.tsxand its test, the harness lane table, and the manual readme and register. #3881 wrapsTaskSubjectPanelin a component keyed by task id; this PR's two handler edits then move into its body. The rest is keeping both sides. The two PRs' new manual boxes have distinct IDs (TASK-B28there,TASK-B29here).Closes #3737
Closes #3738