fix(workflows): stop masking blocked returned statuses as completed - #1685
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Review: fix(workflows): block exhausted auth fallbacksReviewed the full diff. This is a well-scoped, well-tested fix. The core problem — workflow-defined incomplete reducer outputs ( What I verified
Discussion points (non-blocking)
Test coverageStrong — regression tests cover the Goal-like Note: I could not execute Overall: looks good to merge. The discussion points are all optional polish. |
ac03ed9 to
d92c78c
Compare
Review: fix(workflows): block generic auth fallback exhaustionThanks for this — the core idea (don't let a run that stopped on recoverable auth/rate-limit/provider-exhaustion masquerade as 1. Text-mining generic output fields risks false positives (correctness)
That means a successful run whose summary/result legitimately describes provider/rate-limit work could be reclassified as Given the PR explicitly targets runs that did not return a 2. failFast: true on the reviewer batch is strictly less tolerant (behavior change)In This is fine for the intended "all fallbacks exhausted / total auth outage" case, but it also converts a single transient reviewer failure (e.g. one reviewer's model hits a 429 after exhausting its own fallbacks, while the other two would have succeeded) into a hard 3. Performance: effectiveRunStatus re-classifies on every call in the render hot path
Recommend computing 4. Two parallel reimplementations of the same status derivation (maintainability)
5. Minor
Nice touches
Note: I could not run |
d92c78c to
86359ed
Compare
PR Review:
|
Normalize workflow returned statuses such as needs_human and auth_blocked as blocked terminal states, preserve actionable auth/provider failure text, and fail fast when Goal reviewer fallbacks are exhausted. Add regression coverage for returned-status finalization, status rendering, lifecycle notices, and Goal reviewer fail-fast behavior. Update workflow docs and changelog. AI-assisted-by: GPT-5.5
86359ed to
29b25bd
Compare
|
@/tmp/tmp.OeJE807R7p |
Review:
|
Summary
Workflow-returned terminal statuses beyond
failed/blocked(e.g.needs_human,incomplete,auth_blocked) were being rendered as successfulcompletedruns. This let exhausted model/provider fallbacks in reviewer-gated workflows (like Goal) silently disappear behind a green completion notice instead of surfacing as a resumable, human-actionable blocked state. This PR normalizes returned-status handling across the run lifecycle and makes Goal's reviewer batch execution fail fast instead of burning another worker turn when reviewers can't run.Changes
src/shared/returned-run-status.ts(new): shared helpers —normalizeReturnedWorkflowStatus,isReturnedBlockedWorkflowStatus,isReturnedResumableBlockedWorkflowStatus,actionableReturnedStatusText(falls back throughsummary→remaining_work→result), andeffectiveRunStatus(recomputes a run's true terminal status from its returnedresult.status, even when the stored run iscompleted).src/engine/run-returned-status.ts:classifyReturnedRunStatusnow recognizes the full set of returned blocked statuses (blocked,needs_human,incomplete,active,auth_blocked), not justfailed/blocked. Recoverable auth/provider/rate-limit blocked statuses are classified viaclassifyWorkflowFailureand markedresumable: truewith preserved failure metadata (failureKind,failureCode,retryAfterMs, etc.).src/engine/run-durable-finalize.ts: durable status persistence no longer force-overridesresumabletofalsefor blocked runs, so recoverable blocked metadata survives into durable storage.src/engine/run.ts: wires the updated returned-status classification into the run lifecycle.src/extension/lifecycle-notifications.ts: terminal notices useeffectiveRunStatusand surface the actionable returned-status text as the notice error for blocked/failed returned states.src/runs/background/status.ts:statusRuns/inspectRunreporteffectiveRunStatusinstead of the raw stored status, and backfillerrorfrom the actionable returned-status text when the raw status doesn't match the effective one.src/tui/status-list.ts:/workflow statusrendering (accent colors, trailing labels, card meta, stage cells, counts, badges, icons) is driven byeffectiveRunStatus; adds a dedicatedblockedbucket/badge distinct fromcompleted.builtin/goal-runner.ts: reviewer batch execution now usesfailFast: true; when the batch throws, the workflow no longer retries with another worker turn — it records aneeds_humanreducer decision with the collected remaining work, appends astatus_decidedlifecycle event, persists the ledger, and stops.packages/coding-agent/docs/workflows.md's reservedstatusoutput convention and added a workflows changelog entry.Tests
test/unit/workflow-returned-status.test.ts— returned-status normalization/classification, including recoverable auth/provider/rate-limit blocked metadata.test/unit/background-status-01.test.ts— legacycompletedsnapshots with an incomplete returned status now report as blocked viastatusRuns/inspectRun.test/unit/workflow-lifecycle-notifications-01.test.ts— lifecycle notices for returned incomplete/blocked statuses.test/unit/status-list-render.test.ts—/workflow statusrendering of the new blocked bucket/badge.test/unit/builtin-workflows-goal-reviewer-failfast.test.ts— Goal reviewer-batch fail-fast behavior on fallback exhaustion.Validation
bun run lint,bun run check:file-length,bun run test:unit.bun run typecheck,bun run lint,bun run check:file-length,git diff --check, and a terminal smoke test of/workflow statusrendering.Notes