Skip to content

Report repeated batch start failures once, with a count - #33

Merged
HalRiveria-Bot merged 2 commits into
mainfrom
fix/start-failure-messages
Nov 3, 2026
Merged

HalRiveria-Bot merged 2 commits into
mainfrom
fix/start-failure-messages

Conversation

@HalRiveria-Bot

Copy link
Copy Markdown
Collaborator

What was wrong

A batch whose program isn't installed printed one identical red line per command, so 5,000 commands gave 5,000 lines. Each line named ProcessDispatch and JobStarter, which batch users never touch. Separately, a bad TimeoutSeconds key on a dispatcher job blamed the JobStarter, which never ran.

What changed

  • The batch prints the first failure for each program and cause in full, then one line at the end: Invoke-PkProcessBatch: 4 more commands couldn't start 'x' (The system cannot find the file specified).
  • Every command is still tried and still gets its own StartError, so Results doesn't change.
  • Repeats are matched on the file path (ignoring case) and Windows' error code, not the message text, because on PowerShell 7 the text for one failure differs by working directory. Start-PkProcess keeps the original exception as the inner one so the code can be read.
  • The summary still prints when -OnComplete throws or an abort ends the batch.
  • The dispatcher still reports every failed start, since custom starters can throw anything. A bad key there now reads ProcessDispatch: a job couldn't start: ....
  • StartFailureReported is a new reserved job key.
  • README: the collapsed message, and a note that a progress counter driven from -OnComplete won't reach the total if commands couldn't start.

Behavior to note

  • Anyone counting per-command messages through Set-PkMessageHandler sees fewer. Count from Results instead.
  • Commands failing for one reason in different folders collapse together, so only the first bad folder is named on screen. Each command's folder is still on its result.

Testing

Harness passes on Windows PowerShell 5.1 and PowerShell 7 (342 assertions, none skipped), run one after the other. 11 of the new assertions failed before the change.

🤖 Generated with Claude Code

HalRiveria and others added 2 commits November 2, 2026 21:05
A batch whose program isn't installed printed one identical red line per
command, naming dispatcher internals the caller never touched. Now the first
failure for a program and cause prints in full, and one line at the end counts
the rest. Every command is still tried and still gets its own StartError.

Repeats are matched on the file path and Windows' error code, not the message,
because on PowerShell 7 the message for one failure differs by working
directory. Start-PkProcess now keeps the original exception as the inner one.

A bad TimeoutSeconds key on a dispatcher job no longer blames the JobStarter,
which never ran. The dispatcher still reports each failed start, since custom
starters can throw anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria-Bot
HalRiveria-Bot merged commit 3188872 into main Nov 3, 2026
2 checks passed
@HalRiveria-Bot
HalRiveria-Bot deleted the fix/start-failure-messages branch November 3, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants