Skip to content

Commit 516baad

Browse files
authored
Remove stale Claude auth helper support (#457)
1 parent 9c1683b commit 516baad

8 files changed

Lines changed: 22 additions & 143 deletions

File tree

apps/web/src/appSettings.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ describe("getProviderStartOptions", () => {
8080
},
8181
});
8282
});
83+
84+
it("does not emit Claude start options without a Claude binary path", () => {
85+
expect(
86+
getProviderStartOptions({
87+
claudeBinaryPath: "",
88+
codexBinaryPath: "",
89+
codexHomePath: "",
90+
copilotBinaryPath: "",
91+
copilotConfigDir: "",
92+
openclawGatewayUrl: "",
93+
openclawPassword: "",
94+
}),
95+
).toBeUndefined();
96+
});
8397
});
8498

8599
describe("resolveBrowserPreviewStartPageUrl", () => {

apps/web/src/appSettings.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ export const AppSettingsSchema = Schema.Struct({
9191
claudeBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
9292
copilotBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
9393
copilotConfigDir: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
94-
claudeAuthTokenHelperCommand: Schema.String.check(Schema.isMaxLength(4096)).pipe(
95-
withDefaults(() => ""),
96-
),
9794
codexBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
9895
codexHomePath: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
9996
backgroundImageUrl: Schema.String.check(Schema.isMaxLength(4096)).pipe(withDefaults(() => "")),
@@ -392,9 +389,7 @@ export function getProviderStartOptions(
392389
| "codexHomePath"
393390
| "openclawGatewayUrl"
394391
| "openclawPassword"
395-
> & {
396-
claudeAuthTokenHelperCommand?: AppSettings["claudeAuthTokenHelperCommand"];
397-
},
392+
>,
398393
): ProviderStartOptions | undefined {
399394
const providerOptions: ProviderStartOptions = {
400395
...(settings.codexBinaryPath || settings.codexHomePath
@@ -405,13 +400,10 @@ export function getProviderStartOptions(
405400
},
406401
}
407402
: {}),
408-
...(settings.claudeBinaryPath || settings.claudeAuthTokenHelperCommand
403+
...(settings.claudeBinaryPath
409404
? {
410405
claudeAgent: {
411-
...(settings.claudeBinaryPath ? { binaryPath: settings.claudeBinaryPath } : {}),
412-
...(settings.claudeAuthTokenHelperCommand
413-
? { authTokenHelperCommand: settings.claudeAuthTokenHelperCommand }
414-
: {}),
406+
binaryPath: settings.claudeBinaryPath,
415407
},
416408
}
417409
: {}),

apps/web/src/components/settings/SettingsRouteContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export function SettingsRouteContextProvider({ children }: { children: ReactNode
9090
currentGitTextGenerationModel !== defaultGitTextGenerationModel;
9191
const isInstallSettingsDirty =
9292
settings.claudeBinaryPath !== defaults.claudeBinaryPath ||
93-
settings.claudeAuthTokenHelperCommand !== defaults.claudeAuthTokenHelperCommand ||
9493
settings.copilotBinaryPath !== defaults.copilotBinaryPath ||
9594
settings.copilotConfigDir !== defaults.copilotConfigDir ||
9695
settings.codexBinaryPath !== defaults.codexBinaryPath ||

apps/web/src/lib/claudeAuthTokenHelperPresets.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

apps/web/src/lib/providerAvailability.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("providerAvailability", () => {
4949
).toBe(false);
5050
});
5151

52-
it("blocks claudeAgent when status is error even if claudeAuthTokenHelperCommand is set and available is true", () => {
52+
it("blocks claudeAgent when status is error", () => {
5353
expect(
5454
isProviderReadyForThreadSelection({
5555
provider: "claudeAgent",
@@ -60,12 +60,11 @@ describe("providerAvailability", () => {
6060
authStatus: "unauthenticated",
6161
}),
6262
],
63-
claudeAuthTokenHelperCommand: "my-token-helper",
6463
}),
6564
).toBe(false);
6665
});
6766

68-
it("allows claudeAgent with claudeAuthTokenHelperCommand when status is ready but auth is unauthenticated", () => {
67+
it("blocks unauthenticated claudeAgent even when the status is otherwise ready", () => {
6968
expect(
7069
isProviderReadyForThreadSelection({
7170
provider: "claudeAgent",
@@ -76,9 +75,8 @@ describe("providerAvailability", () => {
7675
authStatus: "unauthenticated",
7776
}),
7877
],
79-
claudeAuthTokenHelperCommand: "my-token-helper",
8078
}),
81-
).toBe(true);
79+
).toBe(false);
8280
});
8381

8482
it("treats configured OpenClaw as selectable even when server auth state is unknown", () => {

apps/web/src/lib/providerAvailability.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function isProviderReadyForThreadSelection(input: {
3131
provider: ProviderKind;
3232
statuses: ReadonlyArray<ServerProviderStatus>;
3333
openclawGatewayUrl?: string | null | undefined;
34-
claudeAuthTokenHelperCommand?: string | null | undefined;
3534
}): boolean {
3635
const status = getProviderStatusByKind(input.statuses, input.provider);
3736

@@ -46,31 +45,19 @@ export function isProviderReadyForThreadSelection(input: {
4645
return false;
4746
}
4847

49-
if (
50-
input.provider === "claudeAgent" &&
51-
(input.claudeAuthTokenHelperCommand ?? "").trim().length > 0 &&
52-
status.available &&
53-
status.status === "ready" &&
54-
(status.authStatus ?? status.auth?.status) === "unauthenticated"
55-
) {
56-
return true;
57-
}
58-
5948
const authStatus = status.authStatus ?? status.auth?.status;
6049
return Boolean(status.available && status.status === "ready" && authStatus !== "unauthenticated");
6150
}
6251

6352
export function getSelectableThreadProviders(input: {
6453
statuses: ReadonlyArray<ServerProviderStatus>;
6554
openclawGatewayUrl?: string | null | undefined;
66-
claudeAuthTokenHelperCommand?: string | null | undefined;
6755
}): ProviderKind[] {
6856
return THREAD_PROVIDER_ORDER.filter((provider) =>
6957
isProviderReadyForThreadSelection({
7058
provider,
7159
statuses: input.statuses,
7260
openclawGatewayUrl: input.openclawGatewayUrl,
73-
claudeAuthTokenHelperCommand: input.claudeAuthTokenHelperCommand,
7461
}),
7562
);
7663
}

apps/web/src/routes/_chat.settings.index.tsx

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import {
8181
getProviderStatusDescription,
8282
getProviderStatusHeading,
8383
} from "../components/chat/providerStatusPresentation";
84-
import { CLAUDE_AUTH_TOKEN_HELPER_PRESETS } from "../lib/claudeAuthTokenHelperPresets";
8584
import {
8685
INSTALL_PROVIDER_SETTINGS,
8786
PROVIDER_AUTH_GUIDES,
@@ -236,7 +235,6 @@ function getAuthenticationBadgeCopy(input: {
236235
status: ServerProviderStatus | null;
237236
provider: ProviderKind;
238237
openclawGatewayUrl: string;
239-
claudeAuthTokenHelperCommand: string;
240238
}): {
241239
tone: "success" | "warning" | "error";
242240
label: string;
@@ -246,7 +244,6 @@ function getAuthenticationBadgeCopy(input: {
246244
provider: input.provider,
247245
statuses: input.status ? [input.status] : [],
248246
openclawGatewayUrl: input.openclawGatewayUrl,
249-
claudeAuthTokenHelperCommand: input.claudeAuthTokenHelperCommand,
250247
})
251248
) {
252249
return { tone: "success", label: "Available in thread picker" };
@@ -271,19 +268,16 @@ function AuthenticationStatusCard({
271268
provider,
272269
status,
273270
openclawGatewayUrl,
274-
claudeAuthTokenHelperCommand,
275271
}: {
276272
provider: ProviderKind;
277273
status: ServerProviderStatus | null;
278274
openclawGatewayUrl: string;
279-
claudeAuthTokenHelperCommand: string;
280275
}) {
281276
const guide = PROVIDER_AUTH_GUIDES[provider];
282277
const badge = getAuthenticationBadgeCopy({
283278
status,
284279
provider,
285280
openclawGatewayUrl,
286-
claudeAuthTokenHelperCommand,
287281
});
288282
const badgeClassName =
289283
badge.tone === "success"
@@ -419,7 +413,7 @@ function SettingsRouteView() {
419413
const [openKeybindingsError, setOpenKeybindingsError] = useState<string | null>(null);
420414
const [openInstallProviders, setOpenInstallProviders] = useState<Record<ProviderKind, boolean>>({
421415
codex: Boolean(settings.codexBinaryPath || settings.codexHomePath),
422-
claudeAgent: Boolean(settings.claudeBinaryPath || settings.claudeAuthTokenHelperCommand),
416+
claudeAgent: Boolean(settings.claudeBinaryPath),
423417
gemini: false,
424418
copilot: Boolean(settings.copilotBinaryPath || settings.copilotConfigDir),
425419
openclaw: Boolean(settings.openclawGatewayUrl || settings.openclawPassword),
@@ -474,18 +468,12 @@ function SettingsRouteView() {
474468
const codexBinaryPath = settings.codexBinaryPath;
475469
const codexHomePath = settings.codexHomePath;
476470
const claudeBinaryPath = settings.claudeBinaryPath;
477-
const claudeAuthTokenHelperCommand = settings.claudeAuthTokenHelperCommand;
478-
const selectedClaudeAuthTokenHelperPreset =
479-
CLAUDE_AUTH_TOKEN_HELPER_PRESETS.find(
480-
(preset) => preset.command === claudeAuthTokenHelperCommand,
481-
)?.label ?? "";
482471
const keybindingsConfigPath = serverConfigQuery.data?.keybindingsConfigPath ?? null;
483472
const availableEditors = serverConfigQuery.data?.availableEditors;
484473
const providerStatuses = serverConfigQuery.data?.providers ?? [];
485474
const selectableProviders = getSelectableThreadProviders({
486475
statuses: providerStatuses,
487476
openclawGatewayUrl: settings.openclawGatewayUrl,
488-
claudeAuthTokenHelperCommand,
489477
});
490478

491479
const gitTextGenerationModelOptions = getAppModelOptions(
@@ -527,7 +515,6 @@ function SettingsRouteView() {
527515
: savedCustomModelRows.slice(0, 5);
528516
const isInstallSettingsDirty =
529517
settings.claudeBinaryPath !== defaults.claudeBinaryPath ||
530-
settings.claudeAuthTokenHelperCommand !== defaults.claudeAuthTokenHelperCommand ||
531518
settings.copilotBinaryPath !== defaults.copilotBinaryPath ||
532519
settings.copilotConfigDir !== defaults.copilotConfigDir ||
533520
settings.codexBinaryPath !== defaults.codexBinaryPath ||
@@ -1361,7 +1348,6 @@ function SettingsRouteView() {
13611348
provider={provider}
13621349
status={providerStatuses.find((status) => status.provider === provider) ?? null}
13631350
openclawGatewayUrl={settings.openclawGatewayUrl}
1364-
claudeAuthTokenHelperCommand={claudeAuthTokenHelperCommand}
13651351
/>
13661352
))}
13671353
</div>
@@ -1378,7 +1364,6 @@ function SettingsRouteView() {
13781364
onClick={() => {
13791365
updateSettings({
13801366
claudeBinaryPath: defaults.claudeBinaryPath,
1381-
claudeAuthTokenHelperCommand: defaults.claudeAuthTokenHelperCommand,
13821367
codexBinaryPath: defaults.codexBinaryPath,
13831368
codexHomePath: defaults.codexHomePath,
13841369
copilotBinaryPath: defaults.copilotBinaryPath,
@@ -1405,9 +1390,7 @@ function SettingsRouteView() {
14051390
? settings.codexBinaryPath !== defaults.codexBinaryPath ||
14061391
settings.codexHomePath !== defaults.codexHomePath
14071392
: providerSettings.provider === "claudeAgent"
1408-
? settings.claudeBinaryPath !== defaults.claudeBinaryPath ||
1409-
settings.claudeAuthTokenHelperCommand !==
1410-
defaults.claudeAuthTokenHelperCommand
1393+
? settings.claudeBinaryPath !== defaults.claudeBinaryPath
14111394
: settings.copilotBinaryPath !== defaults.copilotBinaryPath ||
14121395
settings.copilotConfigDir !== defaults.copilotConfigDir;
14131396
const binaryPathValue =
@@ -1494,76 +1477,6 @@ function SettingsRouteView() {
14941477
</span>
14951478
</label>
14961479

1497-
{providerSettings.provider === "claudeAgent" ? (
1498-
<label
1499-
htmlFor="provider-install-claude-auth-token-helper"
1500-
className="block"
1501-
>
1502-
<span className="block text-xs font-medium text-foreground">
1503-
Claude auth token helper command
1504-
</span>
1505-
<div className="mt-1 flex flex-col gap-2 sm:flex-row">
1506-
<Input
1507-
id="provider-install-claude-auth-token-helper"
1508-
className="sm:flex-1"
1509-
value={claudeAuthTokenHelperCommand}
1510-
onChange={(event) =>
1511-
updateSettings({
1512-
claudeAuthTokenHelperCommand: event.target.value,
1513-
})
1514-
}
1515-
placeholder="op read op://shared/anthropic/token --no-newline"
1516-
spellCheck={false}
1517-
/>
1518-
<Select
1519-
value={selectedClaudeAuthTokenHelperPreset}
1520-
onValueChange={(value) => {
1521-
const preset =
1522-
CLAUDE_AUTH_TOKEN_HELPER_PRESETS.find(
1523-
(entry) => entry.label === value,
1524-
) ?? null;
1525-
if (!preset) return;
1526-
updateSettings({
1527-
claudeAuthTokenHelperCommand: preset.command,
1528-
});
1529-
}}
1530-
>
1531-
<SelectTrigger
1532-
className="w-full sm:w-44"
1533-
aria-label="Claude auth token helper preset"
1534-
>
1535-
<SelectValue placeholder="Secret manager" />
1536-
</SelectTrigger>
1537-
<SelectPopup align="end" alignItemWithTrigger={false}>
1538-
{CLAUDE_AUTH_TOKEN_HELPER_PRESETS.map((preset) => (
1539-
<SelectItem
1540-
hideIndicator
1541-
key={preset.label}
1542-
value={preset.label}
1543-
title={preset.description}
1544-
>
1545-
<div className="flex min-w-0 flex-col">
1546-
<span className="truncate">{preset.label}</span>
1547-
<span className="truncate text-[11px] text-muted-foreground">
1548-
{preset.command}
1549-
</span>
1550-
</div>
1551-
</SelectItem>
1552-
))}
1553-
</SelectPopup>
1554-
</Select>
1555-
</div>
1556-
<span className="mt-1 block text-xs text-muted-foreground">
1557-
Runs locally before Claude sessions start. The command should
1558-
print the token to stdout so OK Code can set
1559-
ANTHROPIC_AUTH_TOKEN automatically.
1560-
</span>
1561-
<span className="mt-1 block text-[11px] text-muted-foreground">
1562-
Choose a secret manager to prefill the command.
1563-
</span>
1564-
</label>
1565-
) : null}
1566-
15671480
{homePathKey ? (
15681481
<label
15691482
htmlFor={`provider-install-${homePathKey}`}

packages/contracts/src/orchestration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export const CodexProviderStartOptions = Schema.Struct({
6767
export const ClaudeProviderStartOptions = Schema.Struct({
6868
binaryPath: Schema.optional(TrimmedNonEmptyString),
6969
permissionMode: Schema.optional(TrimmedNonEmptyString),
70-
authTokenHelperCommand: Schema.optional(TrimmedNonEmptyString),
7170
maxThinkingTokens: Schema.optional(NonNegativeInt),
7271
});
7372

0 commit comments

Comments
 (0)