← reports

#7329 · Pooled Claude catalog discovery depends on CLI initialization

Bug Priority: Medium Effort: Medium providers provider-claude-code Issue #7329
November 10, 2026 · trusted base 9cc701a2ac20fc1e719d320bb51b01bd5d368a9e

PARTIALLY REPRODUCED · Root-cause confidence: medium · Reproduction label: partial-repro

1. TL;DR

The report describes new Claude models missing from the picker while Account Pooler is enabled. The bb-side preconditions are confirmed: model discovery receives plugin-contributed routing environment, the pool deliberately marks Claude Code as host-managed, and the Claude provider builds its model list only from CLI initialization. Existing behavioral tests pass in two clean trusted checkouts and demonstrate that reported models are preserved and the bridge memo can refresh. Those tests do not establish that an authenticated, current Claude CLI skips its served catalog or that any particular newly released model is available to pooled accounts. No live login, customer configuration, or real pooled account was accessed, so the end-to-end symptom and upstream authentication gate remain unverified.

2. Claims vs findings

ClaimFindingEvidence and limits
bb uses Claude Code initialization for its model picker.VerifiedThe initialization probe returns the SDK initialization result; the bridge passes its models directly to the model builder. The existing model-list suite passes in both checkouts.
Pool routing supplies a hub URL/token and host-managed mode.VerifiedThe real account-pool plugin resolves these environment contributions in its existing machine-token/bypass test, using the SDK fake-plugin-host harness, its in-memory key/value store, a synthetic API-key account, and a loopback upstream. This is not an OAuth-account test.
Discovery uses the pool environment rather than a separate direct-login environment.Verified by source inspectionThe server catalog launch resolves plugin environment with a host context and forwards it into the host discovery request.
The CLI skips its served catalog without a personal login and leaves a stale local cache.UnverifiedNo real CLI authentication/catalog trace was run. The frozen SDK dependency is version 0.3.318; it does not provide the external CLI executable needed for this experiment. The reporter's CLI version and private cache were not inspected.
A specific new model works through pooled inference but is absent from discovery.UnverifiedNo paid inference or authenticated catalog request was sent; model release and entitlement claims are not established here.
The stale result is an indefinitely cached bb bridge response.Not supportedThe bridge memo has a two-minute TTL and an existing test demonstrates a new probe after expiry. An upstream stale catalog can still be returned repeatedly; memo expiry alone cannot repair it.

3. Environment

4. Minimal reproduction and limits

This is a partial bb-side boundary reproduction, not an authenticated reproduction of the reported omission. It uses existing tests rather than a mock CLI that manufactures a stale catalog. The tests are expected to pass on unchanged main; no failing regression has been demonstrated.

  1. Clone the trusted target and select the recorded base, then install its locked dependencies:
    git clone https://github.com/get-bb/bb.git bb-catalog-check
    cd bb-catalog-check
    git checkout --detach 9cc701a2ac20fc1e719d320bb51b01bd5d368a9e
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
  2. Exercise the actual model builder and memo owner:
    pnpm exec turbo run test --force --filter=bb-plugin-provider-claude-code -- src/model-list.test.ts src/bridge/__tests__/model-list-memo.test.ts

    Expected: the builder offers exactly the models reported by the CLI fixture, and memo expiry triggers a fresh probe. Actual in the second checkout:

    ✓ |bb-plugin-provider-claude-code| src/model-list.test.ts (5 tests) 5ms
    ✓ |bb-plugin-provider-claude-code| src/bridge/__tests__/model-list-memo.test.ts (1 test) 4ms
    Test Files  2 passed (2)
    Tests  6 passed (6)
  3. Exercise the real pool plugin's environment contribution and bypass behavior:
    pnpm exec turbo run test --force --filter=bb-plugin-account-pool -- src/server.test.ts -t 'resolves distinct secret machine tokens and honors per-thread bypass'

    Expected: pool routing emits a hub URL, a synthetic per-machine bearer token, and host-managed mode; bypass behavior remains intact. Actual in the second checkout:

    ✓ |bb-plugin-account-pool| src/server.test.ts (196 tests | 195 skipped) 76ms
    Test Files  1 passed (1)
    Tests  1 passed | 195 skipped (196)

The first checkout also passed all six model/memo tests and the one selected pool test. These results establish the bb-side boundary conditions, not live model freshness.

The model-builder contract is owned by the existing exact reported-model-list test. Its source is available at the pinned commit. The complete existing memo reproduction test is inline here, at its original path plugins/provider-claude-code/src/bridge/__tests__/model-list-memo.test.ts:

import { describe, expect, it, vi } from "vitest";
import { createClaudeCodeBridgeModelListMemo } from "../model-list.js";

function catalog(model: string) {
  return {
    models: [
      {
        id: model,
        model,
        displayName: model,
        description: "",
        reasoningDiscovery: "known" as const,
        supportedReasoningEfforts: [],
        defaultReasoningEffort: "medium" as const,
        isDefault: true,
      },
    ],
    selectedOnlyModels: [],
  };
}

describe("createClaudeCodeBridgeModelListMemo", () => {
  it("shares one probe between concurrent asks and reuses it until the window ends", async () => {
    let currentTime = 0;
    let resolveProbe: (value: ReturnType<typeof catalog>) => void = () => {};
    const list = vi.fn(
      () =>
        new Promise<ReturnType<typeof catalog>>((resolve) => {
          resolveProbe = resolve;
        }),
    );
    const listModels = createClaudeCodeBridgeModelListMemo({
      list,
      now: () => currentTime,
      ttlMs: 1_000,
    });

    const first = listModels();
    const second = listModels();
    expect(list).toHaveBeenCalledTimes(1);
    resolveProbe(catalog("opus"));
    await expect(first).resolves.toEqual(catalog("opus"));
    await expect(second).resolves.toEqual(catalog("opus"));

    currentTime = 999;
    await expect(listModels()).resolves.toEqual(catalog("opus"));
    expect(list).toHaveBeenCalledTimes(1);

    currentTime = 1_000;
    const refreshed = listModels();
    expect(list).toHaveBeenCalledTimes(2);
    resolveProbe(catalog("sonnet"));
    await expect(refreshed).resolves.toEqual(catalog("sonnet"));
  });
});

5. Root cause

Verified bb mechanism: bb has no independent pooled-Claude catalog source in the inspected discovery path. It transforms the CLI initialization models, so it cannot introduce a newly available model that initialization omits. The pool's host-managed environment is intentional credential isolation, not an accidental missing-login assignment.

  1. Server catalog launch resolves plugin-contributed environment with a null thread/project context and a concrete host. The discovery request includes that environment.
  2. Account Pooler contributes the hub route and host-managed mode:
    ANTHROPIC_BASE_URL = Account Pooler HTTP route
    ANTHROPIC_AUTH_TOKEN = synthetic per-machine hub token in the test
    CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST = 1
    The source explicitly explains that host-managed mode prevents refreshing and consuming the host login's single-use refresh token. Repository history attributes this behavior to the login-isolation change.
  3. The SDK initialization probe forwards its environment and returns session.initializationResult(). Model discovery returns buildClaudeCodeModels(initialization.models).
  4. The model builder iterates only the discovered records. It normalizes and deduplicates them; it does not fetch a second catalog.
  5. The bridge TTL is two minutes. The memo implementation discards an expired result and probes again. This rules out an infinite bridge-memo lifetime, not upstream staleness.

Unproven causal link: whether the current external Claude CLI specifically disables served-catalog discovery in this routing mode. That mechanism is plausible but is outside the exercised code. Confidence is medium because the entire bb-side dependency chain is visible, while the upstream authentication gate, real cache mutation, and current account entitlements were not observed.

6. Proposed fix or next experiment

First obtain a sanitized initialization/catalog trace using an isolated test login and empty temporary home in the supported current CLI. Compare pooled routing against a direct-login control, capture requests and model IDs, and repeat after memo expiry. This experiment must keep the operator's own login untouched.

If that confirms the gate, evaluate an authenticated, read-only model-discovery operation owned by the pool, with explicit account-selection, entitlement, multi-host, and credential-isolation semantics. Do not remove host-managed mode or impersonate a personal login as a quick fix; that would undermine the protection the existing routing code intentionally provides. Hardcoding a newly reported model would not solve recurring catalog freshness.

No fix PR: the report does not reproduce the authenticated omission on trusted main, and the likely repair touches catalog/authentication responsibilities across the pool and provider. This does not meet the simple-fix gate. No production changes, branch, push, or red/green regression claim were made. No open PR linked to #7329 was found through issue cross-references or the open-PR search at review time.

7. Verification

The same agent repeated the boundary checks in a second newly cloned checkout detached at 9cc701a2ac20fc1e719d320bb51b01bd5d368a9e. It had its own frozen installation and SDK build. Both test commands were forced through Turbo, so the second run executed Vitest rather than replaying cached test output. Its pool test created a fresh temporary store and newly allocated loopback port; no fixed bb ports or shared customer configuration were used.

RunModel/memo testsPool environment test
First trusted checkout6 passed, 2 files1 passed, 195 deliberately skipped
Second clean trusted checkout6 passed, 2 files1 passed, 195 deliberately skipped

Report correction: the evidence supports only partial reproduction. Passing fixture-based owner tests must not be described as proof of the CLI's live catalog/authentication behavior. Both source checkouts have no tracked source changes after verification; generated build output was not published.

8. Related issues and review scope

The repository-history login-isolation change is relevant to the safety boundary. No linked open pull request was present to review. Other reports of missing models are not declared duplicates: this investigation did not establish a common upstream cause.

9. Appendix

Commands used for the source checks are given in section 4. The full build used pnpm exec turbo run build after the SDK runtime build and completed with Tasks: 73 successful, 73 total. GitHub metadata and trusted source/history were read to verify classification, routing, discovery, and the absence of a linked open PR. Full local test logs remain outside the public repository; only the relevant verbatim results are included here.

Untrusted-data handling: the issue body and its proposed directions were treated only as claims. No issue-supplied script, patch, binary, branch, command, external link, or private thread was executed or opened. The reproduction uses tests already present in trusted main. No credential values, customer logs, home directories, unique temporary-directory identifiers, or account identities are published.