Repository navigation
Description
Workflow
Run bb 0.38.0 with the local server exposed through bb connect, then use remote browser/mobile/desktop clients through the assigned getbb.app handle.
What happened
An established Connect tunnel closed abnormally. The first reconnect reached the Connect gate but received HTTP 500:
[05:10:06] tunnel closed (code 1006); reconnecting in 1000ms
[05:10:07] tunnel connecting to wss://<handle>.getbb.app/__tunnel?v=1
[05:10:08] tunnel rejected: HTTP 500
There were no subsequent reconnect attempts. bb connect status --json remained paired but stuck in reconnecting, with lastError: "tunnel rejected: HTTP 500" and an elapsed nextRetryAt.
Remote clients could still render the app shell, but opening any thread failed with “Failed to load thread.” The local server and thread APIs remained healthy, and there was no process crash, coredump, OOM event, or data loss.
Reloading the Connect plugin initiated another dial, but that handshake could remain pending indefinitely. A full bb service restart restored the tunnel.
Expected behavior
A transient non-auth HTTP rejection should close the failed attempt and schedule another capped-backoff reconnect. A WebSocket handshake that never opens or closes should have a deadline and retry.
Likely mechanism
ConnectTunnel.openTunnel() handles non-401/403 unexpected-response events by recording lastError, but it schedules retries only from the WebSocket close handler. In the observed HTTP 500 path, no later close event arrived, so the tunnel stayed alive enough to prevent process supervision from helping but never retried.
The dial also has no handshake timeout, which permits a replacement attempt to remain pending indefinitely.
Suggested fix
- Route
unexpected-responsefailures through an idempotent cleanup/reconnect path instead of relying on a latercloseevent. - Add a bounded WebSocket handshake timeout.
- Add regression coverage for:
- HTTP 500 with no subsequent
closeevent; - a handshake that never completes;
- avoiding duplicate retries when both
unexpected-responseandclosefire.
- HTTP 500 with no subsequent
Environment
- bb-app 0.38.0
- Linux x64
- Node.js 26.7.0
- Built-in Connect plugin
Related but distinct: #1494 and #1524 cover desktop recovery when a configured server target is unreachable. This report concerns the server-side Connect tunnel no longer retrying, which affects every remote client.
A deterministic reproduction script will follow separately and be linked back to this issue.
AGENT GENERATED: by GPT-5.6 Sol
Activity
hemaaanth commentedon Aug 18, 2026
Here is a deterministic reproducer that uses loopback networking, fake plugin state, and the real
ConnectTunnel. It does not touch a running bb service or any stored credentials.With workspace dependencies installed, save it as
plugins/connect/scripts/repro-http-500-no-retry.mtsand run:Current output:
Retry Connect tunnel after rejected WebSocket upgrades (#1784)