Skip to content

fix(run): parallel mode drops per-issue warnings, not just progress — spec-parse failure, PR-after-exec failure and checkpoint-commit failure are silent on every MCP run #1342

Closed

Description

@admarble

Tier: mechanical Found: 2026-10-06, #1341 upstream trace

Problem. In runIssueWithLogging (src/lib/workflow/batch-executor.ts), const log = config.parallel ? () => {} : console.log.bind(console) makes every per-issue message a no-op in parallel mode. Parallel has been the default for multi-issue runs since #404 (2026-03-24), and every MCP sequant_run uses it. The no-op was meant to keep per-issue progress lines from interleaving. It also swallows warnings, which aren't progress. These three are not gated on verbose, and none of them appears in any MCP run's rawOutput:

#1340 (#1311 AC-3) fixed one more site, the placeholder-body warning, by calling console.log directly, as createPR does.

Constraint. On a TTY, the CLI renders the boxed Ink TUI (#705). A raw console.log during a TUI run can corrupt the live zone (#655 class). The fix needs a warning channel that reaches MCP rawOutput and non-TTY output, and on the TUI path goes through the renderer, not straight to stdout.

AC

  • AC-1: In parallel mode, a warning-level per-issue message (one marked !/⚠️, or yellow/red) reaches the run's output instead of being dropped, including the three sites above. Progress lines stay suppressed. Evidence: a batch-executor test with parallel: true that triggers the spec-recommendation parse failure and asserts the warning appears, mutation-verified by routing it back through the no-op log.
  • AC-2: Under the TUI, these warnings go through the renderer's channel, not raw stdout. Evidence: a test with the TUI adapter asserting the warning is delivered through it and not via console.log.
  • AC-3: A gate rejects new log(chalk.yellow|red(…)) calls inside runIssueWithLogging that bypass the warning channel. Evidence: a gate test scoped to batch-executor.ts, mutation-verified.

Non-Goals

  • Showing per-issue progress lines in parallel mode.
  • Changing what --verbose adds.

Refs #404, #1311, #1340, #1341

Activity

  1. admarble commented on Oct 8, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (3 ACs, 2 directories)

    AC Quality Check

    • AC-1: Evidence is a test + mutation; fine. "reaches the run's output" is measurable only via a console/notice spy — name the spy in the test.
    • AC-2: "TUI adapter" is not a type in the repo; the real seam is PhasePauseHandle.appendNotice (see Plan). Evidence stays valid if the test passes a fake handle.
    • AC-3: Evidence is a gate scoped to batch-executor.ts. Must slice to the runIssueWithLogging body (not whole file) per the CLAUDE.md gate-test rule.

    Scope Assessment

    Non-Goals: present (no per-issue progress in parallel; --verbose unchanged).

    Metric Value Status
    Feature count 1 ✅
    AC items 3 ✅
    Directory spread 2 (src/lib/workflow, eslint/test) ✅

    Verdict: ✅ SCOPE_OK

    Acceptance Criteria

    AC-1: warnings survive parallel mode

    Verification: Unit Test (batch-executor.test.ts)
    Scenario: Given parallel: true and spec output with no parseable recommendation → When runIssueWithLogging runs → Then "Could not parse spec recommendation" reaches the output; Issue #N / Worktree: progress lines do not.
    Assumptions: the three named sites plus every other log(chalk.yellow(...)) warning count (see Sibling scan).

    AC-2: TUI path goes through the renderer

    Verification: Unit Test
    Scenario: Given a fake PhasePauseHandle with appendNotice spy and console.log spy → When a warning fires → Then appendNotice called once, console.log not.

    AC-3: gate on bypassing log(chalk.yellow|red(...))

    Verification: Unit Test (gate), mutation-verified
    Scenario: Given the source of batch-executor.ts sliced to the runIssueWithLogging body → Then zero log(chalk.yellow|red( calls remain outside the warning helper. Mutation: revert one site to log(chalk.yellow(…)); this test fails; restore.

    Implementation Plan

    Phase 1: warning channel

    1. In runIssueWithLogging (batch-executor.ts:1138), add const warn = (msg: string) => bracketedConsoleLog(phasePauseHandle, chalk.yellow(msg)) next to log, importing ./notice.js (existing helper from fix(cli): #624's duplicate-header fix doesn't catch real log-update/scrollback bug (v2.3.0 regression confirmed) #647: appendNotice when a handle exists, else console.log). No new surface on ProgressCallback/renderer.
    2. Convert warning sites inside runIssueWithLogging: :1633, :2189, :2568, plus the other yellow ones (:1169 state tracking, :1317/:1327 relay, :2657 relay deactivation). Replace the :1263 console.log (fix(#1311): drivers join agent text on line boundaries, so exec's ## Summary reaches the PR body #1340) with warn so there is one channel.
    3. Keep chalk.yellow(formatEvidenceBundle(...)) (:1562,1904,2210,2438) decision in Open Questions; they are halt reports, arguably warnings too.

    Phase 2: tests + gate

    1. AC-1/AC-2 tests in batch-executor.test.ts using existing parallel-mode harness; run each mutation (route back through no-op log).
    2. AC-3 gate test slicing runIssueWithLogging's body; record Mutation-verified: markers with test file path first in PR body.

    Design Review

    1. Where does this belong? batch-executor.ts, reusing notice.ts; the helper already encodes the TUI-vs-plain routing.
    2. Simplest approach? One warn wrapper over bracketedConsoleLog. Rejected: new "warning" ProgressCallback event (touches types, orchestrator, renderer, MCP — far larger); rejected: un-gating log for all (restores interleaving).
    3. Pattern / re-patch count: same pattern as fix(#1311): drivers join agent text on line boundaries, so exec's ## Summary reaches the PR body #1340 (direct console.log per site), which is a one-off patch of one site; this issue is the class fix for the file. Prior: Default execution mode is serial despite being labeled parallel #404 introduced the no-op, fix(#1311): drivers join agent text on line boundaries, so exec's ## Summary reaches the PR body #1340 patched one site → 1 prior fix, so fixing the class here is right.
    4. Reviewer challenge: "Why not a ProgressCallback event?" — larger blast radius, and appendNotice is the documented renderer channel for out-of-flow notices (fix(cli): #624's duplicate-header fix doesn't catch real log-update/scrollback bug (v2.3.0 regression confirmed) #647).
    5. Producers/consumers: log has other holders — runReadyGateForIssue takes log as an argument (:970, :1052–1092 call it); :951 is in a separate function. Those yellow warnings need the same treatment or an explicit exclusion. Consumers: MCP rawOutput (captures stdout), TUI via phasePauseHandle.

    Feature Quality Planning

    • Verify phasePauseHandle is actually populated on the TUI path in run.ts/run-orchestrator.ts; if the Ink TUI does not supply one, AC-2 needs the handle wired there, not just here.
    • Parallel runs from multiple issues interleave warning lines; acceptable (warnings are rare, and the issue asks for it).

    Open Questions

    1. Evidence-bundle yellow output (:1562,1904,2210,2438) — Recommendation: include; they are halt/divergence warnings. Impact: still silent on MCP if excluded.
    2. Sibling log callers outside runIssueWithLogging (:951, ready-gate) — Recommendation: convert :951 and pass warn into the ready gate; AC-3 scope stays on runIssueWithLogging per the AC text.
    3. Does the TUI provide a PhasePauseHandle? — Recommendation: confirm in Phase 1; if not, wire it (adds a step).

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Mechanical, single-file fix. Tests are authored with the change, so testgen adds nothing. No UI files, so no test phase.

    Label Review

    Current: none. Recommended: bug, planned. Quality Loop: won't auto-enable.

  2. added
    planned
    on Oct 8, 2026
  3. admarble commented on Oct 8, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 3/3 met

    Gaps:

    • Gate-test ACs AC-1 and AC-3 lack recorded mutation markers (QA ran the mutations and they fail as expected); add markers to exec's final ## Summary
    • Required CI checks still pending at QA time
    • AC-3 gate misses template-embedded chalk or non-yellow warning lines — dropped: AC-3 text scopes the gate to log(chalk.yellow|red(...)) calls

    Suggestions:

    • The AC-3 regex only catches log(chalk.yellow|red( written directly. It would miss a log(`${chalk.yellow(…)}`) template string, or a !/⚠️ warning printed in another colour. One loop-iteration line was changed from yellow to cyan, which is correct because it is progress, not a warning.
  4. added a commit that references this issue on Oct 8, 2026
  5. added 2 commits that reference this issue on Oct 28, 2026
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

    planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions