fix(relay): stop bystander instances from capturing the relay host

Two mitigations for local multi-instance contention over the shared relay
identity:

- A standby instance now waits a 2-minute grace period after the host claim
  frees before taking over, so a cleanly restarting host (app update or
  relaunch) — which reclaims at boot with no wait — always wins the restart
  window instead of stranding paired devices on another process.
- Dev instances never host the relay passively: dev scripts set
  OPENCHAMBER_RELAY_HOST=off and the Electron dev shell is detected via
  OPENCHAMBER_ELECTRON_DEV. Explicit enable/pairing on such an instance still
  force-claims; OPENCHAMBER_RELAY_HOST=on overrides.
This commit is contained in:
Bohdan Triapitsyn
2026-08-24 14:03:18 +03:00
parent 3aa45805bc
commit 97edd033f9
7 changed files with 119 additions and 5 deletions
+3
View File
@@ -114,6 +114,9 @@ clearViteCache();
const api = run('api', 'bun', ['run', '--cwd', 'packages/web', 'dev:server:watch'], {
OPENCHAMBER_PORT: backendPort,
// Dev backends share the relay identity with the production instance; never
// let them capture the machine's relay host on their own.
OPENCHAMBER_RELAY_HOST: process.env.OPENCHAMBER_RELAY_HOST || 'off',
});
const vite = run(
'vite',