Skip to content

fix(assess): multi-command output drops second command on paste — use line-continuation in Commands block #681

Closed as not planned

Description

@admarble

Summary

When /assess recommends actions for multiple issues that don't share a single workflow group, the Commands: block emits two (or more) separate command lines:

Commands:
  npx sequant run 677 674 -Q
  npx sequant run 672 -Q --testgen

Pasting this block into a terminal silently runs only the first command. The second line is lost.

Root cause

This is not a visual-formatting bug — it's a stdin-ownership bug inherent to the output shape.

sequant run is a long-running foreground process that reads stdin (HITL prompts, renderer input). On a bracketed multi-line paste, the terminal delivers all bytes as one stream:

  1. The shell executes line 1 → npx sequant run 677 674 -Q takes over the TTY and owns stdin.
  2. The remaining bytes (npx sequant run 672 -Q --testgen\n) are still in the input stream, but the running sequant process now owns stdin, so it consumes/buffers them instead of the shell receiving them after exit.

Net effect: the second run never executes. No whitespace/indent change fixes this — line 1 must not be a complete command at the moment the shell hits the newline.

Observed (#677/#674 ran; #672 was dropped):

sequant % npx sequant run 677 674 -Q
    npx sequant run 672 -Q --testgen
SEQUANT WORKFLOW
  ...
  Issues         #677, #674        ← only the first command ran

Proposed fix

Join multi-line command groups with a trailing line-continuation (&& \\) so the block stays one-command-per-line (scannable) but pastes as a single logical command:

Commands:
  npx sequant run 677 674 -Q && \\
  npx sequant run 672 -Q --testgen

Why && \\:

  • The trailing \\ makes line 1 syntactically incomplete, so the shell waits for line 2 instead of executing and grabbing stdin. This is the same convention every multi-line shell README already uses — no new vocabulary for the user.
  • && runs the second group only if the first exits 0 (a QA-gate failure / crash / Ctrl-C stops the chain — generally the safe default).
  • Visually near-identical to today's output: one command per line, fully scannable. Satisfies the skill's "scannable in under 5 seconds" principle.

Deliberately NOT doing

Acceptance Criteria

  • AC-1: When the Commands: block contains 2+ command lines, all but the last line end with && \\ so the block pastes as a single shell command and every run executes.
  • AC-2: A single-command Commands: block is unchanged (no trailing continuation).
  • AC-3: The chained form is documented in the Command Block Rules section of the assess SKILL.md (rationale: paste-safety, not cosmetics).
  • AC-4: Change applied across all three skill mirror dirs — .claude/skills/assess/, templates/skills/assess/, skills/assess/ — and the batch examples updated to match.
  • AC-5: No box-drawing / Terminal N: labels introduced (keep the dashboard scannable; honor the no-box-drawing rule).
  • AC-6: Decide & document behavior for 3+ command groups (long single chained line vs. acceptable) — note the chosen convention.

Edge cases / open questions

  • && vs ;: && stops the chain on first-group failure (incl. Ctrl-C → non-zero). For independent issues ; would always run both, but Ctrl-C then immediately launches the next group — usually unwanted. Recommend &&; confirm during spec.
  • The posted per-issue <!-- assess:* --> markers are one-per-issue and unaffected — this is display-shorthand only.

References

Activity

  1. added
    enhancement
    cli
    ui
    on May 30, 2026
  2. admarble commented on May 31, 2026

    @admarble
    ContributorAuthor

    Closing — root cause was wrong

    The original premise of this issue (multi-command Commands: block silently drops the second command on paste) is incorrect, disproven by a real run.

    What actually happened

    Pasting the two-line block ran both commands, consecutively:

    npx sequant run 677 674 -Q       → completed (PR #679 / #680, ~22m)
        npx sequant run 672 -Q --testgen → then ran (a second SEQUANT WORKFLOW block, Testgen enabled)
    

    Mechanism:

    • zsh executes line 1; the pasted bytes for line 2 stay queued in the terminal input buffer.
    • The sequant run process reads stdin during the run but does not consume the queued line — because no HITL prompt fired, nothing actively pulled from stdin.
    • When line 1 exits, zsh picks the buffered line back up and runs it.

    The earlier "only #677/#674 ran" observation was a mid-run screenshot, not a dropped command — the second run simply hadn't started yet.

    Residual (narrow) risk — not tracked here

    There is a much smaller theoretical edge case: if a HITL prompt fires mid-run while a second command sits queued in the tty buffer, the prompt's stdin read could consume those buffered keystrokes — corrupting both the queued command and the prompt input. This is conditional, shell/terminal-dependent, and the proposed && \\ fix doesn't cleanly address it. Not worth tracking pre-traction; can be re-filed with correct scope if it's ever observed in practice.

    Closing as not planned — the bug as described does not exist.

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

    clienhancementui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions