status: distinguish API down from unreachable#170
Open
jarugupj wants to merge 2 commits into
Open
Conversation
When /status returns a non-2xx response the API is reachable but unhealthy, so report it as down rather than reusing the generic 'could not reach' message used for transport errors.
5c1365d to
cfc2591
Compare
…broken Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cfc2591 to
ad44904
Compare
Monitoring Plan: Improve
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the failure handling for
kernel statusso 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:
/status(network down, DNS, timeout) →Could not reach Kernel API. Check https://status.kernel.sh for updates./status,/healthalso unhealthy →Kernel API is down. Check https://status.kernel.sh for updates./status,/healthreturns 200 →Kernel API is responding but /status is unavailable. Check https://status.kernel.sh for updates.The
/healthprobe matters because/statushas an upstream dependency on incident.io, so a 5xx from/statusdoesn't necessarily mean the API itself is down./healthis 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
/status5xx +/health5xx prints "Kernel API is down…"/status5xx +/health200 prints "Kernel API is responding but /status is unavailable…"🤖 Generated with Claude Code
Note
Low Risk
CLI-only error messaging and an extra HTTP probe on failure paths; no auth, data, or API contract changes.
Overview
kernel statusnow prints different errors depending on whether the CLI cannot talk to the API at all, the API is down, or only/statusis failing.When
/statusreturns a non-2xx, the command probes/healthon the same base URL. A healthy/healthyields Kernel API is responding but /status is unavailable; otherwise Kernel API is down. Transport failures on the initial/statusrequest still use Could not reach Kernel API.This separates incident.io-related
/statusoutages from true API unavailability without changing the successful status UI or JSON output path.Reviewed by Cursor Bugbot for commit ad44904. Bugbot is set up for automated code reviews on this repo. Configure here.