feat(diagnostics): separate an unreachable CLI from provider setup (#288)

* feat(diagnostics): separate an unreachable CLI from provider setup

An empty popup had one answer for two different problems. A provider that is
not set up and a codexbar executable Plasma cannot run both ended in the same
generic message, so the offered action was wrong half the time: "Retry" cannot
succeed when the command never started, and "enable a provider" is misleading
when the widget never reached the CLI.

Classify the failure by the shell's exit code rather than by its message. POSIX
reserves 127 for a command that was not found and 126 for one that exists but
cannot be executed, and both codes hold in every locale while the matching
stderr text does not. The guard lives in Guards.js, next to the other shared
trust-boundary rules, and rejects anything that is not a numeric or string code,
including a single-element array that would otherwise coerce to 127.

When that classification holds and no provider data survives, the popup says
CodexBar CLI not found, names the configured command, and sends the user to
Diagnostics for an absolute path. Retained providers, a refresh in flight, and
the global views keep precedence, so the state only claims an empty popup it can
explain.

Diagnostics gains the three facts a bug report needs: the widget version, and,
after Check versions, the CLI version and the absolute command the shell
resolved. One process reports both CLI facts, since the configured value can be
a bare name whose resolution through Plasma's PATH is exactly what is in doubt.
Its stdout is untrusted, so the resolved path is accepted only as a single
absolute path and the version banner is redacted and length-bounded.

Documentation impact: documents both states in the usage guide and the README
troubleshooting section, and records them under CHANGELOG Unreleased. The new
strings are translated in all five shipped catalogs. TODO is unaffected: no
parity status or CLI contract changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(diagnostics): preserve spaces in resolved CLI paths

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
f2b47be1f1Simone committed on 9/18/2026, 10:23:17 PM· committed by GitHubparenta385c90
20 files changedLine totals unavailable