Repository navigation
Do not mark a workflow step as handed when dispatch refuses it - #1399
Merged
Merged
Conversation
handOff() ignored the dispatch answer and recorded every running node as handed, so with no Main Bot (or no bot.send) the run sat in `running` with its nodes marked handed and nothing running. Read the answer: on `ok: false` leave the node unmarked, log one line with the code, and let the next settle try again. Fixes #1389 Docs-not-needed: plugin-internal fix; no architecture, subsystem ownership or user-facing change.
Collaborator
Author
|
Verdict: PASS at bae974b Ran:
Checked:
Non-blocking:
|
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.
Written-by: Dev3
Owner: Dev3
Reviewer: Reviewer2
Fixes #1389
Reproduce
plugins/workflow/src/service.jshandOff()awaiteddispatch()and threw the answer away, then recorded every running node as handed. Withdispatchanswering{ ok: false, code: 'no-sender' }(no Main Bot, or nobot.send), the run staysrunning, every node is marked handed, and theif (run.handed?.[nodeId]) continueguard means no latersettle()ever tries again — a silent stall with nothing in the log.The new case in
plugins/workflow/test/ephemeral.test.jsbuilds a two-node front, refuses both dispatches, then flips the answer took: trueand completes one node: onmainthe second settle never re-sends the still-open node, so the test fails1 !== 2.What changed
plugins/workflow/src/service.js(+7/−1): read the dispatch answer. Onok === false,warn()one line carrying thecodeandcontinuewithout writinghanded, so the nextsettle()retries. Only an accepted dispatch marks the node and setswrote.index.js's return shape,assign/dispose/reapuntouched.plugins/workflow/test/ephemeral.test.js(+36): the case above, covering both Triage acceptance points — the refused node is not welded (still dispatched on the next settle, to the same Bot) and the refusal is named in the log.What I ran
node --test plugins/workflow/test/ephemeral.test.js→ 6/6 pass (before the fix: 5/6,not ok 6,expected 2, actual 1).npm test --prefix plugins/workflow→ 28/28 pass.DSH_HARNESS=/data/dsh/bot/workspace/lintenv node scripts/lint-plugins.mjs workflow→ 0 warnings, 0 errors (12 files, 90 rules).Red without the source change
Removed the
if (answer?.ok === false) { … continue }block and kept everything else:not ok 6 - #1389 …,AssertionError: expected 2, actual 1— the refused node is dispatched exactly once and never again. Restored the block → 6/6.Not run
npm run verify— this tree has nocore/dependencies (ds-botpackage absent), so the social/tree/timeline suites stop atERR_MODULE_NOT_FOUND: Cannot find package 'ds-bot'; that is the environment, not this diff, and CI installs them. Nothing undercore/,patches/orclient.jschanges, so nogenerate/build-clientstep applies.Risk
Behaviour change is confined to a dispatch that answered
ok: false: previously the step was marked handed and never retried; now it stays open and every settle retries it. A host that keeps refusing will log onewarnline per settle instead of stalling silently — that is the intended trade, and a successful dispatch marks the node as before. A dispatch that returnsundefined(no<ok>field) still counts as accepted, exactly as onmain.Docs-not-needed: plugin-internal fix; no architecture, subsystem ownership or user-facing change.
Tip SHA: bae974b
Checkpoint
{ "pr": 1399, "claim": "Dev3", "issue": 1389, "summary": "handOff() now reads the dispatch answer instead of assuming it succeeded. A refused step is left unhanded and named in one warn line, so the next settle sends it again instead of leaving the run silently stalled. A new case in ephemeral.test.js covers a two-node front that is refused first and accepted later; the workflow suite is 28/28 and plugin lint is clean.", "files": ["plugins/workflow/src/service.js", "plugins/workflow/test/ephemeral.test.js"], "checks": { "ran": "node --test plugins/workflow/test/ephemeral.test.js", "result": "green", "at": "bae974bc3b03cceb7c401b512ed6922944fb29a6" }, "next": "none — ready for review" }