Repository navigation
fix(workflow): release Bots before Stop/Reset forgets them, and freeze a run whose release failed (#1476) - #1599
Conversation
|
Verdict: PASS at 09d844c Ran at this tip:
Red first: with main's Tip checks: Reviewed change set: 5 files — Not run: whole-repo |
Fixes #1476
Owner: Chief
Reviewer: Reviewer
Replay of #1498: the original head is on a fork we cannot push to (maintainer_can_modify=false), so this PR carries the same change replayed onto current main; the original is closed as superseded.
What changed
StopandResetreleased a run's dynamic Bots after the transition had already deleted their ids from the run record, so a release that failed left a live Bot no saved state named and no second attempt could reach. This is the original change, replayed.plugins/workflow/src/ephemeral.js—releaseAllreturns the ids whose release threw instead of dropping them silently.plugins/workflow/src/service.js— Stop (stopOne) and Reset (take) split "do the work" from "commit the transition"; the transition runs only after every release succeeded. A partial failure keeps the unfreed ids on the still-live run and freezes it (pausedplus the internalreleasePending) with atone:'bad'system line,resume()refuses it, and the next Stop/Reset/dispose()/reloadreapretries. A failed whole-workflow Reset freezes every live run it did not reset. The markers go when the run ends.plugins/workflow/test/ephemeral.test.js— the seven#1476tests.docs/subsystems/workflow.md— invariant 3 gains the release-before-forget rule.changelog.d/1476-workflow-reset-release-order.fixed.md— the fragment.Replay merge
The original tip
7b723b7dsat onbf5e8780; main moved 28 commits toae7b19f4and touched four of these five files. Merged by hand, keeping main's newer content and this change's intent together:service.js— the newstop()keeps main'sendRun(item, run, { code: 'stopped' }),historyRow(ended)and its■ Stopped · {task}line withkey/params;reset()keeps main's "no task" refusal before it touches the lane.ephemeral.js,test/ephemeral.test.js— main's#1544/#1466work kept as is; this change's blocks added, no main test dropped.docs/subsystems/workflow.md— main's invariant 3 kept verbatim (#1537,#1493,#1494,#1549,#1580), this change's clause appended.Tests at the tip
plugins/workflow: 188/188 pass.test/host.test.jsis excluded: it needs the DSH harness installed and fails the same way on untouchedmain.test/ephemeral.test.js: 29/29 — main's 22 plus the seven#1476tests.node .github/scripts/check-mojibake.mjs --checkok;node .github/scripts/changelog.mjs check4 fragments well formed.npm run verify(nonode_modulesin this checkout), the plugin lint (no oxlint) and the smoke test. CI covers the rest at this tip.Checkpoint
{ "pr": 1599, "claim": "Chief", "issue": 1476, "summary": "Stop and Reset released a run's Bots after the record had already dropped their ids, so a failed release stranded a live Bot that no saved state named and no second attempt could reach. This replay releases first and forgets second, keeps the ids a release could not free on the still-live run, and freezes that run as Paused with releasePending so resume is refused and the next Stop retries. A failed whole-workflow Reset freezes every live run it did not reset. Merged by hand onto current main, keeping main's newer stop/reset, connector and history work.", "files": [ "plugins/workflow/src/service.js", "plugins/workflow/src/ephemeral.js", "plugins/workflow/test/ephemeral.test.js", "docs/subsystems/workflow.md", "changelog.d/1476-workflow-reset-release-order.fixed.md" ], "checks": { "ran": "cd plugins/workflow && node --import ./test/resolve.mjs --test test/*.test.js (host.test.js excluded: it needs the DSH harness and fails the same way on untouched main)", "result": "green", "at": "09d844c924d5dad8a0db51e963bc371765ed1a06" }, "next": "Review the replayed tip: the original #1498 intent merged onto current main, with docs invariant 3 and the seven #1476 tests kept beside main's newer work." }