← reports

#7476 · Codex app-server browser-host handoff investigation

BugPriority: MediumEffort: Mediumprovidersprovider-codexno-reproIssue2026-11-13

Trusted base: 7794941da1b6e2baf017e5f7ab65b5f223fcaf54.

Verdict: NOT REPRODUCED · Root-cause confidence: low.

1. TL;DR

The report describes browser discovery failing in a BB Codex session on macOS while the desktop upstream application can access the browser. This investigation had only Linux, not the Mac, its desktop applications, or the exact upstream executable. It therefore does not reproduce or refute the reported symptom. A new boundary probe against unchanged trusted-main production code shows that BB's Codex bridge passes arbitrary synthetic inherited context to an actual child process and leaves missing context absent. That supports an unresolved host-lifecycle or launch-provenance question, not a demonstrated environment-filtering defect. Both clean checkouts passed the same three probe cases plus 13 existing launch/connection tests.

2. Claims vs findings

Claim or hypothesisStatusEvidence
Browser discovery fails in the reported local macOS setup.Unverified hereNo macOS host, desktop application, existing browser profile, or live Computer Use session was available. Reporter evidence is not a second reproduction.
The upstream desktop application succeeds on the same Mac.Unverified hereNo access to that comparison environment.
BB discards inherited upstream host context.Not supported by the bounded testThe real bridge launch path forwarded both synthetic non-BB-prefixed markers unchanged. This does not establish behavior of every upstream variable, the daemon's original parent, macOS pipe access, or identity verification.
Missing host context is initialized by the Codex bridge.Not observedWith the synthetic pair absent, both keys remained absent in the child. This is expected inheritance behavior, not proof that BB must provide an upstream host.
The installed upstream bundle rejects missing host prerequisites before Chrome access.Unverified hereThe installed bundle was not available and no issue-supplied code or external links were executed or fetched.
Separate browser automation backends work as controls.Not retestedThose controls do not exercise this upstream browser-host handoff and cannot establish its cause.

3. Environment

4. Minimal bounded reproduction

This reproduces environment inheritance at the actual Codex bridge-to-app-server child boundary, not the macOS browser failure. Save the test below as plugins/provider-codex/src/bridge/bridge.host-context-probe.test.ts in a clean clone at the recorded commit.

  1. Check out the trusted base, install locked dependencies, and build the SDK runtime:
    git clone https://github.com/get-bb/bb.git bb-7476-check
    cd bb-7476-check
    git checkout --detach 7794941da1b6e2baf017e5f7ab65b5f223fcaf54
    pnpm install --frozen-lockfile
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
  2. Add the inline probe and run it with the two existing suites:
    pnpm exec turbo run test --force --filter=bb-plugin-provider-codex -- src/bridge/bridge.host-context-probe.test.ts src/bridge/app-server-launch.test.ts src/bridge/app-server-connection.test.ts
  3. Expected: an inherited synthetic pair arrives unchanged; a missing identity stays absent; an absent pair stays absent. Actual: all three assertions pass. The Node child was launched and read its own environment through the real bridge request path. Existing launch and process lifecycle tests also pass.

Investigation-only probe

import { mkdtemp, readFile, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, expect, it, vi } from "vitest";
import { experimental_createBridgeJsonRpcTestHarness as createBridgeJsonRpcTestHarness } from "@get-bb/plugin-sdk/provider-bridge/testing";
import { experimental_killAllChildrenForTests, handleLine } from "./bridge.js";

const probeChild = `
const { writeFileSync } = require("node:fs");
const { createInterface } = require("node:readline");
writeFileSync(process.argv[1], JSON.stringify({
  pipe: process.env.SYNTHETIC_HOST_PIPE ?? null,
  identity: process.env.SYNTHETIC_HOST_IDENTITY ?? null
}));
createInterface({ input: process.stdin }).on("line", (line) => {
  const message = JSON.parse(line);
  if (message.id === undefined) return;
  const result = message.method === "model/list"
    ? { data: [{ id: "synthetic-model", model: "synthetic-model", isDefault: true }], nextCursor: null }
    : {};
  process.stdout.write(JSON.stringify({ id: message.id, result }) + "\\n");
});
`;

let harness: ReturnType<typeof createBridgeJsonRpcTestHarness> | undefined;
let temporaryDirectory: string | undefined;

afterEach(async () => {
  experimental_killAllChildrenForTests();
  harness?.restore();
  vi.unstubAllEnvs();
  if (temporaryDirectory) {
    await rm(temporaryDirectory, { recursive: true, force: true });
  }
});

it.each([
  { label: "inherited pair", pipe: "synthetic-pipe", identity: "synthetic-identity" },
  { label: "missing identity", pipe: "synthetic-pipe", identity: undefined },
  { label: "absent pair", pipe: undefined, identity: undefined },
])("observes $label at the app-server process boundary", async ({ pipe, identity }) => {
  temporaryDirectory = await mkdtemp(join(tmpdir(), "bb-host-context-probe-"));
  const outputPath = join(temporaryDirectory, "synthetic-context.json");
  vi.stubEnv("SYNTHETIC_HOST_PIPE", pipe);
  vi.stubEnv("SYNTHETIC_HOST_IDENTITY", identity);
  vi.stubEnv("BB_CODEX_BRIDGE_APP_SERVER_COMMAND", process.execPath);
  vi.stubEnv("BB_CODEX_BRIDGE_APP_SERVER_ARGS", JSON.stringify(["-e", probeChild, outputPath]));
  harness = createBridgeJsonRpcTestHarness(handleLine);
  harness.sendRequest(1, "model/list", {});
  const response = await harness.waitForResponse(1);
  expect(response.error).toBeUndefined();
  expect(JSON.parse(await readFile(outputPath, "utf8"))).toEqual({
    pipe: pipe ?? null,
    identity: identity ?? null,
  });
});

Actual output, first clean checkout

Test Files  3 passed (3)
     Tests  16 passed (16)
  Start at  00:47:32
  Duration  6.87s (transform 1.21s, setup 0ms, import 2.38s, tests 6.15s, environment 0ms)

The probe source is original investigation code derived from the trusted bridge test harness and process-launch contracts. No production code was changed. It is not a failing bug regression and is not proposed for inclusion in BB.

5. Root cause: not established

Only the following mechanisms are established at the recorded commit:

  1. The provider runtime builds its child environment from the inherited sanitized environment plus explicit runtime and adapter overrides. That upstream-to-bridge boundary was inspected, not dynamically exercised by this probe.
  2. The normal Codex launcher selects codex app-server unless a launch override is set. This does not prove which binary the reporter ran.
  3. The Codex bridge copies its inherited environment, overlays selected supported per-request values, then sanitizes it:
    const env: NodeJS.ProcessEnv = { ...process.env };
    ...
    return withoutBridgeRuntimeEnv(
      sanitizeInheritedChildProcessEnv({
        env: appServerLaunchEnv(envVars),
      }),
    );
  4. The shared sanitizer removes undefined entries, NODE_ENV, and BB_-prefixed keys; it otherwise copies values. The bridge-runtime filter removes Electron's Node-launch flag and the bridge recording directory.
  5. The bridge constructs the launch and passes that environment to the app-server child. The probe exercises this path, not a parallel helper implementation.

Inference, not a confirmed cause: an upstream desktop-managed host may require launch context or a lifecycle that a standalone app-server process does not have. The test cannot distinguish unsupported upstream integration, a missing host lifecycle, the wrong executable, an earlier-parent environment difference, or a platform-specific restriction. There is no basis here to copy identities, bypass checks, add environment forwarding, or assert that Chrome permissions are responsible.

6. Proposed next experiment and fix gate

Not confident enough to propose a production fix. On an isolated consenting Mac, first establish the exact BB-launched executable and version. Compare presence-only diagnostics at the host daemon, provider bridge, and app-server process boundaries against the supported desktop launch; do not log values, identities, or private tab data. Determine from the supported upstream contract who initializes and owns the host, and whether that host may be reused by a standalone client. Only then decide whether BB needs an actionable prerequisite message or an authorized integration.

No pull request: the bug was not reproduced on trusted main, no faithful failing regression exists, and changing upstream host identity/access behavior would involve a security boundary or product decision outside the simple-fix rules. No fix branch was created or pushed. GitHub cross-reference metadata and an open-PR search returned no linked open PR at investigation time.

7. Verification

The same agent repeated the bounded experiment in a second, distinct clean clone at the identical full base commit. Before adding the probe, tracked and untracked status was clean. It received its own frozen install, generated dependencies, and fresh temporary capture directories. The final probe was copied unchanged, and Turbo ran with --force, so this was actual execution rather than a cached test result.

pnpm exec turbo run test --force --filter=bb-plugin-provider-codex -- src/bridge/bridge.host-context-probe.test.ts src/bridge/app-server-launch.test.ts src/bridge/app-server-connection.test.ts

Test Files  3 passed (3)
     Tests  16 passed (16)
  Start at  00:47:58
  Duration  6.85s (transform 1.20s, setup 0ms, import 2.37s, tests 6.09s, environment 0ms)

Tasks:    7 successful, 7 total
Cached:    0 cached, 7 total

Correction during probe development: an initial synthetic child returned an empty model catalog, which BB correctly rejected. Supplying a valid synthetic model corrected the fixture before both final passing runs. That initial failure was not the reported defect. No claim about macOS failure was upgraded after verification. The summary's verification flag means that both runs support these limited findings, not that the product bug was reproduced. Root-cause permalinks were checked against the recorded trusted tree. This is a nonvisual investigation; no screenshot is claimed.

8. Related issues

A repository search for Codex Computer Use reports found #7464 (a Windows approval-form path) and #6730 (session termination). Search metadata does not demonstrate a shared root cause. No external issue link or issue-supplied executable was fetched or run.

9. Appendix: checks and limits

AGENT GENERATED