Fix gateway status probes for OpenClaw 2.0 path change - #85
Open
courtneyr-dev wants to merge 1 commit into
Open
courtneyr-dev wants to merge 1 commit into
courtneyr-dev wants to merge 1 commit into
Conversation
OpenClaw 2.0 removed the /api route prefix: the gateway answers 200 on /v1/status but 404 on /api/v1/status, so every probe (Site Health test, status REST route, settings connection test, wp pinch status) reported the gateway unreachable while chat kept working. New Rest\Helpers::gateway_status_request() probes the legacy path first and retries /v1/status only on a 404 — no behavior change for 1.x gateways. Each call site keeps its previous transport (wp_remote_get vs wp_safe_remote_get) via the $safe flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
OpenClaw 2.0 removed the
/apiroute prefix from the gateway. Against a 2.0 gateway (verified on a live Elestio instance today)/v1/statusanswers 200 while the/api/v1/statuspath this plugin probes answers 404 — so the Site Health test reports a critical "cannot reach the AI gateway", the settings connection test fails,wp pinch statusshows disconnected, and the status REST route reportsconnected: false, all while chat/webhooks keep working.This adds
Rest\Helpers::gateway_status_request(), which probes the legacy/api/v1/statusfirst and retries/v1/statusonly on a 404, and routes all four call sites through it:includes/class-site-health.php(Site Health test)includes/Rest/Status.php(status REST route)includes/Settings/Settings_Admin_Pages_Trait.php(connection test)includes/CLI/Status_Command.php(wp pinch status)1.x gateways see no behavior change (legacy path still tried first and still succeeds). Each call site keeps its previous transport — the two that used
wp_safe_remote_get()still do, via the helper's$safeflag — so no SSRF posture changes either direction.Type of change
Checklist
php -lclean on all five touched files; I couldn't run the fullmake checklocally, happy to fix anything CI flags.Related issues
None filed — found while debugging a Site Health critical after an OpenClaw 2.0 upgrade.