Skip to content

Classify CLI server probe failures instead of asserting bb is down - #1218

Merged
ymichael merged 2 commits into
get-bb:mainfrom
sholub-dev:classify-cli-server-probe-failures
Aug 10, 2026
Merged

ymichael merged 2 commits into
get-bb:mainfrom
sholub-dev:classify-cli-server-probe-failures

Conversation

@sholub-dev

Copy link
Copy Markdown
Contributor

Fixes #1216.

Summary

The unknown-command plugin probe caught its fetch error with a bare catch, so every failure — ECONNREFUSED, EPERM from a sandboxed shell, a timeout — printed the same "bb isn't running — open the bb app, then re-run this command." That message asserts a fact the code had no evidence for, and agents act on it: they declare a healthy bb dead and abandon queued work.

The probe now keeps the thrown error, and describeUnreachableServer derives the message from the cause chain:

  • ECONNREFUSED — the only evidence bb is actually down — keeps the existing guidance, now naming the address: bb is not running at <url> — open the bb app, then re-run this command.
  • EPERM/EACCES: Cannot reach bb at <url>: EPERM — the connection was blocked. bb may still be running; check sandbox or firewall rules for this shell.
  • Timeout: bb did not respond at <url> within 2000ms — it may be busy or unreachable.
  • Anything else prints the unwrapped cause chain.

The related built-in-command formatter fix (.cause discarded by getErrorMessage) is #1190; this covers the probe path, which discards the error before any formatter runs.

@ymichael
ymichael merged commit e2cb3fe into get-bb:main Aug 10, 2026
9 checks passed
amadad pushed a commit to amadad/bb that referenced this pull request Aug 14, 2026
…et-bb#1218)

Fixes get-bb#1216.

## Summary

The unknown-command plugin probe caught its fetch error with a bare
`catch`, so every failure — ECONNREFUSED, EPERM from a sandboxed shell,
a timeout — printed the same "bb isn't running — open the bb app, then
re-run this command." That message asserts a fact the code had no
evidence for, and agents act on it: they declare a healthy bb dead and
abandon queued work.

The probe now keeps the thrown error, and `describeUnreachableServer`
derives the message from the cause chain:

- `ECONNREFUSED` — the only evidence bb is actually down — keeps the
existing guidance, now naming the address: `bb is not running at <url> —
open the bb app, then re-run this command.`
- `EPERM`/`EACCES`: `Cannot reach bb at <url>: EPERM — the connection
was blocked. bb may still be running; check sandbox or firewall rules
for this shell.`
- Timeout: `bb did not respond at <url> within 2000ms — it may be busy
or unreachable.`
- Anything else prints the unwrapped cause chain.

The related built-in-command formatter fix (`.cause` discarded by
`getErrorMessage`) is get-bb#1190; this covers the probe path, which discards
the error before any formatter runs.

---------

Co-authored-by: Michael Yong <[email protected]>
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.

CLI asserts "bb isn't running" for any probe failure, without evidence

2 participants