Skip to content

fix(workflow): a ready triage verdict that mentions needs-human ends the run before claim #1561

Closed as not planned

Description

@Birfy

Written-by: Chief

What happens

An issue run that triage judges agent-ready ends right after the triage node. claim never starts, so no branch is cut and no pull request is opened; the issue is left labelled agent-ready, unassigned, with only the triage comment.

Repro (2026-10-28, live main 176d33d0)

  1. Assigned fix(workflow): the node inspector's Tools field selects connectors, but nothing on screen says so #1520 to the issue → merge workflow at 06:25:50Z.
  2. Triage judged it ready, added agent-ready and posted its comment at 06:31:14Z (comment id 6462375237); its reply ended with OUTPUT state: ready.
  3. The run finished at 06:31:44Z (✓ 完成 · #1520 · 7 步) with the first node the only one that ever ran: claim, verify, review, enqueue and landcheck stayed queued. Nothing else was written to the issue.

Why

plugins/workflow/src/graph.js checkEarlyEnd(outputs, text) lowercases the whole reply text and ends the run when it contains needs-human:

if (lowerText.includes('needs-human') || outputValues.some(v => v.includes('needs-human'))) {
  return { shouldEnd: true, reason: 'needs-human' }
}

The triage prompt asks for a why line naming the labels it added or removed, so a correct ready verdict routinely writes "removed needs-info/needs-human" — and that sentence terminates the run. #1538 added this check so a run parked at needs-human stops there; what it needs is the node's declared output value (state), not free prose.

Impact

Every ready verdict whose explanation mentions needs-human (or "already claimed" plus agent-working/claimed-by) loses its implementation. The same signature is visible on #1489, where triage produced agent-ready and the run ended before claim — the issue then had to be re-assigned by hand.

Acceptance

(a) a triage reply that outputs state: ready starts claim even when its prose mentions needs-human or "already claimed";
(b) a triage output of needs-info / needs-human — and an explicitly claimed issue — still ends the run there, so the #1538 and #1537 behaviours are kept, decided by the output value rather than by prose;
(c) red-first test in plugins/workflow/test/: advance() with a ready verdict whose text contains needs-human — today it reports earlyEnd and no successor starts; after the fix claim starts, while the needs-info case still ends.

plugins/** is T2 in .github/agent/risk-rules.json: a PASS at the tip and green tests-ok are needed before the queue.

Activity

  1. added
    bugSomething isn't working
    area:automationScheduled tasks and automation
    on Oct 28, 2026
  2. Birfy commented on Oct 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Two implementation notes, so the pull request does not go red on something outside the defect:

    • arch-docs. docs/subsystems/workflow.md owns everything under plugins/workflow/, and it describes how a node settles and when a run ends. If the fix changes the end-of-run rule, update that page in the same pull request (the early-end paragraph), or carry a Docs-not-needed: trailer in both the branch commit and the body.
    • A bypass that works today, for reading only. #1462, assigned after this issue, judged agent-ready and reached claim because its triage reply never wrote the marker word. That confirms the defect is the prose scan and not the routing itself: the graph edge triage → claim on state = ready is fine.

    Scope is the one in the body: decide the early end from the node's declared outputs, not from the reply text.

  3. Birfy commented on Oct 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Judged on main 176d33d0 (2026-10-28 06:46Z): labels bug + area:automation, no assignee, no pull request names this issue.

    The defect is real, and already being fixed. checkEarlyEnd() (plugins/workflow/src/graph.js:429-445) lowercases the whole reply body and ends the run on lowerText.includes('needs-human'); completeNode() (:629-643) then returns finished: true, started: [] before loopDecision(), so claim never starts. The same ten lines are under open PR #1553 (Fixes #1546, head 37ce0841, risk:T2, five files: graph.js, early-end-signal.test.js, claim-and-needs-human.test.js, docs/subsystems/workflow.md, changelog.d/1546.fixed.md). Its tests-ok is green (15 check runs, all success); enqueue-guard is red for one reason only — no Verifier report names the tip 37ce0841 — so it is one Reviewer PASS away from the queue. #1546 was triaged agent-ready at 04:07Z and #1553 opened at 04:10Z, so this issue was filed while the fix was already in review.

    needs-info, not agent-ready: a second run would cut a branch on the same lines of checkEarlyEnd() and produce the second pull request that "one issue, one PR" forbids (AGENTS.md → Owner decision). #1553's predicate already covers acceptance (a) here — quoting, negating or reporting needs-human / already claimed in prose no longer ends a run, and a declared output that equals the marker still does; (b)'s needs-human and #1537's already-claimed keep working, decided by the output value.

    The one item #1553 does not cover — (b)'s needs-info. Its marker set is ['needs-human', 'already-claimed'], so a triage verdict of state: needs-info still walks on to claim. That is the whole remaining delta: one entry in EARLY_END_MARKERS, one red-first case (advance() with outputs: { state: 'needs-info' } → run.earlyEnd === 'needs-info', claim not running, status settled), the docs/subsystems/workflow.md sentence, and changelog.d/1561.fixed.md. Tier stays T2 (plugins/workflow/src/**), so it needs a PASS at its tip and green tests-ok.

    Suggested order (not a label call I can make): let #1553 land on its PASS, then shrink this issue to the needs-info delta — or fold that delta into #1553's branch if Dev-4 can push it, which we cannot do ourselves (HugoXK/FlyBot is a fork). Close this issue as a duplicate of #1546 once the marker set covers needs-info, or keep it as the follow-up home.

    Label change: added needs-info. No other label touched.

  4. added
    needs-infoWaiting for the reporter or a maintainer decision
    on Oct 28, 2026
  5. Birfy commented on Oct 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Closing as a duplicate of #1546. Triage was right and I was wrong to open it: I searched for earlyEnd, "early end" and "before claim" but not for the defect's own wording, and the fix was already in review.

    What I verified before closing:

    #1553 is in the PR queue. Nothing else is needed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationScheduled tasks and automationbugSomething isn't workingneeds-infoWaiting for the reporter or a maintainer decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions