fix: remote gateway fallback — try Tailscale/public URL before .local#38
Open
juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
Open
fix: remote gateway fallback — try Tailscale/public URL before .local#38juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
juliosuas wants to merge 1 commit intoIntent-Lab:mainfrom
Conversation
OpenClaw tool calls silently fail when the phone is on mobile data because the gateway hostname resolves to a Bonjour .local mDNS address that only works on the same LAN. Changes: - SettingsManager: add openClawRemoteURL (Optional<String>) persisted to UserDefaults; empty string means disabled (local-only mode preserved) - OpenClawBridge: add resolveGatewayBaseURL() that pings /health on each candidate in order — remote URL first, local URL second — and returns the first reachable base URL. Both checkConnection() and delegateTask() use this instead of hardcoding the local host:port. - SettingsView: add 'Remote URL (Tailscale / Public)' field with explanatory caption; wired to load/save in loadCurrentValues()/save() Behaviour: - On home Wi-Fi with no remote URL set → falls through to .local (no regression for existing users) - On mobile data with Tailscale URL set → resolves to Tailscale IP - All gateways unreachable → returns a descriptive error instead of a silent no-op Closes Intent-Lab#35
6 tasks
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
When the phone is on mobile data (or any network other than home Wi-Fi), all OpenClaw tool calls silently fail. The gateway URL is constructed from a Bonjour
.localmDNS hostname that only resolves on the same LAN — on mobile data it simply times out with no user-visible error.This is issue #35.
Changes
OpenClawBridge.swiftAdded
resolveGatewayBaseURL()— pings/healthon each candidate URL in priority order and returns the first reachable one:Both
checkConnection()anddelegateTask()now call this instead of hardcoding the local host:port.SettingsManager.swiftAdded
openClawRemoteURLproperty persisted to UserDefaults. Empty string = disabled (no regression for existing users).SettingsView.swiftAdded Remote URL (Tailscale / Public) text field under the existing Host field, with a caption explaining its purpose. Wired to
loadCurrentValues()andsave().Behaviour
Demo use case
For Talent Land demos — set the Tailscale IP in Remote URL once, the app works anywhere without being on the same Wi-Fi.