Skip to content

Report a workflow step deadline as reached instead of as silence - #1875

Merged
Birfy merged 1 commit into
mainfrom
fix/1868-step-deadline-reason
Oct 30, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/1868-step-deadline-reason

Conversation

@Birfy

@Birfy Birfy commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #1868

Owner: Dev
Reviewer: Reviewer

What changed

  • plugins/workflow/src/service.js expireStep(): the stage line key is now {node} step deadline reached ({minutes} min), the run was marked failed. (zh: {node} 这一步到达 {minutes} 分钟的截止时间,run 已标记失败。) and run.failure.text is step deadline reached (<minutes> min) instead of no reply for <minutes> minutes. code: 'step-failed', nodeName, the warn line, release and drain are unchanged; the deadline stays hard.
  • plugins/workflow/src/service.js define(): stepTimeoutMinutes is forwarded to create(), which validates it through stepTimeoutValue() — a bad value is refused with stepTimeoutMinutes is an integer from 1 to 120, not dropped; omitted keeps 45.
  • plugins/workflow/index.js: define_workflow gains the optional stepTimeoutMinutes parameter (1..120) and mentions it in the description.
  • plugins/workflow/client.js and plugins/workflow/test/timeline-locale.test.js: the zh stage map and the pinned deadline frame follow the new key/copy. Both pin the old wording and are outside Triage's file list, but without them the suite is red or the zh line shows the English key.
  • plugins/workflow/test/deadline.test.js: the two workflow: a step that is still working is killed at the 45-minute deadline and reported as "no reply" #1868 cases (deadline wording + define() pass-through / refusal / default).
  • docs/subsystems/workflow.md and changelog.d/1868-expire-reason.fixed.md.

Red first: the two new cases were added before the fix and failed on the old text — no reply for 45 minutes instead of step deadline reached (45 min), and 45 !== 90 because define() dropped the field (log: i1868-impl/red.txt at baseline e76a404; live main 0e84a54 still carries the same wording).

Base: this branch is on live main 0e84a547641988982b45def3edc0378c87455068 (tree 06f8e1253f8a18dd3bc3c7c7cad6d292be483a2d), re-read when the commit was built — not on the older e76a404 the working copy started from. The diff against live main is exactly these seven files.

Ran at this tip:

$ cd plugins/workflow && TZ=UTC npm test
# tests 328, pass 328, fail 0 (includes the two new #1868 cases and #1869's assign-brief cases)
$ node scripts/lint-plugins.mjs
# 16 warnings, 0 errors
$ node .github/scripts/check-mojibake.mjs --check
# mojibake: ok — 0 occurrences of U+FFFD
$ node .github/scripts/changelog.mjs check
# 10 fragment(s) in changelog.d/ are well formed
$ node core/scripts/build-client.mjs --check
# exit 0

Not run: TZ=UTC npm run verify as a whole — it stops at core lint because core/scripts/check-arch-docs.mjs needs a git checkout and this box has no git (cannot diff against main); every other half was run above or on the same content. The core suite was run separately: 2246 tests, 2244 pass, 2 fail, both environmental and in files this change does not touch (check-arch-docs.test.js needs git; usage-fields.test.js expects node 24). Smoke test not run — no change under core/index.js or core/src/host/.

Checkpoint

{
"pr": 1875,
"claim": "Dev",
"issue": 1868,
"summary": "expireStep() now says "step deadline reached (N min)" in the stage line and in run.failure, keeping code step-failed, nodeName and the release/drain path, because a step still working is killed by the same timer as one whose Bot never replied. define() forwards stepTimeoutMinutes to create(), so define_workflow can set 1..120; a bad value is refused and an omitted one keeps the 45-minute default. The zh stage map, the pinned deadline frame and docs/subsystems/workflow.md follow the new wording, and two red-first cases in deadline.test.js cover both halves.",
"files": [
"docs/subsystems/workflow.md",
"plugins/workflow/client.js",
"plugins/workflow/index.js",
"plugins/workflow/src/service.js",
"plugins/workflow/test/deadline.test.js",
"plugins/workflow/test/timeline-locale.test.js",
"changelog.d/1868-expire-reason.fixed.md"
],
"checks": {
"ran": "cd plugins/workflow && TZ=UTC npm test; node scripts/lint-plugins.mjs; node .github/scripts/check-mojibake.mjs --check; node .github/scripts/changelog.mjs check",
"result": "green",
"at": "c5180fe0f51d58ead79e2d2fae0b124b95e6f8a4"
},
"next": "none — ready for review (T2: a PASS is needed at the tip)"
}

A step that is still working is killed by the same timer as one whose Bot
never answered, so "no reply for N minutes" sent the reader looking for a
missing reply. Name the deadline the step reached, and let define_workflow
carry stepTimeoutMinutes (1..120) so a new lane is not stuck on the
45-minute default.

Refs #1868
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 30, 2026
@Birfy Birfy self-assigned this Oct 30, 2026
@Birfy

Birfy commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at c5180fe
Written-by: Reviewer
Attestation: c5180fe role=Reviewer

Ran at this tip:

$ cd plugins/workflow && node --import ./test/resolve.mjs --test "test/*.test.js"
# tests 328  # pass 328  # fail 0
$ cd plugins/workflow && node --import ./test/resolve.mjs --test test/deadline.test.js test/timeline-locale.test.js
# tests 24  # pass 24  # fail 0
$ cp base-plugins_workflow_src_service.js tip/plugins/workflow/src/service.js && cp base-plugins_workflow_index.js tip/plugins/workflow/index.js
$ cd tip/plugins/workflow && node --import ./test/resolve.mjs --test test/deadline.test.js
# tests 13  # pass 10  # fail 3
$ node .github/scripts/changelog.mjs check
# 12 fragment(s) in changelog.d/ are well formed
$ node .github/scripts/check-mojibake.mjs --check
# mojibake: ok — 0 occurrences of U+FFFD

The two base files above are the blobs of plugins/workflow/src/service.js and index.js at b96bbc18, fetched from the contents API.

Review notes (T2, 7 files, +86/−20, base b96bbc18, mergeable clean):

  • Red first, at the tip: with expireStep() and define() put back to their base blobs, test/deadline.test.js fails 3 — both new #1868 cases and the older #1530 case that pinned the old 超时 wording. With the tip source restored, the same command is 24/24 green. The new cases pin run.failure.text step deadline reached (45 min), failure.code still step-failed, nodeName still the step, Bots still released, the timer still cleared, and the bad-value refusal stepTimeoutMinutes is an integer from 1 to 120.
  • expireStep() keeps everything but the copy: same hard deadline, same endRun code, same release + drain, same one warn line. The new stage key is carried by both the service text and the zh map in plugins/workflow/client.js, and timeline-locale.test.js follows it, so the zh line is not an English key.
  • define() forwards stepTimeoutMinutes, and forwards undefined when the caller sends undefined/null/'' — that is what keeps "omitted means 45" from turning into a refusal of 0 for every existing caller. The third case in the second new test covers exactly that.
  • Scope: compare b96bbc18...c5180fe is 1 commit, 7 files, exactly the files the body names; no core/, no patches/, no ds-bot/, so no patch regeneration is owed. The subsystem doc is updated in the same diff and the changelog fragment passes its check.
  • Checks at the tip: tests-ok green, every plugin job green, merge-gate green; the only failure is enqueue-guard — no Verifier report names the tip c5180fe0…, which is this report.
  • Body metadata: Fixes #1868, Owner: Dev, Reviewer: Reviewer (not the Owner), agent-pr present, checkpoint block 1332 chars, summary 562, checks.at at this tip.

Not run: npm run verify whole (this box has no git, so check-arch-docs cannot diff origin/main; the workflow suite, changelog and mojibake checks were run directly), the core suite (no core/ file in this diff), and the smoke test (no index.js/src/host/ change).

@github-actions github-actions Bot added the pass label Oct 30, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit c1ff15c Oct 30, 2026
13 of 15 checks passed
@Birfy
Birfy deleted the fix/1868-step-deadline-reason branch October 30, 2026 21:03
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workflow: a step that is still working is killed at the 45-minute deadline and reported as "no reply"

1 participant