Repository navigation
Description
Summary
Remote HTML previews returned HTTP 504: Timed out waiting for command result while the execution host repeatedly reconnected. Provider discovery, workspace requests, and commands for an existing thread also failed during this period. A preview failure should not make the execution host unavailable.
This is an observed production incident on the latest stable release. The suspected cause and a minimal reproduction remain unverified. The investigation report below contains the measured evidence.
Versions and environment
- BB server and enrolled host package:
0.42.1, also the npmlatestversion when checked on 2026-09-10. - Server: npm installation on an Intel Mac, macOS 26.6.2, Node v26.8.1.
- Execution host: Ubuntu 24.04, x86_64, 4 vCPU, 7.6 GiB RAM, Node v24.19.0. The generated installer manages its host daemon through user systemd.
- Private connection: Tailscale Serve HTTPS on port 8443, proxying the server's loopback port 38886. BB Connect is not paired.
- The server also has a local worker and another enrolled Mac worker.
- Affected thread: Codex, model
gpt-6-astra. The host's installed CLI reportscodex-cli 0.154.0; the exact executable version used by that historical session was not separately captured. - The thread uses an existing remote workspace, not a managed worktree.
- Browser/device version was not captured.
Steps to reproduce
These reconstruct the incident workflow. They are not a confirmed minimal reproduction. No artificial network throttling or isolated reproduction has been run.
-
Run BB on one machine and enroll a Linux execution host through Tailscale Serve.
-
Use a Codex thread whose workspace is on that execution host.
-
Create two workspace-relative HTML previews containing embedded slide images. The incident files were 3,352,751 and 2,932,975 bytes.
-
Display both previews in the thread with these directives:
::inline-vis{file="preview-1.html" height="1000"} ::inline-vis{file="preview-2.html" height="1000"} -
During the incident, both previews showed 504 errors. A separate workspace request also failed:
bb environment status <environment-id> --json
A prior attempt to open a roughly 6 MiB standalone preview preceded the first recorded disconnect. The two smaller inline previews appeared later. The exact initiating request is unknown. The number of open clients or preview remounts was not captured.
Expected vs actual
Expected: previews load or return a bounded file-specific error. Heartbeats, provider discovery, workspace requests, and thread commands remain usable.
Actual messages:
Failed to load iamals-preview-1.html: HTTP 504: Timed out waiting for command result
Failed to load iamals-preview-2.html: HTTP 504: Timed out waiting for command result
Error: HTTP 504: Timed out waiting for command result
The daemon logged:
Server heartbeat acknowledgements stopped; reconnecting
Disconnected from server
The disconnect reason was heartbeat-ack-timeout, code 1013, with leaseTimeoutMs: 30000.
Evidence
Incident window: 2026-09-10, 12:27–13:16 UTC.
- The Linux daemon journal contained 38 disconnect records with
reason:"heartbeat-ack-timeout". The first was at 12:27:18 UTC; the last was at 13:16:26 UTC. - The captured server log contained 112
prepareHtmlPreviewfailures with HTTP 504 and 11 with HTTP 502. These ran from 12:32:39 through 13:16:22 UTC. These are log counts, not counts of distinct user actions. - The server logged 49
Failed to resolve provider modelsrecords and 166Failed to resolve installed-only provider statusrecords. All named the affected Linux host. - The server logged 194
Daemon heartbeat for inactive session, closing socketrecords. All named the same host. Records includedcloseReason:"replaced"; messages from old sessions arrived after replacement. - The affected thread had
Live ready turn command failedwithHost is not connectedat 12:38:30.349, 12:49:09.131, and 13:11:14.813 UTC.
These counts come from JSON log parsing and a literal match of the daemon's disconnect reason. No application content or credentials are attached.
Thread: thr_5qgyid4t3r
Environment: env_e4jegb7pay
Host: host_twvvcydq2y
Code observations and suspected cause
The installed inline-vis bundle source map shows prepareHtmlPreview reading the entire file through bb.sdk.files.read. It then checks encoding and size, and returns only { file }.
The same sequence exists in inline-vis/server.ts at 1bc80e1d57991fe60a3896e60e0159427194c7bb. This commit was inspected, not built or used to reproduce the incident.
The installed daemon sends file RPC responses and application heartbeats through the same WebSocket. Large file replies delaying heartbeat traffic are a hypothesis consistent with the delayed session messages. No socket backlog measurement was captured during a failed preview request. This does not establish that previews caused the disconnects.
A useful next test would load these file sizes over a constrained connection while measuring heartbeat delay and small RPC latency. If confirmed, file validation and transfer should preserve control-message responsiveness. This report does not prescribe a timeout increase or a particular transport replacement.
What was ruled out or remains unknown
- The daemon service did not restart:
NRestarts=0during inspection. It reconnected its socket within the same service run. - At inspection, the Linux host had about 3.8 GiB available RAM, no current memory pressure, and 68 GiB free disk. This does not rule out earlier transient pressure.
- All 22 recorded
turn/startedevents had matchingturn/completedrecords with statuscompleted. The evidence does not show 22 Codex crashes or lost completed turns. - The server's local daemon log showed no matching heartbeat reconnect pattern in the captured period.
- After the last recorded reconnect, the same workspace-status request succeeded. A direct HTTPS preview served by the Linux host returned HTTP 200. This bypasses BB's file path and is only a workaround.
- Searched open and closed issues for preview timeouts, heartbeat failures, and file backpressure. Remote host can remain connected with a one-way-stale daemon WebSocket #2358 concerns a stale Connect return path; this deployment uses Tailscale Serve and has the later heartbeat-ack mechanism. The underlying cause here is not yet established.
- No test on a clean BB data directory, another provider, or a current-main runtime was performed.
Suggested priority and effort
High impact in this deployment: preview failures coincided with failures across the execution host's control operations. Direct preview links provide a workaround. No data loss was confirmed. Repair effort is unknown pending reproduction.
Checks
- The incident occurred on the latest stable release; the lack of an isolated reproduction is stated above.
- Open and closed issues were searched.
- The investigation report and source thread identifiers are included above.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 10, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassified Bug · High priority · Medium effort; added
host,remote, andinline-vis. No existing classification was replaced.Reproduction and root-cause report: PARTIALLY REPRODUCED, medium root-cause confidence; applied
partial-repro.Two clean checkouts showed that actual daemon file replies at an imposed 64 KiB/s bottleneck blocked application heartbeats until acknowledgement timeout, with about 4 MB queued. Fast controls succeeded; 13 existing connection tests passed. The full preview/HTTP 504 incident and its production cause remain unverified.
No PR: preserving control responsiveness during bulk transfer needs a transport design decision outside the simple-fix boundary. The report includes the repeatable transport probe and both runs.
brsbl commentedon Oct 1, 2026
Another occurrence: thread provisioning fails with
Timed out waiting for command resultThe same transport stall happened during thread provisioning, with no HTML previews involved. Two threads spawned concurrently into the same Project checkout environment both failed after 51s:
Versions: server and enrolled macOS host are both
0.44.1-nightly.36184725653.1. The server runs on a Linux machine. The Mac host connects through BB Connect.Timeline (2026-10-01 UTC)
Daemon event queue is backing upwithqueueDepth: 28andqueueAgeMs: 30794.environment-project-checkoutworker ready at 00:32:51.environment.hook.run). The server→host direction is alive.Failed to post daemon events: 504 Gateway TimeoutCould not refresh the branch of a reused environment,host.inspect_git_source,command_timeout, 504. Same environment, one per concurrent thread. Both threads fail at the same moment.Server heartbeat acknowledgements stopped; reconnecting, code1013,heartbeat-ack-timeoutObservations
design-doctrineloggeddoctrine harvest: nowhere to publish rules; leaving the thread queuedabout 4.4k times in a few minutes, roughly 8 per second.Unverified: what blocked the host→server direction. It could be a large reply queued ahead of control traffic as in the original report, the Connect relay, or the network. The daemon does not log successful RPC sends or socket backlog, so this cannot be determined from these logs.
Source thread:
thr_djpfy477ri