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
In a BB-managed terminal on an enrolled macOS machine (BB 0.50.1), the standalone bb command from the machine installer returns HTTP 401 for a read-only thread lookup. The same terminal and arguments succeed when invoking the executable named by BB_CLI directly. The terminal has a loopback BB_SERVER_URL supplied by the host daemon.
Reproduction
Enroll a macOS execution machine with the standard machine installer and open a thread-scoped terminal on it.
Make sure plain bb resolves to the machine installer's shell launcher. Run bb thread show "$BB_THREAD_ID" --json.
Run "$BB_CLI" thread show "$BB_THREAD_ID" --json in the same terminal.
The first command should use the same scoped server connection as the second.
Diagnosis
I compared the managed terminal environment with what the npm launcher forwards to the BB_CLI override, recording only equality and presence flags. The launcher changed BB_SERVER_URL and populated BB_SERVER_HEADERS; the daemon port remained unchanged. Invoking the supplied CLI directly also succeeded with the recursion marker set.
packages/bb-app/src/launcher.ts resolves the managed config before runBundledCliCommand() delegates to BB_CLI. In that path, resolveServerUrl() prefers the configured server URL over the inherited one, and applyManagedConfigEnv() injects the configured headers. Test an enrolled-machine launcher with a stored server URL and a managed terminal using a different loopback proxy. Standalone calls without managed context should continue to use the installed machine configuration.
Verdict:REPRODUCED · high root-cause confidence · confirmed-repro.
Root cause: The npm launcher resolves installed configuration before delegating to BB_CLI, replacing the supplied loopback authentication-proxy URL. The real CLI then contacts upstream without the machine header that the proxy supplies; injected environment headers do not repair that request path.
Verification: Two clean checkouts of trusted main at b0ddaad731 reproduce direct CLI exit 0 versus launcher HTTP 401, including with the recursion marker. Both new managed-context cases fail as expected; the second run also passes all 79 existing launcher tests and the standalone control. The complete regression test is embedded in the report. Native macOS enrollment was not exercised.
No PR: Repair changes routing/authentication-context precedence, which this rule explicitly excludes from automatic simple fixes.
Activity
bb-slop-cop commentedon Nov 26, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotremote,cli.confirmed-repro.BB_CLI, replacing the supplied loopback authentication-proxy URL. The real CLI then contacts upstream without the machine header that the proxy supplies; injected environment headers do not repair that request path.b0ddaad731reproduce direct CLI exit 0 versus launcher HTTP 401, including with the recursion marker. Both new managed-context cases fail as expected; the second run also passes all 79 existing launcher tests and the standalone control. The complete regression test is embedded in the report. Native macOS enrollment was not exercised.Keep the managed terminal's scoped server connection when the launche…
Keep the managed terminal's scoped server connection when the launche…