← reports

#7121 · Terminal pool refresh errors on current main

BugPriority: MediumEffort: Mediumproviders · no-reproGitHub issue2026-11-05 · base fa30b0a7dcdf745f7baf8e41721f754b7d3198fe

Verdict: ALREADY FIXED on trusted main. Root-cause confidence: medium for the reported deployment; high confidence in the tested current-main behavior. Reproduction label: no-repro.

1. TL;DR

The reported silent refresh failure is not reproducible on the trusted main commit: an expired Claude account becomes status: error with the terminal OAuth error, including when its retained quota is 22 hours old. The same result passes in a second clean checkout, and all 390 Account Pooler tests pass. Repository history identifies a matching repair, commit 6e77fce8c7a0a3bd71b66edfd5f223f5f92cc632 (#6661), merged November 2, 2026. The desktop 0.48.1 release points to e003e9510cbfd3bb6c26a28630b46ffb1c242a44 and was published October 30, 2026, before that repair. Static inspection of that release explains the silent-failure mechanism; this investigation did not inspect the reporter's deployed bundle, so the release mismatch is an evidence-backed explanation rather than proof of that host's exact contents.

2. Claims vs findings

ClaimFindingEvidence
Rejected refresh leaves an expired Claude account ready with no error.Not reproduced on current main.Both added probe cases assert status: error and the HTTP 400 error; both pass in both checkouts.
Previously observed quota can remain unchanged after refresh failure.Verified as retention, not a healthy-state result.The 0.98 / 1 utilization and old observation timestamp remain, but the current account is explicitly in error.
The same rejected refresh token is retried every five minutes.Not reproduced on current main.After a terminal rejection the next background tick makes no second token request. Existing tests also verify this across a hub restart.
Manual refresh leaves the account apparently healthy.Not reproduced on current main.Manual refresh from the expired state sets error; a subsequent explicit refresh retries once and retains the error on another rejection.
The UI differs from host-login usage and token rotation caused the failure.Unverified.No live provider credentials, host login, remote runtime, or UI was accessed. The provider transport is synthetic.
The cited current source corresponds to released 0.48.1 behavior.Version/source mismatch found.The published desktop tag predates the merged error-propagation repair; package.json on main still says 0.48.1, so that number alone does not establish bundle contents.

3. Environment

4. Minimal reproduction

  1. Install and build the recorded trusted revision, run existing rejection coverage, and apply the inline test-only patch.
  2. The added cases seed the real quota store with stale utilization, advance the fixture clock 22 hours, and make the real Claude adapter receive a synthetic HTTP 400 invalid_grant response.
  3. Check the hub's public status after either background or explicit manual refresh. Check the next background tick does not resend the token, then check an explicit manual retry retains the error.
  4. Repeat in a second clean worktree with Turbo's --force, ensuring test execution is not a cached replay.
git clone https://github.com/get-bb/bb.git bb-7121
cd bb-7121
git checkout --detach fa30b0a7dcdf745f7baf8e41721f754b7d3198fe
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk
pnpm exec turbo run build
pnpm exec turbo run test --filter=bb-plugin-account-pool -- src/refresh-rejection.test.ts

Save the inline patch below as /tmp/7121.patch, then:
git apply /tmp/7121.patch
pnpm exec turbo run test --filter=bb-plugin-account-pool --force -- src/refresh-rejection.test.ts
pnpm exec turbo run test --filter=bb-plugin-account-pool

git worktree add --detach ../bb-7121-second fa30b0a7dcdf745f7baf8e41721f754b7d3198fe
cd ../bb-7121-second
pnpm install --frozen-lockfile --prefer-offline
git apply /tmp/7121.patch
pnpm exec turbo run test --filter=bb-plugin-account-pool --force -- src/refresh-rejection.test.ts

Expected healthy handling: status error and a terminal OAuth message; no automatic token replay. Actual: both added cases pass unchanged production code. This is a passing diagnostic probe, not a red/green demonstration of a newly fixed bug.

Complete test-only patch to apply to trusted main
diff --git a/plugins/account-pool/src/refresh-rejection.test.ts b/plugins/account-pool/src/refresh-rejection.test.ts
index 66bb149d03..271a07e125 100644
--- a/plugins/account-pool/src/refresh-rejection.test.ts
+++ b/plugins/account-pool/src/refresh-rejection.test.ts
@@ -153,6 +153,8 @@ async function createPool(provider: PoolProvider, refreshFailureStatus = 400) {
   return {
     account,
     accounts: initial.accounts,
+    quotas: initial.quotas,
+    status: () => active.hub.status(),
     kv: host.bb.storage.kv,
     refreshTokens,
     authorizations,
@@ -163,6 +165,7 @@ async function createPool(provider: PoolProvider, refreshFailureStatus = 400) {
     },
     error: () => initial.quotas.get(account.id).error,
     tick: () => active.hub.refreshUsage(),
+    refresh: () => active.hub.refreshUsage(account.id, true),
     restart: async () => {
       await active.stop();
       active = await startHub(stores());
@@ -213,6 +216,51 @@ async function createPool(provider: PoolProvider, refreshFailureStatus = 400) {
   };
 }
 
+it.each(["background", "manual"] as const)(
+  "issue 7121: exposes an expired Claude account with stale quota as an error after a %s refresh",
+  async (mode) => {
+    const pool = await createPool("claude");
+    const observedAt = 1_800_000_000_000;
+    pool.quotas.put({
+      ...pool.quotas.get(pool.account.id),
+      fiveHourUtilization: 0.98,
+      fiveHourResetAt: observedAt + 60 * MINUTE,
+      fiveHourStatus: "allowed",
+      sevenDayUtilization: 1,
+      sevenDayResetAt: observedAt + 20 * 60 * MINUTE,
+      sevenDayStatus: "rejected",
+      observedAt,
+    });
+    pool.advance(22 * 60 * MINUTE);
+
+    await (mode === "background" ? pool.tick() : pool.refresh());
+
+    expect((await pool.status()).accounts[0]).toMatchObject({
+      status: "error",
+      error: REJECTED,
+      fiveHourUtilization: 0.98,
+      sevenDayUtilization: 1,
+      observedAt,
+    });
+    expect(pool.refreshTokens).toEqual(["refresh-original"]);
+
+    pool.advance(5 * MINUTE);
+    await pool.tick();
+    expect(pool.refreshTokens).toEqual(["refresh-original"]);
+
+    await pool.refresh();
+    expect(pool.refreshTokens).toEqual([
+      "refresh-original",
+      "refresh-original",
+    ]);
+    expect((await pool.status()).accounts[0]).toMatchObject({
+      status: "error",
+      error: REJECTED,
+      observedAt,
+    });
+  },
+);
+
 describe.each(["claude", "codex"] as const)(
   "%s refresh token rejected by the token endpoint",
   (provider) => {
Complete executable test file, including the repository fixture
import { createHash } from "node:crypto";
import fs from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { createFakePluginHost } from "@get-bb/plugin-sdk/testing";
import { afterEach, describe, expect, it } from "vitest";
import { z } from "zod";
import { accountPoolConfigSchema, type PoolProvider } from "./contracts.js";
import { createHub, type AccountPoolHub } from "./hub.js";
import {
  AccountStore,
  HubTokenStore,
  PoolAffinityStore,
  QUOTA_MIGRATIONS,
  QuotaStore,
} from "./store.js";

const MINUTE = 60_000;
const ROUTE = "/api/v1/plugins/account-pool/http";
const REFRESH_URL = "https://oauth.invalid/token";
const USAGE_URL = "https://usage.invalid/usage";
const UPSTREAM_URL = "https://upstream.invalid";
const REJECTED = "OAuth refresh failed with HTTP 400. invalid_grant.";

const cleanups: Array<() => Promise<void>> = [];

afterEach(async () => {
  while (cleanups.length > 0) await cleanups.pop()?.();
});

async function createPool(provider: PoolProvider, refreshFailureStatus = 400) {
  const dataDir = await fs.mkdtemp(
    path.join(tmpdir(), "bb-account-pool-rejection-"),
  );
  const host = createFakePluginHost({ pluginId: "account-pool", dataDir });
  const database = host.bb.storage.database();
  host.bb.storage.migrate(database, QUOTA_MIGRATIONS);
  const secretsDir = path.join(dataDir, "secrets");
  let time = 1_800_000_000_000;
  const now = () => time;
  const stores = () => ({
    accounts: new AccountStore(host.bb.storage.kv, secretsDir),
    quotas: new QuotaStore(database),
    affinity: new PoolAffinityStore(database),
    hubTokens: new HubTokenStore(secretsDir, now),
  });
  const initial = stores();
  await initial.accounts.initialize();
  const addAccount = (
    name: string,
    priority: number,
    accessToken: string,
    refreshToken: string,
    ttl: number,
  ) =>
    initial.accounts.add(
      {
        provider,
        kind: "oauth",
        label: name,
        email: null,
        accountUuid: null,
        ...(provider === "codex" ? { codexAccountId: name } : {}),
        subscriptionType: null,
        rateLimitTier: null,
        enabled: true,
        priority,
      },
      { kind: "oauth", accessToken, refreshToken, expiresAt: time + ttl },
    );
  const account = await addAccount(
    "synthetic-account",
    100,
    "access-original",
    "refresh-original",
    10 * MINUTE,
  );
  const refreshTokens: string[] = [];
  const authorizations: string[] = [];
  const rejectedAccessTokens = new Set<string>();
  let accountsChanged = 0;
  const transport: typeof fetch = async (input, init) => {
    const url = String(input);
    if (url === REFRESH_URL) {
      const { refresh_token } = z
        .object({ refresh_token: z.string() })
        .parse(JSON.parse(String(init?.body)));
      refreshTokens.push(refresh_token);
      return Response.json(
        {
          error:
            refreshFailureStatus === 400
              ? "invalid_grant"
              : "temporarily_unavailable",
        },
        { status: refreshFailureStatus },
      );
    }
    if (url === USAGE_URL) return Response.json({});
    if (url.startsWith(`${UPSTREAM_URL}/`)) {
      const authorization = new Headers(init?.headers).get("authorization");
      authorizations.push(authorization ?? "");
      return rejectedAccessTokens.has(
        authorization?.replace(/^Bearer /u, "") ?? "",
      )
        ? Response.json(
            { error: { message: "invalid access token" } },
            { status: 401 },
          )
        : Response.json({ id: "synthetic-response" });
    }
    throw new Error(`Unexpected network destination ${url}.`);
  };
  const startHub = async (
    current: ReturnType<typeof stores>,
  ): Promise<{ hub: AccountPoolHub; stop: () => Promise<void> }> => {
    const hub = createHub({
      ...current,
      now,
      fetch: transport,
      getSettings: () =>
        accountPoolConfigSchema.parse({
          anthropicUpstreamBaseUrl: UPSTREAM_URL,
          codexUpstreamBaseUrl: UPSTREAM_URL,
        }),
      refreshUrl: REFRESH_URL,
      codexRefreshUrl: REFRESH_URL,
      usageUrl: USAGE_URL,
      codexUsageUrl: USAGE_URL,
      onAccountsChanged: () => {
        accountsChanged += 1;
      },
    });
    const controller = new AbortController();
    const running = hub.start(controller.signal);
    await hub.refreshUsage();
    return {
      hub,
      stop: async () => {
        controller.abort();
        await running;
      },
    };
  };
  let active = await startHub(initial);
  cleanups.push(async () => {
    await active.stop();
    await host.harness.lifecycle.dispose();
    await fs.rm(dataDir, { recursive: true, force: true });
  });
  const token = await initial.hubTokens.forHost("synthetic-host");
  const route = provider === "claude" ? "/v1/messages" : "/v1/responses";
  return {
    account,
    accounts: initial.accounts,
    quotas: initial.quotas,
    status: () => active.hub.status(),
    kv: host.bb.storage.kv,
    refreshTokens,
    authorizations,
    rejectedAccessTokens,
    accountsChanged: () => accountsChanged,
    advance: (milliseconds: number) => {
      time += milliseconds;
    },
    error: () => initial.quotas.get(account.id).error,
    tick: () => active.hub.refreshUsage(),
    refresh: () => active.hub.refreshUsage(account.id, true),
    restart: async () => {
      await active.stop();
      active = await startHub(stores());
    },
    signInAgain: (accessToken: string, refreshToken: string, ttl: number) =>
      active.hub.replaceSecret(account.id, {
        kind: "oauth",
        accessToken,
        refreshToken,
        expiresAt: time + ttl,
      }),
    addFallbackAccount: (
      accessToken: string,
      refreshToken: string,
      ttl: number,
    ) =>
      addAccount(
        "fallback-synthetic-account",
        200,
        accessToken,
        refreshToken,
        ttl,
      ),
    request: async () => {
      const response = await active.hub.handle(
        new Request(`https://hub.invalid${ROUTE}${route}`, {
          method: "POST",
          headers: {
            authorization: `Bearer ${token}`,
            "content-type": "application/json",
          },
          body: JSON.stringify(
            provider === "claude"
              ? {
                  model: "claude-sonnet-4-5",
                  max_tokens: 1,
                  messages: [{ role: "user", content: "ok" }],
                }
              : { model: "gpt-5", input: "ok" },
          ),
        }),
        provider,
        route,
      );
      await response.text();
      return response.status;
    },
  };
}

it.each(["background", "manual"] as const)(
  "issue 7121: exposes an expired Claude account with stale quota as an error after a %s refresh",
  async (mode) => {
    const pool = await createPool("claude");
    const observedAt = 1_800_000_000_000;
    pool.quotas.put({
      ...pool.quotas.get(pool.account.id),
      fiveHourUtilization: 0.98,
      fiveHourResetAt: observedAt + 60 * MINUTE,
      fiveHourStatus: "allowed",
      sevenDayUtilization: 1,
      sevenDayResetAt: observedAt + 20 * 60 * MINUTE,
      sevenDayStatus: "rejected",
      observedAt,
    });
    pool.advance(22 * 60 * MINUTE);

    await (mode === "background" ? pool.tick() : pool.refresh());

    expect((await pool.status()).accounts[0]).toMatchObject({
      status: "error",
      error: REJECTED,
      fiveHourUtilization: 0.98,
      sevenDayUtilization: 1,
      observedAt,
    });
    expect(pool.refreshTokens).toEqual(["refresh-original"]);

    pool.advance(5 * MINUTE);
    await pool.tick();
    expect(pool.refreshTokens).toEqual(["refresh-original"]);

    await pool.refresh();
    expect(pool.refreshTokens).toEqual([
      "refresh-original",
      "refresh-original",
    ]);
    expect((await pool.status()).accounts[0]).toMatchObject({
      status: "error",
      error: REJECTED,
      observedAt,
    });
  },
);

describe.each(["claude", "codex"] as const)(
  "%s refresh token rejected by the token endpoint",
  (provider) => {
    it("sends a rejected refresh token at most once from the background and errors the account after expiry", async () => {
      const pool = await createPool(provider);
      const changes = pool.accountsChanged();
      pool.advance(7 * MINUTE);
      await pool.tick();
      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.error()).toBeNull();
      expect(pool.accountsChanged()).toBe(changes);

      pool.advance(5 * MINUTE);
      await pool.tick();
      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.error()).toBe(REJECTED);
      expect(pool.accountsChanged()).toBe(changes + 1);

      pool.advance(5 * MINUTE);
      await pool.tick();
      expect(await pool.request()).toBe(429);
      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.authorizations).toEqual([]);
      expect(pool.accountsChanged()).toBe(changes + 1);
    });

    it("does not replay a rejected refresh token after a hub restart", async () => {
      const pool = await createPool(provider);
      pool.advance(7 * MINUTE);
      await pool.tick();
      expect(pool.refreshTokens).toEqual(["refresh-original"]);

      await pool.restart();
      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(await pool.request()).toBe(200);
      pool.advance(5 * MINUTE);
      await pool.tick();

      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.error()).toBe(REJECTED);
    });

    it("errors the account without a refresh replay when upstream rejects the access token", async () => {
      const pool = await createPool(provider);
      pool.advance(7 * MINUTE);
      expect(await pool.request()).toBe(200);
      const changes = pool.accountsChanged();

      pool.rejectedAccessTokens.add("access-original");
      expect(await pool.request()).toBe(401);

      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.error()).toBe(REJECTED);
      expect(pool.accountsChanged()).toBe(changes + 1);
    });

    it("moves the request to the next account when upstream rejects the kept access token", async () => {
      const pool = await createPool(provider);
      await pool.addFallbackAccount(
        "access-fallback",
        "refresh-fallback",
        60 * MINUTE,
      );
      pool.advance(7 * MINUTE);
      expect(await pool.request()).toBe(200);

      pool.rejectedAccessTokens.add("access-original");
      expect(await pool.request()).toBe(200);

      expect(pool.refreshTokens).toEqual(["refresh-original"]);
      expect(pool.authorizations).toEqual([
        "Bearer access-original",
        "Bearer access-original",
        "Bearer access-fallback",
      ]);
      expect(pool.error()).toBe(REJECTED);
    });

    it("clears the failure and the stored rejection when the account signs in again", async () => {
      const pool = await createPool(provider);
      pool.advance(7 * MINUTE);
      await pool.tick();
      pool.advance(5 * MINUTE);
      await pool.tick();
      expect(pool.error()).toBe(REJECTED);

      await pool.signInAgain("access-new", "refresh-new", 60 * MINUTE);

      expect(pool.error()).toBeNull();
      expect(await pool.kv.list("rejected-refresh:")).toEqual([]);
      expect(await pool.request()).toBe(200);
      expect(pool.authorizations).toEqual(["Bearer access-new"]);
      expect(pool.refreshTokens).toEqual(["refresh-original"]);
    });

    it("keeps serving and retrying after a transient refresh failure", async () => {
      const pool = await createPool(provider, 503);
      pool.advance(7 * MINUTE);
      expect(await pool.request()).toBe(200);
      expect(pool.authorizations).toEqual(["Bearer access-original"]);
      expect(pool.error()).toBeNull();

      pool.advance(5 * MINUTE);
      await pool.tick();

      expect(pool.refreshTokens).toEqual([
        "refresh-original",
        "refresh-original",
      ]);
      expect(pool.error()).toBeNull();
    });
  },
);

it("remembers only a fingerprint of a rejected refresh token and forgets it with the account", async () => {
  const pool = await createPool("claude");
  const keysBefore = await pool.kv.list("");
  const storedValues = async () =>
    Promise.all(
      (await pool.kv.list("")).map(async (key) =>
        JSON.stringify(await pool.kv.get(key)),
      ),
    );
  pool.advance(7 * MINUTE);
  await pool.tick();

  const fingerprint = createHash("sha256")
    .update("refresh-original")
    .digest("hex");
  const values = await storedValues();
  expect(values.filter((value) => value.includes(fingerprint))).toHaveLength(1);
  expect(values.join("\n")).not.toContain("refresh-original");

  expect(await pool.accounts.remove(pool.account.id)).toBe(true);
  expect(await pool.kv.list("")).toEqual(keysBefore);
});

First run: exact relevant test output

bb-plugin-account-pool:test: cache miss, executing f0fd7997eeeea411
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: > bb-plugin-account-pool@0.1.0 test /tmp/investigation/base/plugins/account-pool
bb-plugin-account-pool:test: > vitest run --config vitest.config.ts "src/refresh-rejection.test.ts"
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  RUN  v4.1.1 /tmp/investigation/base/plugins/account-pool
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/refresh-rejection.test.ts (15 tests) 241ms
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  Test Files  1 passed (1)
bb-plugin-account-pool:test:       Tests  15 passed (15)
bb-plugin-account-pool:test:    Start at  14:17:30
bb-plugin-account-pool:test:    Duration  1.03s (transform 476ms, setup 0ms, import 626ms, tests 241ms, environment 0ms)
bb-plugin-account-pool:test: 

5. Root cause

Released-code mechanism, established by static inspection: 0.48.1 background usage error handling only marks the account failed when recover is already true. That flag requires a pre-existing quota error. A ready account starts with no error, so its rejected OAuth refresh is logged and thrown, the usage-level catch swallows it, and no error is persisted. No rejection fingerprint is recorded in that release path, so another scheduled poll repeats the refresh. Retained quota is never refreshed when credential acquisition fails. This explains a silent ready state, repeated failures, stale usage, and an apparently successful refresh operation without alleging a provider outage.

Current-main repair: HTTP 400/401 classification throws OAuthRefreshError. Usage refresh propagates terminal OAuth failure into account error handles that terminal class even when no prior error exists. Rejected refresh handling stores a rejection fingerprint and only keeps a still-unexpired access token usable. Previously rejected token handling prevents automatic replay and surfaces error on expiry. setError persists the error and notifies account observers, and accountStatus gives error precedence over reset windows and utilization. Manual refresh operation uses the same hub path and returns the resulting account.

The old and current behavior were compared from trusted repository history; the old release was not executed. The missing transition was repaired in #6661 on November 2, after desktop 0.48.1 was published October 30. The actual server bundle and the origin of token rejection remain unverified. An unresolved main-only reproduction would require additional deployment or storage-failure evidence, not speculative changes to authentication.

6. Proposed fix / next action

No new production patch is justified: trusted main already contains the matching owner-boundary repair, and no focused regression test fails there. Verify that the deployed Account Pooler server bundle includes commit 6e77fce8c7a0a3bd71b66edfd5f223f5f92cc632 before treating this as a current-main regression. If it already does, the next experiment is an isolated reproduction with that exact bundle and redacted storage-write errors around the terminal rejection, without collecting credentials. Old quota retention without a dedicated staleness badge is a separate presentation question; this report verifies the account-error transition, not a new freshness policy.

7. Related history

No open pull request referencing issue #7121 was found. Merged PR #6661 is historical context, not an untrusted branch used for execution; all executed production code came from the recorded trusted main. Its merged commit is present on main and absent from the desktop 0.48.1 tag. The existing rejection suite already covers both Claude and Codex, proactive rejection before expiry, error after expiry, restart persistence, explicit re-login, and transient refresh failures.

8. Verification

The same investigator repeated the probe in a second newly created detached checkout at fa30b0a7dcdf745f7baf8e41721f754b7d3198fe, with a new frozen install and new temporary fixture directories. No shared account data or running instance was reused. Command: pnpm exec turbo run test --filter=bb-plugin-account-pool --force -- src/refresh-rejection.test.ts. Result: 15 tests passed, including both added stale-quota probes; Turbo reported zero cached tasks. This is a second clean run, not independent verification.

Report correction after the second run: none to the observed behavior. Historical release inspection then refined the verdict from not reproduced to already fixed on main, with the deployment caveat preserved.

bb-plugin-account-pool:test: cache bypass, force executing f0fd7997eeeea411
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: > bb-plugin-account-pool@0.1.0 test /tmp/investigation/verify/plugins/account-pool
bb-plugin-account-pool:test: > vitest run --config vitest.config.ts "src/refresh-rejection.test.ts"
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  RUN  v4.1.1 /tmp/investigation/verify/plugins/account-pool
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/refresh-rejection.test.ts (15 tests) 245ms
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  Test Files  1 passed (1)
bb-plugin-account-pool:test:       Tests  15 passed (15)
bb-plugin-account-pool:test:    Start at  14:18:36
bb-plugin-account-pool:test:    Duration  980ms (transform 432ms, setup 0ms, import 579ms, tests 245ms, environment 0ms)
bb-plugin-account-pool:test: 

9. Appendix

Existing rejection coverage before the added probe: 13/13 tests passed. Full plugin suite after the test-only extension: 390/390 tests across 13 files passed. git diff --check passed in both worktrees. The initial monorepo build hit a missing SDK runtime artifact in unrelated plugin builds; building SDK types and the focused test dependency graph supplied that artifact, and the normal monorepo build then passed all 73 tasks. No dependency or lockfile was changed.

Full Account Pooler suite output
bb-plugin-account-pool:test: cache miss, executing 9f8490ccbde4bd9f
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: > bb-plugin-account-pool@0.1.0 test /tmp/investigation/base/plugins/account-pool
bb-plugin-account-pool:test: > vitest run --config vitest.config.ts
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  RUN  v4.1.1 /tmp/investigation/base/plugins/account-pool
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/usage-source.test.ts (2 tests) 4ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/request-body.test.ts (62 tests) 31ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/oauth-login.test.ts (6 tests) 74ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/codex-adapter.test.ts (15 tests) 30ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/parent-pool.test.ts (13 tests) 28ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/codex-device-login.test.ts (9 tests) 76ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/store.test.ts (4 tests) 186ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/refresh-rejection.test.ts (15 tests) 272ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/upstream-transport.test.ts (6 tests) 474ms
bb-plugin-account-pool:test:    ✓ negotiates HTTP/1.1 when the upstream also offers HTTP/2  419ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/provider-adapter.test.ts (24 tests) 1037ms
bb-plugin-account-pool:test:      ✓ classifies rejected JSON responses even when the body and cancellation never settle  1002ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/account-login.test.ts (4 tests) 2175ms
bb-plugin-account-pool:test:      ✓ re-logs a Codex account in place through the device flow and refuses another workspace  2026ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| app.test.tsx (34 tests) 3209ms
bb-plugin-account-pool:test:  ✓ |bb-plugin-account-pool| src/server.test.ts (196 tests) 13012ms
bb-plugin-account-pool:test:      ✓ exposes Codex device login over RPC and the two-step CLI  3052ms
bb-plugin-account-pool:test:        ✓ retries a pinned claude session on its account after a transport error  1019ms
bb-plugin-account-pool:test:        ✓ retries a pinned codex session on its account after a transport error  1019ms
bb-plugin-account-pool:test:        ✓ preserves the correct binding after network error despite an older response completion  1018ms
bb-plugin-account-pool:test: 
bb-plugin-account-pool:test:  Test Files  13 passed (13)
bb-plugin-account-pool:test:       Tests  390 passed (390)
bb-plugin-account-pool:test:    Start at  14:17:58
bb-plugin-account-pool:test:    Duration  14.50s (transform 6.30s, setup 0ms, import 11.17s, tests 20.61s, environment 1.37s)
bb-plugin-account-pool:test: 

Metadata commands used: git fetch origin main; git show desktop-v0.48.1:plugins/account-pool/src/hub.ts; git log desktop-v0.48.1..origin/main -- plugins/account-pool/src/hub.ts; git merge-base --is-ancestor 6e77fce8c7 desktop-v0.48.1 (exit 1); gh release view desktop-v0.48.1 --repo get-bb/bb --json tagName,publishedAt,targetCommitish. The release date and source ancestry were checked, not assumed from the version string.

Privacy / trust: issue content was treated only as untrusted claims, and no instructions or scripts from it were executed. Source permalinks were constructed from trusted repository revisions. Output is limited to synthetic test evidence; private paths are normalized. No screenshots are included because this is a credential-state probe, not a visual reproduction. Reproduction artifacts remain local; the complete code and evidence needed to rerun are inline above.

> AGENT GENERATED