Commit f157df3
status: distinguish API down from unreachable (#170)
## Summary
Splits the failure handling for `kernel status` so the message
accurately reflects what happened, instead of collapsing both transport
errors and non-2xx responses into one ambiguous "Could not reach Kernel
API" line.
Three failure cases now:
- **Transport error on `/status`** (network down, DNS, timeout) → `Could
not reach Kernel API. Check https://status.kernel.sh for updates.`
- **Non-2xx from `/status`, `/health` also unhealthy** → `Kernel API is
down. Check https://status.kernel.sh for updates.`
- **Non-2xx from `/status`, `/health` returns 200** → `Kernel API is
responding but /status is unavailable. Check https://status.kernel.sh
for updates.`
The `/health` probe matters because `/status` has an upstream dependency
on incident.io, so a 5xx from `/status` doesn't necessarily mean the API
itself is down. `/health` is a dependency-free liveness check on the
same server, so a 200 there confirms the API is up and only the status
endpoint is broken.
No new helpers, no synthetic UI rendering — reserves the dotted status
UI for real data from the API (same convention the dashboard's status
indicator follows).
## Test plan
- [x] Healthy run against prod still renders the status UI as before
- [x] Transport error (unreachable host) prints "Could not reach Kernel
API…"
- [x] `/status` 5xx + `/health` 5xx prints "Kernel API is down…"
- [x] `/status` 5xx + `/health` 200 prints "Kernel API is responding but
/status is unavailable…"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> CLI-only error messaging and an extra HTTP probe on failure paths; no
auth, data, or API contract changes.
>
> **Overview**
> **`kernel status`** now uses different error messages instead of one
generic “Could not reach Kernel API” for both network failures and bad
HTTP status from `/status`.
>
> When `/status` returns a non-2xx, the CLI probes **`/health`** (3s
timeout). If `/health` is healthy, users see that the API is up but
**`/status`** is unavailable; otherwise they see that the API is down.
Transport errors on the initial `/status` request still report that the
API could not be reached.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5622e69. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 2136989 commit f157df3
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
0 commit comments