← reports

#5304 · Browser launcher keychain investigation

BugPriority: MediumEffort: Lowpluginsno-reproGitHub issueOctober 9, 2026

Trusted base: a92304f7951a1aa96b6a95c8839cbc713b06dfb7, fetched directly from the target repository’s main branch.

Verdict: NOT REPRODUCED · Root-cause confidence: low. The missing launch argument is verified; the macOS hang is not. This is an environment limitation, not evidence that the report is false or that the defect is fixed.

1. TL;DR

The issue describes headless browser operations waiting indefinitely on one macOS machine. Trusted BB main launches its own Chrome with a small, platform-independent argument list that does not request a mock Keychain. A fresh diagnostic executable captured that actual argument list in two separate clean source checkouts. This investigation has only a Linux host and cannot exercise Apple Keychain or establish that the missing switch causes the reported cookie-key stall. No actual browser cookie read or HTTPS navigation was performed, so no production fix or pull request is justified by these results.

2. Claims vs findings

ClaimStatusEvidence
The local browser launcher does not supply a mock-keychain argument.VerifiedTrusted source and two executions of the real createRuntime() launch path; both captures report mockKeychainFlagPresent: false.
An installed executable override can determine which Chrome runs.VerifiedfindChrome() tries the plugin data directory’s runtime/chrome path first. The diagnostic uses a new temporary directory at that boundary.
Cookie reads and network navigation hang on an affected Mac because its cookie encryption key cannot load.UnverifiedNo macOS environment or Keychain service is available. Reporter-provided timing and NetLog claims were not reproduced or substituted for this investigation’s evidence.
A single launch switch resolves that particular machine’s hang.UnverifiedNo real Chrome process was launched and no before/after cookie or navigation experiment was possible.
The same operations work on Linux.Unverified hereThe Linux diagnostic checks launcher delivery only. It does not repeat the reporter’s browser operations.

3. Environment

4. Minimal repeatable diagnostic

This is an argument-delivery diagnostic, not a reproduction of the cookie-key hang. It runs the actual launcher and process supervisor rather than mocking either. Its stand-in executable records the arguments it receives and exits before exposing a debugging endpoint. The expected startup error therefore comes from the deliberate executable exit, not from Keychain.

  1. Obtain a clean checkout of the trusted base:
    git clone https://github.com/get-bb/bb.git bb-probe
    cd bb-probe
    git checkout --detach a92304f7951a1aa96b6a95c8839cbc713b06dfb7
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=bb-plugin-browser-automation
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
  2. Save the following independently authored diagnostic as plugins/browser-automation/issue-5304-probe.ts. No production edit is required.
    import assert from "node:assert/strict";
    import { mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
    import { tmpdir } from "node:os";
    import { join } from "node:path";
    import { createRuntime } from "./runtime.js";
    
    const directory = await mkdtemp(join(tmpdir(), "bb-launch-probe-"));
    const dataDir = join(directory, "data");
    const capture = join(directory, "launch.json");
    await mkdir(join(dataDir, "runtime"), { recursive: true });
    await writeFile(
      join(dataDir, "runtime", "chrome"),
      `#!${process.execPath}\nrequire("node:fs").writeFileSync(${JSON.stringify(capture)}, JSON.stringify(process.argv.slice(2)));\n`,
      { mode: 0o700 },
    );
    
    try {
      await assert.rejects(
        createRuntime({
          runtime: {
            binary: process.execPath,
            version: "diagnostic-only",
            source: "developer-artifact",
          },
          dataDir,
          tempDir: join(directory, "sessions"),
          signal: AbortSignal.timeout(8_000),
        }),
        /Browser runtime exited during startup/,
      );
      const parsed: unknown = JSON.parse(await readFile(capture, "utf8"));
      assert.ok(Array.isArray(parsed));
      const argumentsList = parsed.filter(
        (value): value is string => typeof value === "string",
      );
      assert.equal(argumentsList.length, parsed.length);
      assert.ok(argumentsList.includes("--headless=new"));
      const launchArguments = argumentsList.map((value) =>
        value.startsWith("--user-data-dir=") ? "--user-data-dir=<temporary-profile>" : value,
      );
      console.log(JSON.stringify({
        check: "actual-local-launch-arguments",
        platform: process.platform,
        launchArguments,
        mockKeychainFlagPresent: argumentsList.includes("--use-mock-keychain"),
        passwordStoreFlagPresent: argumentsList.some((value) => value.startsWith("--password-store=")),
        startupFailure: "intentional diagnostic executable exit; no browser was launched",
      }, null, 2));
    } finally {
      await rm(directory, { recursive: true, force: true });
    }
  3. Run from the checkout root:
    pnpm --filter bb-plugin-browser-automation exec tsx issue-5304-probe.ts

    Expected: one JSON capture, containing the local headless launch arguments; exit code 0 after cleanup. Actual output in both runs:

    {
      "check": "actual-local-launch-arguments",
      "platform": "linux",
      "launchArguments": [
        "--headless=new",
        "--no-sandbox",
        "--remote-debugging-port=0",
        "--remote-debugging-address=127.0.0.1",
        "--user-data-dir=<temporary-profile>",
        "--no-first-run",
        "--no-default-browser-check",
        "--window-size=1280,720",
        "about:blank"
      ],
      "mockKeychainFlagPresent": false,
      "passwordStoreFlagPresent": false,
      "startupFailure": "intentional diagnostic executable exit; no browser was launched"
    }

The profile path is deliberately normalized. Raw local captures and the diagnostic source are retained locally but not linked as public files: the reports repository prohibits publishing raw evidence or reproduction scripts. Everything needed to repeat the diagnostic is included inline.

5. Root cause and limits

The product-side finding is precise: findChrome() resolves the executable override before system Chrome candidates, and createRuntime() sends a fixed headless argument list to the real supervisor. The list contains no macOS-specific keychain handling:

"--headless=new",
"--no-sandbox",
"--remote-debugging-port=0",
"--remote-debugging-address=127.0.0.1",
`--user-data-dir=${profile}`,
"--no-first-run",
"--no-default-browser-check",
"--window-size=1280,720",
"about:blank"

There is no platform branch in this launch block. This leaves any platform-native credential-store behavior to the selected browser. A native macOS cookie-key load blocking could therefore explain the symptoms, but that causal step is still a hypothesis in this investigation. The machine-specific reason for a blocked key load is unknown. The executable capture proves what BB sends, not what Chrome does with those arguments.

The probe stops before DevBrowser startup or its initial page listing. Its intentional startup error is not evidence of the reported cookie/navigation timeout. Existing runtime output-boundary tests passing likewise do not establish native Keychain compatibility.

6. Proposed next experiment and fix gate

Use an authorized isolated macOS host with a fresh disposable Chrome profile and the same browser executable for both arms. First exercise a blank-page cookie read and then HTTPS navigation under the trusted source launch. Compare that to an otherwise identical launch with an automation keychain bypass. Record command deadlines and key-load completion without retaining cookies, credentials, or user profiles. Verify the bypass’s encryption/security implications before proposing it as a product default.

No fix attempted. The user-visible bug was not reproduced on trusted main, and no failing-before/passing-after regression test for the actual failure exists. A test that only checks for the proposed argument would not establish that the macOS hang is fixed. This fails the autopilot’s simple-fix prerequisite even though a textual launcher edit might be small. No branch was created or pushed.

7. Verification

The same agent repeated the diagnostic in a second clean detached checkout at the exact base commit, with a separate frozen install, build outputs, new temporary directory, and fresh process supervisor. Both probes exited 0 and their normalized JSON outputs were byte-identical. Tracked source diffs were empty in both checkouts; the only untracked source-tree file was the independently authored diagnostic. No screenshots apply to this non-visual result.

First checkout:
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=bb-plugin-browser-automation
pnpm exec turbo run test --filter=bb-plugin-browser-automation -- runtime.test.ts
pnpm --filter bb-plugin-browser-automation exec tsx issue-5304-probe.ts

Second checkout:
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=bb-plugin-browser-automation
pnpm exec turbo run build --filter=@get-bb/plugin-sdk
pnpm --filter bb-plugin-browser-automation exec tsx issue-5304-probe.ts

Comparison: byte-identical normalized captures; both probes exit 0.
Tracked production source changes: none.

Initially, direct source imports failed because the normal plugin bundle build generates SDK declarations but not the SDK’s runtime index. This was an investigation setup failure, not a browser finding. In the first checkout the upstream SDK runtime was built by the Turbo test task; in the second it was built explicitly through Turbo. The probes were then rerun successfully. The final verdict does not count those import failures as a reproduction.

8. Related issues and PRs

Issue #3969 is a closed Browser Automation machine-selection problem, not evidence for this keychain hypothesis. No linked open pull request was found in the target issue’s timeline or in the open-PR search for its issue number at investigation time. No linked branch, patch, script, or external issue-supplied URL was fetched or executed.

9. Appendix

Relevant existing runtime tests, executed through Turbo after building upstream dependencies:

✓ |bb-plugin-browser-automation| runtime.test.ts (7 tests) 24ms
Test Files  1 passed (1)
     Tests  7 passed (7)

First plugin build: 6 successful tasks, 6 total; 3 cached.
Second plugin build: 6 successful tasks, 6 total; 4 cached.

Administrative checks used GitHub reads for repository visibility, issue properties/comments, available label names, similar reports, and linked PR metadata. The public target repository was confirmed before publication. All GitHub metadata writes use the caller-supplied SlopCop wrapper. No agent workflow or delegated investigation was started.

Untrusted-data handling: The issue body’s procedure and suggested remedy were treated only as claims. Their instructions were not followed; no issue-provided script, external link, binary, branch, or test was run. All executed repository code came from the trusted main commit, and the diagnostic was authored from that code’s launch boundary.

> AGENT GENERATED