@@ -480,9 +480,19 @@ function claudeAuthMetadata(input: {
480480 return undefined;
481481}
482482
483+ function apiProviderAuthMetadata(
484+ apiProvider: string | undefined,
485+ ): { readonly type: string; readonly label: string } | undefined {
486+ return apiProvider === "bedrock" ? { type: "bedrock", label: "Amazon Bedrock" } : undefined;
487+ }
488+
483489// ── SDK capability probe ────────────────────────────────────────────
484490
485- const CAPABILITIES_PROBE_TIMEOUT_MS = 8_000;
491+ // Amazon Bedrock initializes far slower than first-party auth: the SDK boots the
492+ // Bedrock backend and runs the `awsAuthRefresh` credential hook before returning
493+ // account info. The previous 8s budget expired mid-init, so the probe returned
494+ // `undefined` and left the provider unverified and unselectable in the picker.
495+ const CAPABILITIES_PROBE_TIMEOUT_MS = 25_000;
486496
487497function nonEmptyProbeString(value: string): string | undefined {
488498 const candidate = value.trim();
@@ -493,6 +503,12 @@ type ClaudeCapabilitiesProbe = {
493503 readonly email: string | undefined;
494504 readonly subscriptionType: string | undefined;
495505 readonly tokenSource: string | undefined;
506+ /**
507+ * Active API backend reported by the SDK's `AccountInfo`. Anthropic OAuth
508+ * login only applies when `"firstParty"`; for Amazon Bedrock (`"bedrock"`)
509+ * the subscription/token fields are absent and auth is external AWS creds.
510+ */
511+ readonly apiProvider: string | undefined;
496512 readonly slashCommands: ReadonlyArray<ServerProviderSlashCommand>;
497513};
498514
@@ -618,12 +634,14 @@ const probeClaudeCapabilities = (
618634 readonly email?: string;
619635 readonly subscriptionType?: string;
620636 readonly tokenSource?: string;
637+ readonly apiProvider?: string;
621638 }
622639 | undefined;
623640 return {
624641 email: account?.email,
625642 subscriptionType: account?.subscriptionType,
626643 tokenSource: account?.tokenSource,
644+ apiProvider: account?.apiProvider,
627645 slashCommands: parseClaudeInitializationCommands(init.commands),
628646 } satisfies ClaudeCapabilitiesProbe;
629647 });
@@ -799,10 +817,11 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
799817 });
800818 }
801819
802- const authMetadata = claudeAuthMetadata({
803- subscriptionType: capabilities.subscriptionType,
804- authMethod: capabilities.tokenSource,
805- });
820+ const authMetadata =
821+ claudeAuthMetadata({
822+ subscriptionType: capabilities.subscriptionType,
823+ authMethod: capabilities.tokenSource,
824+ }) ?? apiProviderAuthMetadata(capabilities.apiProvider);
806825 return buildServerProvider({
807826 presentation: CLAUDE_PRESENTATION,
808827 enabled: claudeSettings.enabled,
0 commit comments