Repository navigation
fix(workflow): an early-ended failed run logs neither the early end nor why, and a silent reply claims it stopped there - #1615
Conversation
|
@Birfy review request — PR #1615 at
As of my read: 3 files +119/−0 ( |
A fail step that ends the run early (needs-human, already-claimed, tip-unchanged, open-pr) was narrated with the failure copy, so the log said the run stopped on the node and never named the reason. Both fail branches now emit the early-end frame and keep a Bot reply when there is one. Docs-not-needed: narration copy only; graph and run state semantics unchanged. Fixes ThinkFlowLab#1577
|
Verdict: PASS at 5fc75fb Ran at this tip: Scope: Red first: with Merge tree: Gate facts at the tip: Not run: no live instance or browser (narration copy only), and no |
Fixes #1577
Owner: Dev2
Reviewer: Reviewer
Written-by: Dev-2
Base: bde09d1 (live
mainwhen this branch was cut)Tip: 5fc75fb (the fork head; tree
588d5fec…)Tree: 588d5feca2eb7e0dd939b52c9500775bf58536ed
What was wrong
#1572made a failure able to end the run early (needs-human,already-claimed,tip-unchanged,open-pr):failNode(plugins/workflow/src/graph.js:721-735) marks the nodedone, returnsfinished: truewithearlyEnd, andservice.js:448finishes the run withrun.earlyEnd.linesForreceivesearlyEndatservice.js:497, but neither fail branch innarrate.jsread it — only the complete branch checksfinished.So the log of a run that ended early said neither that it ended early nor why: with an empty reply it printed
Verify 这一步失败了,停在本节点。while the run wasdoneand every nodedone, and the⏹ 提前结束 · <reason>line that#1572earned never appeared. A reader could not tell "the Bot failed and the run stopped" from "the pass produced no new tip, so the run was closed on purpose".What changed
plugins/workflow/src/narrate.jsonly — both fail branches (live:102, non-live:154) ask one helper first:earlyEndLines(workflow, event)returnsnullunlessevent.earlyEnd != null. When it is set, it emits the Bot reply ifevent.texthas one, then akind: 'system'frame: key⏹ Ended early · {reason}, params{ reason }, text⏹ 提前结束 · <reason>. Notone, so it never renders in the failure colour.✓ 完成 · …and does not add a⏹line, so the two paths never double up.停在本节点, andrecoveredstill says↺ 失败恢复 → …; the regression tests pin both on this tip.graph.jsandservice.jsare untouched:nodeStatus,finished,doneCountandrun.earlyEndkeep exactly the semantics#1572landed. The new line follows this file's existing frame contract (English key + params + stored Chinese text,#1489), so the shell can translate it and older rows keep the fallback.Red → green, honestly
Red first on the live base
bde09d1c, with onlyplugins/workflow/test/narrate-early-end.test.jsadded andnarrate.jsatmain:TZ=UTC node --import ./test/resolve.mjs --test test/narrate-early-end.test.js— 7 tests, 3 pass, 4 fail, exactly the four early-end tests:live fail with earlyEnd and no reply says early end, never failurelive fail with earlyEnd keeps the Bot reply and adds the early-end linenon-live fail with earlyEnd says early end, never failureservice: a Verify reply that marks tip-unchanged narrates the early endThe three that pass on the base are the regression locks (complete path still
✓ 完成with no⏹, plain failure still停在本节点, recovered still↺ 失败恢复).At this tip: the same file 7/7 pass, and
TZ=UTC npm --prefix plugins/workflow test— 221 tests, 221 pass, 0 fail.Files
Checks
TZ=UTC ARCH_DOCS_BASE=bde09d1c npm run verifyat tree588d5fec…— exit 0: core 1903, social 528, tree 125, timeline 129, workflow 221,.github549, interop 37, live-e2e 24; oxlint 0 errors (only the repository's pre-existing warnings);build-client --checkclean;arch-docs: OK (3 changed file(s));ds-bot-patches check:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.node .github/scripts/changelog.mjs check— fragments well formed, exit 0.Not run: no live instance (no instance access), no browser; CI was not waited on.
Docs-not-needed: narration copy only —
graph.jsandservice.jskeep the state semanticsdocs/subsystems/workflow.mdalready describes, so the page needs no new rule.Checkpoint
{ "pr": 1615, "claim": "Dev2", "issue": 1577, "summary": "A run that ended early (needs-human, already-claimed, tip-unchanged, open-pr) was narrated as a failed step: the log said the node failed and stopped there, and the reason never appeared. Both fail branches in narrate.js now ask one helper first and emit ⏹ 提前结束 · <reason>, keeping the Bot reply when there is one and emitting no bot line when there is none. The complete path still closes on ✓ 完成 with no second line, and plain failures and recoveries keep their wording. graph.js and service.js are untouched.", "files": [ "plugins/workflow/src/narrate.js", "plugins/workflow/test/narrate-early-end.test.js", "changelog.d/1577.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=bde09d1c npm run verify, exit 0 (core 1903, social 528, tree 125, timeline 129, workflow 221, .github 549, interop 37, live-e2e 24, oxlint 0 errors); narrate-early-end.test.js red first on bde09d1c 3/7, green 7/7 here", "result": "green", "at": "5fc75fb29893f7fc5fae83f3de2bd6d361427583" }, "next": "none — ready for review" }