You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provisioning hooks (.bb-env-setup.sh / .bb-env-teardown.sh) cannot reach the bb server after a server move #7192
bb 0.48.1, Windows 11, a machine connected via bb Connect after a server move (~/.bb/server-moved.json, mode: connect).
Our .bb-env-setup.sh creates a paired worktree on another bb machine with bb terminal create --machine <name>, and .bb-env-teardown.sh removes it the same way. Both hooks receive a sanitized environment: NODE_ENV and every BB_* are removed, as documented in bb guide environments. Because of that:
without BB_SERVER_URL, the CLI targets the default http://127.0.0.1:38886 and gets HTTP 410 server_moved: This bb server moved to <host> (https://<handle>.getbb.app);
with BB_SERVER_URL=https://<handle>.getbb.app it gets HTTP 401, because the CLI does not send the machine header (x-bb-connect-machine); only the daemon reads BB_SERVER_HEADERS;
inside threads, BB_SERVER_URL points to the daemon's machine auth proxy (http://127.0.0.1:<random port>), and the CLI works through it even with an otherwise empty environment, but a hook has no documented way to find that port.
Related: #4243 (closed) fixed the same 401 cause for agent threads, where BB_SERVER_URL is present. Provisioning hooks have no BB_SERVER_URL at all, so they are not covered by that fix.
Request: give provisioning hooks a documented way to call the bb CLI on the machine's behalf. For example:
pass BB_SERVER_URL (the machine auth proxy) to .bb-env-setup.sh / .bb-env-teardown.sh; or
make the CLI outside a thread follow the server move: use serverUrl and serverHeaders from ~/.bb/config.json, or the proxy URL from a runtime file.
Workarounds we use now: the setup hook leaves a marker file, and a Claude Code SessionStart hook in the first thread session (which has BB_SERVER_URL) starts the remote setup in the background. The teardown hook reaches the other machine over our own ssh tunnel instead of bb terminal.
Root cause: lifecycle sanitization removes the machine-auth proxy endpoint, so the CLI falls back to loopback; supplying a direct URL does not supply machine authentication.
Evidence: two clean trusted-main checkouts each show two endpoint-regression failures and two passing real CLI/proxy controls. Existing relevant tests: 29 passed, 1 skipped. Native Windows and the hosted server-move workflow remain unverified.
No PR: changing authentication-context propagation into repository hooks exceeds the simple-fix safety rules.
Activity
bb-slop-cop commentedon Nov 6, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotworkspaces,cli,connect,partial-repro.