Bind the SimpleX channel's wsUrl to the bridge's current address (2026.7.1:6) - #23
Merged
Merged
Conversation
…ent address openclaw.json held the bridge's address as a literal, resolved once when Configure SimpleX was submitted and never revisited. When the address moved, the channel silently stopped connecting and only a re-submit of the action fixed it. main now resolves the bridge's `ws` interface and reconciles openclaw.json before starting the daemon, reading it as a `const` so a changed address re-runs main and restarts the service. Only a reinstall moves the address, and a reinstall also replaces the volume directory behind the file-exchange mounts, which nothing but a restart re-establishes. Wired through an `addressWatchers` list in main, mirroring `mountIntegrations`, so other integrations have an obvious place to go.
MattDHill
approved these changes
Aug 11, 2026
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
openclaw.jsonholds the bridge's address as a literal. It was resolved once, when Configure SimpleX was submitted, and never revisited —bridgeWsUrlwas called from exactly one place and read with.once().So when the address moved, the channel silently stopped connecting, and the only fix was re-submitting the action. Nothing in the UI explained why.
Fix
mainresolves the bridge'swsinterface and reconcilesopenclaw.jsonbefore starting the daemon, reading it as aconst— so a changed address re-runsmainand restarts the service.The restart is the point, not a cost. Measured on StartOS 0.4.0:
mainre-runs → restartOnly a reinstall moves the address — and a reinstall also replaces the volume directory behind the file-exchange mounts, which nothing but a restart re-establishes.
I built the no-restart version first (rewrite config, let OpenClaw hot-reload the channel) and rejected it after testing: the channel reconnected in ~19s and looked healthy while file exchange stayed silently broken on the stale mounts. Messaging works, files don't, nothing reports an error — worse than the original bug. A consumer whose integration has no mounts should prefer that form; this one shouldn't.
Two things worth knowing, both verified rather than assumed
The
bridgeaddress is not the container's own IP.hostname -Iinside the bridge reports a per-instance lease (10.0.3.120) that changes on every stop/start.sdk.host.getwithkind: 'bridge'returns the lxcbr0 gateway plus an allocated forwarded port (10.0.3.1:56649) — note it isn't the container's5225— and that survives everything except a reinstall. Consumers should resolve the interface, never read the container's address.Stopping the bridge doesn't make the address unresolvable. The binding record persists while the package is stopped, so
constnever sees a transientundefinedand can't bounce the service. Confirmed by stopping the bridge and watching OpenClaw: onlyECONNREFUSEDretries on the same port, no restart. That's why noeqguard is needed.Details
applyWsUrlskips the write when the value is unchanged, so an ordinary start doesn't trigger a pointless config hot-reload, and skips it when the value isundefined, so a stopped bridge doesn't blank a working config.addressWatcherslist inmain, mirroringmountIntegrations, so other integrations have an obvious place to go.bridgeWsUrlkeeps its.once()signature, soconfigureSimplexis untouched.Version
2026.7.1:5→2026.7.1:6, with a release-note paragraph in all five locales.Testing
On StartOS 0.4.0, with the SimpleX bridge installed and the channel enabled:
64955→56649; OpenClaw picked it up, restarted, and reconnectedtsc --noEmitclean, prettier clean,ncc buildsucceeds