fix: proper OpenClaw health check + scopes header (fixes #36)#39
Open
juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
Open
fix: proper OpenClaw health check + scopes header (fixes #36)#39juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
Conversation
The previous checkConnection() treated HTTP 200-499 as "connected", which meant a 404 (endpoint disabled) or 403 (auth failed) would falsely show the gateway as connected. Tool calls then failed silently. Changes: - Two-step health check: /health first, then /v1/chat/completions - Specific error messages for 401/403 (bad token), 404 (endpoint disabled), and unreachable (gateway not running) - Add x-openclaw-scopes: operator.write header to delegateTask() on both iOS and Android (required by OpenClaw 2026.3.x+) Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Problem
checkConnection()on both iOS and Android treated any HTTP status 200-499 as "connected". This meant:This is the root cause of Issue #36 — first-time users see "Connected" but every tool call returns 404 or 403.
Fix
Two-step health check
/health— verifies the gateway process is running/v1/chat/completions(GET) — verifies the endpoint is enabled and auth worksSpecific error messages
x-openclaw-scopesheaderAdded
x-openclaw-scopes: operator.writetodelegateTask()on both iOS and Android. Required by OpenClaw 2026.3.x+ — without it, all POST requests fail with HTTP 403missing scope: operator.write.Files Changed
samples/CameraAccess/CameraAccess/OpenClaw/OpenClawBridge.swift(iOS)samples/CameraAccessAndroid/.../openclaw/OpenClawBridge.kt(Android)Test plan
🤖 Generated with Claude Code