Skip to content

Record sanitized OAuth refresh diagnostics in Account Pooler - #4918

Merged
ymichael merged 2 commits into
mainfrom
bb/investigate-claude-account-in-pooler-thr_sfqjqzm9n7
Oct 5, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/investigate-claude-account-in-pooler-thr_sfqjqzm9n7

Conversation

@ymichael

@ymichael ymichael commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Account Pooler discarded OAuth token endpoint error bodies and did not log refresh outcomes. An expired Claude refresh token therefore appeared only as OAuth refresh failed with HTTP 400, with no refresh history to help explain when credentials stopped working.

What changed

Preserve allowlisted OAuth error codes and descriptions in account errors exposed through status, CLI, and RPCs. For example, the error now includes invalid_grant: Refresh token expired. Inspect JSON error bodies for at most one second and 4 KiB, retaining the existing HTTP rejection classification when inspection fails.

Log Claude and Codex refresh successes and failures with provider, account ID, expiry timestamps, and whether refresh was forced. Omit credentials, arbitrary provider text, and raw response bodies.

How you verified

  • Confirmed the new diagnostics regressions fail before the implementation.
  • pnpm exec turbo run test lint typecheck --filter=bb-plugin-account-pool: 348 tests passed; typecheck and lint passed. Lint reports two existing React warnings in unchanged app code.
  • pnpm exec turbo run test --filter=bb-plugin-account-pool -- src/provider-adapter.test.ts: all 24 tests passed after strengthening the stalled JSON response test.
  • Coverage includes allowlisted details, credential omission, malformed/oversized/broken/stalled error bodies, cancellation that never settles, and refresh failure/recovery logs for both providers.
  • git diff --check passed.

AGENT GENERATED

@ymichael
ymichael merged commit ca5fe0b into main Oct 5, 2026
34 checks passed
@ymichael
ymichael deleted the bb/investigate-claude-account-in-pooler-thr_sfqjqzm9n7 branch October 5, 2026 18:19
stephendolan added a commit to stephendolan/bb that referenced this pull request Oct 6, 2026
Port the Account Pooler changes from get-bb/bb get-bb#4739, get-bb#4918, and get-bb#5052:
safe OAuth refresh diagnostics, Windows-compatible permission checks,
and deterministic parent retry tests.

Preserve least-usage selection and durable conversation assignments.
Regenerate the standalone plugin for SDK 0.6.15 and include its TLS test
fixtures so the exported package can run the complete test suite.

Validation: 360 tests, lint, type checking, SDK contract check, and plugin build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant