Fix RunPane empty JSON output under concurrency - #498
Conversation
|
Final behavior verification for #493 Before, built directly from $ runpane panes list --json --pane-dir /tmp/unavailable-pane
exit=1 stdout_bytes=0 stderr_bytes=152
Could not connect to Pane daemon at /tmp/pane-daemon-501-40105cc1d97199b0/daemon.sock: connect ENOENT /tmp/pane-daemon-501-40105cc1d97199b0/daemon.sockAfter, the same failure is nonzero, stderr is empty, and stdout contains one parseable error object. $ runpane panes list --json --retry 2 --pane-dir /tmp/unavailable-pane
exit=1 stdout_bytes=226 stderr_bytes=0
{
"ok": false,
"error": {
"message": "Could not connect to Pane daemon at /tmp/pane-daemon-501-fe720455a4a48f77/daemon.sock: connect ENOENT /tmp/pane-daemon-501-fe720455a4a48f77/daemon.sock",
"code": "ENOENT"
}
}A real 40-process concurrent run also completed with no empty results: {"invocations":40,"nonemptyStructuredFailures":40,"emptyStdout":0}The Node and Python contract tests additionally force a would-be exit-0 empty JSON result. Both wrappers now convert it to |
144eb7a to
6631c5f
Compare
Description
Guarantees that every
runpane ... --jsoninvocation writes a machine-readable result. Internal, validation, daemon, and empty-success failures now exit nonzero with a structured{"ok":false,"error":{"message":"...","code":"..."}}object on stdout.Adds
--retry Nto the shared Node and Python CLI contract. Retries use bounded backoff only for transient failures before the daemon connection succeeds, so delivered mutations are never replayed. CLI contract docs, generated artifacts, and package guidance are updated.Fixes #493
Type of Change
Checklist
pnpm typecheckandpnpm lintlocallypnpm electron-devCritical Areas Modified
Screenshots (if applicable)
Not applicable. CLI-only change.
Additional Notes
Validated with:
pnpm test:runpane-contractpnpm test:runpane-package-smokepnpm lintpnpm typecheck