@devries-cameron20 / t3code Mirror · read-only / commits / feb9c6b842
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, 00:45 UTC

fix(server): signed-out Claude instances with their own config dir name it in the sign-in hint (#32951)

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

Julius Marminge committed Nov 10, 2026 at 03:28 UTC feb9c6b8425efc05dd0d3b198999ef90e16fc62c
2 files changed +70 -2
apps/server/src/provider/ClaudeProvider.ts
+12 -2
@@ -40,7 +40,11 @@ import {
40 type ServerProviderDraft,
41 } from "@t3tools/provider-core/server/snapshotProbe";
42 import { resolveClaudeSdkExecutablePath } from "./Drivers/ClaudeExecutable.ts";
43 -import { hasClaudeManagedMcpConfig, makeClaudeEnvironment } from "./Drivers/ClaudeHome.ts";
43 +import {
44 + claudeSignedOutMessage,
45 + hasClaudeManagedMcpConfig,
46 + makeClaudeEnvironment,
47 +} from "./Drivers/ClaudeHome.ts";
48 import { discoverClaudeSkills, readClaudeSettingsEnv } from "./Drivers/ClaudeSkills.ts";
49 import type { ProviderWorkspaceSnapshot } from "@t3tools/provider-core/server/driver";
50 import { makeUnavailableUsageLimits } from "@t3tools/provider-core/server/usageLimits";
@@ -674,6 +678,9 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
678 endpoint.hostname !== "" &&
679 endpoint.hostname !== "api.anthropic.com";
680 if (!customApiEndpoint && claudeAuthStatus(capabilities) === "unauthenticated") {
681 + const path = yield* Path.Path;
682 + const configDir = (yield* makeClaudeEnvironment(claudeSettings, resolvedEnvironment))
683 + .CLAUDE_CONFIG_DIR;
684 return buildServerProvider({
685 presentation: CLAUDE_PRESENTATION,
686 enabled: claudeSettings.enabled,
@@ -687,7 +694,10 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
694 version: parsedVersion,
695 status: "error",
696 auth: { status: "unauthenticated" },
690 - message: "Claude Code is not authenticated. Run `claude auth login` and try again.",
697 + message:
698 + configDir === undefined
699 + ? "Claude Code is not authenticated. Run `claude auth login` and try again."
700 + : claudeSignedOutMessage({ configDir, cwd: path.resolve(cwd ?? ".") }),
701 },
702 });
703 }
apps/server/src/provider/ProviderRegistry.test.ts
+58
@@ -3192,6 +3192,64 @@ it.layer(
3192 ),
3193 );
3194
3195 + it.effect.each([
3196 + {
3197 + name: "its own home path",
3198 + homePath: "/srv/claude-personal",
3199 + environment: { ANTHROPIC_BASE_URL: "" },
3200 + configDir: "/srv/claude-personal",
3201 + },
3202 + {
3203 + name: "an inherited CLAUDE_CONFIG_DIR",
3204 + homePath: "",
3205 + environment: { ANTHROPIC_BASE_URL: "", CLAUDE_CONFIG_DIR: "/srv/claude-work" },
3206 + configDir: "/srv/claude-work",
3207 + },
3208 + {
3209 + name: "the default config dir",
3210 + homePath: "",
3211 + environment: { ANTHROPIC_BASE_URL: "" },
3212 + configDir: undefined,
3213 + },
3214 + ])(
3215 + "tells a logged-out instance on $name where to sign in",
3216 + ({ homePath, environment, configDir }) =>
3217 + Effect.gen(function* () {
3218 + const status = yield* checkClaudeProviderStatus(
3219 + { ...defaultClaudeSettings, homePath },
3220 + claudeCapabilities({
3221 + tokenSource: "none",
3222 + apiKeySource: "none",
3223 + apiProvider: "firstParty",
3224 + }),
3225 + environment,
3226 + );
3227 + assert.strictEqual(status.auth.status, "unauthenticated");
3228 + if (configDir === undefined) {
3229 + assert.strictEqual(
3230 + status.message,
3231 + "Claude Code is not authenticated. Run `claude auth login` and try again.",
3232 + );
3233 + } else {
3234 + // A home path is resolved to a native path; an inherited value is kept literal.
3235 + const expected = homePath ? (yield* Path.Path).resolve(configDir) : configDir;
3236 + assert.include(
3237 + status.message ?? "",
3238 + `CLAUDE_CONFIG_DIR set to ${JSON.stringify(expected)}`,
3239 + "a bare `claude auth login` signs in ~/.claude, not this instance's config dir",
3240 + );
3241 + }
3242 + }).pipe(
3243 + Effect.provide(
3244 + layerMockSpawner((args) => {
3245 + const joined = args.join(" ");
3246 + if (joined === "--version") return { stdout: "1.0.0\n", stderr: "", code: 0 };
3247 + throw new Error(`Unexpected args: ${joined}`);
3248 + }),
3249 + ),
3250 + ),
3251 + );
3252 +
3253 it.effect("tells a logged-out CLI which models need a Claude Code update", () =>
3254 Effect.gen(function* () {
3255 const status = yield* checkClaudeProviderStatus(