@devries-cameron20 / t3code Mirror · read-only / commits / 560ddb14d9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 15:45 UTC

feat(web): warn before adding a second Claude or Codex account (#25475)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 26, 2026 at 14:41 UTC 560ddb14d90eba7652da4f7846e4b18d4d802aa4
3 files changed +58 -1
apps/web/src/components/settings/AddCodexAccountDialog.tsx
+6 -1
@@ -18,8 +18,11 @@ import { Button } from "../ui/button";
18 import { Dialog } from "../ui/dialog";
19 import { Input } from "../ui/input";
20 import { WizardFooter, WizardHeader, WizardPanel, WizardPopup } from "../ui/wizard";
21 +import { MultipleAccountsNote } from "./MultipleAccountsNote";
22 import { SettingsRow } from "./settingsLayout";
23
24 +const CODEX_DRIVER_KIND = ProviderDriverKind.make("codex");
25 +
26 export function AddCodexAccountDialog({
27 environmentId,
28 onClose,
@@ -60,7 +63,7 @@ export function AddCodexAccountDialog({
63 providerInstances: {
64 ...settings.providerInstances,
65 [id]: {
63 - driver: ProviderDriverKind.make("codex"),
66 + driver: CODEX_DRIVER_KIND,
67 displayName,
68 enabled: true,
69 config: { enabled: true, setupMode: "managed" },
@@ -102,6 +105,7 @@ export function AddCodexAccountDialog({
105 ) : (
106 <form
107 id="add-codex-account"
108 + className="grid gap-3"
109 onSubmit={(event) => {
110 event.preventDefault();
111 void createAccount();
@@ -120,6 +124,7 @@ export function AddCodexAccountDialog({
124 />
125 }
126 />
127 + <MultipleAccountsNote environmentId={environmentId} driver={CODEX_DRIVER_KIND} />
128 </form>
129 )}
130 </WizardPanel>
apps/web/src/components/settings/AddProviderInstanceDialog.tsx
+2
@@ -51,6 +51,7 @@ import { AcpRegistrySearchStep, useAcpRegistrySearch } from "./AcpRegistrySearch
51 import { ProviderWizardAuthenticationStep } from "./ProviderWizardAuthenticationStep";
52 import { resolveOfficialAcpRegistryIconUrl } from "./AcpRegistryIcon";
53 import { AddManagedCodexAccountDialog } from "./CodexSetupSection";
54 +import { MultipleAccountsNote } from "./MultipleAccountsNote";
55 import { ProviderEnvironmentSection } from "./ProviderInstanceCard";
56
57 /** Limit the slug to 48 chars so the composed ProviderInstanceId fits its 64-char cap. */
@@ -442,6 +443,7 @@ export function AddProviderInstanceDialog({
443 );
444 })}
445 </RadioGroup>
446 + <MultipleAccountsNote environmentId={environmentId} driver={driver} />
447 </div>
448
449 {wizardStep === 0 ? (
apps/web/src/components/settings/MultipleAccountsNote.tsx new
+50
@@ -0,0 +1,50 @@
1 +import { useAtomValue } from "@effect/atom-react";
2 +import type { EnvironmentId, ProviderDriverKind } from "@t3tools/contracts";
3 +import { InfoIcon } from "lucide-react";
4 +
5 +import { serverEnvironment } from "../../state/server";
6 +import { Alert, AlertDescription } from "../ui/alert";
7 +
8 +const MULTIPLE_ACCOUNTS_FAQ_URL =
9 + "https://github.com/pingdotgg/t3code/blob/main/docs/user/faq.md#can-i-add-a-bunch-of-accounts-for-one-provider";
10 +
11 +const PROVIDER_NAMES = new Map<string, string>([
12 + ["codex", "Codex"],
13 + ["claudeAgent", "Claude"],
14 +]);
15 +
16 +/** Shown while adding a Claude or Codex account when the environment already has one signed in. */
17 +export function MultipleAccountsNote({
18 + environmentId,
19 + driver,
20 +}: {
21 + readonly environmentId: EnvironmentId;
22 + readonly driver: ProviderDriverKind;
23 +}) {
24 + const providers = useAtomValue(serverEnvironment.providersValueAtom(environmentId));
25 + const providerName = PROVIDER_NAMES.get(driver);
26 + const hasSignedInAccount =
27 + providerName !== undefined &&
28 + providers?.some(
29 + (provider) => provider.driver === driver && provider.auth.status === "authenticated",
30 + );
31 + if (!hasSignedInAccount) return null;
32 + return (
33 + <Alert variant="info" role="note">
34 + <InfoIcon aria-hidden />
35 + <AlertDescription>
36 + <p>
37 + We do not recommend managing multiple {providerName} accounts in T3 Code.{" "}
38 + <a
39 + href={MULTIPLE_ACCOUNTS_FAQ_URL}
40 + target="_blank"
41 + rel="noreferrer"
42 + className="underline underline-offset-2 hover:text-foreground"
43 + >
44 + More info
45 + </a>
46 + </p>
47 + </AlertDescription>
48 + </Alert>
49 + );
50 +}