Skip to content

feature: support for ~/.claude/settings.json#248

Closed
michalCapo wants to merge 5 commits intoAutoMaker-Org:mainfrom
michalCapo:main
Closed

feature: support for ~/.claude/settings.json#248
michalCapo wants to merge 5 commits intoAutoMaker-Org:mainfrom
michalCapo:main

Conversation

@michalCapo
Copy link

@michalCapo michalCapo commented Dec 23, 2025

setup process now have third option to use settings.json file. This is how you can use GLM together with claude code.

Summary by CodeRabbit

  • New Features
    • Added Claude authentication via a local settings file (~/.claude/settings.json) and UI support to verify it.
    • UI: settings-file verification flow, status badge, verification button, error/status panels, and display of active auth method (settings file, API key, or none).
  • Bug Fixes
    • Verification now temporarily applies and reliably restores environment-derived credentials after checks.

✏️ Tip: You can customize this high-level summary in your review settings.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @michalCapo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Claude integration by introducing a new, flexible authentication mechanism through a ~/.claude/settings.json file. This allows users with existing Claude Code configurations to seamlessly integrate by leveraging their existing settings, including environment variables and API keys. The changes span both the backend provider logic, to correctly parse and prioritize this new authentication source, and the frontend setup process, to provide a user-friendly way to configure and verify this method.

Highlights

  • New Authentication Method: Introduced support for authenticating Claude via a ~/.claude/settings.json file, allowing the system to load environment variables and API keys from this configuration.
  • Authentication Priority: The Claude provider now prioritizes authentication sources in the following order: ~/.claude/settings.json, then the ANTHROPIC_API_KEY environment variable, and finally in-memory storage.
  • Dynamic Environment Loading: The executeQuery method in the Claude provider now dynamically loads environment variables from ~/.claude/settings.json before execution and restores the original environment afterwards, ensuring isolated and correct authentication.
  • UI Integration: The setup UI has been updated to include a new option for verifying authentication using the ~/.claude/settings.json file, providing clear status indicators and verification functionality.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds support for reading and applying ~/.claude/settings.json for Claude authentication across server detection, verification, runtime provider execution, and the UI setup flow; introduces helpers to load/extract tokens, temporarily apply/restore env vars during operations, and surface an authMethod state.

Changes

Cohort / File(s) Summary
Server settings module
apps/server/src/lib/claude-settings.ts
New module to locate/load ~/.claude/settings.json, extract/auth tokens (env, apiKey/api_key/primaryApiKey, oauthToken), synthesize env mappings (including mapping ANTHROPIC_AUTH_TOKENANTHROPIC_API_KEY), and expose helpers: getSettingsPath, loadClaudeSettings, extractAuthToken, hasSettingsFileAuth, getSettingsFileToken, getSettingsEnv.
Provider runtime wiring
apps/server/src/providers/claude-provider.ts, apps/server/src/providers/types.ts
ClaudeProvider: load/apply settings env before executeQuery, support in-memory API key lookup, map settings tokens to expected env vars, and restore original env in finally. Added optional authMethod to InstallationStatus union (`'settings_file'
Setup routes / verification
apps/server/src/routes/setup/get-claude-status.ts, apps/server/src/routes/setup/routes/verify-claude-auth.ts
Detect and expose hasSettingsFileAuth() in status; support authMethod: 'settings_file' for verification; load settings env for verification requests, map tokens, track and restore modified env keys, and centralize error messaging for cli/api_key/settings_file flows.
UI store & setup step
apps/ui/src/store/setup-store.ts, apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx
Add 'settings_file' to ClaudeAuthMethod and optional hasSettingsFileAuth? to ClaudeAuthStatus; UI adds state and flow for settings-file verification, status badge helper, incorporate settings-file readiness into isReady, and an AccordionItem to verify ~/.claude/settings.json.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant UI as Claude Setup UI
    participant Server as Setup Server
    participant FS as File System
    participant Claude as Claude API

    User->>UI: Click "Verify Settings File"
    UI->>Server: POST /verify-claude-auth { authMethod: "settings_file" }

    Server->>FS: Read ~/.claude/settings.json
    FS-->>Server: Return JSON or ENOENT/error

    alt settings file with token
        Server->>Server: extract token, build/merge env (map ANTHROPIC_AUTH_TOKEN→ANTHROPIC_API_KEY)
        Server->>Claude: perform test request using temp env / token
        Claude-->>Server: success
        Server->>Server: restore original env vars
        Server-->>UI: { authenticated: true, authMethod: "settings_file" }
        UI->>User: display success badge
    else missing token / verification failed
        Server->>Server: restore original env vars
        Server-->>UI: { authenticated: false, error: "no token or verification failed" }
        UI->>User: display error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

"I nibbled through settings under moonlight's gleam,
Found tokens like carrots tucked neat in a dream.
I hop, I verify, then tidy the nest —
Env vars restored, the system can rest.
A rabbit's small dance for auth that is best 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main feature addition: support for ~/.claude/settings.json file as a new authentication method.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa0e53 and 850f8e5.

📒 Files selected for processing (2)
  • apps/server/src/providers/claude-provider.ts
  • apps/server/src/providers/types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/server/src/providers/types.ts
🧰 Additional context used
🧬 Code graph analysis (1)
apps/server/src/providers/claude-provider.ts (2)
apps/server/src/lib/claude-settings.ts (2)
  • getSettingsEnv (104-134)
  • hasSettingsFileAuth (87-90)
apps/server/src/providers/types.ts (1)
  • InstallationStatus (71-80)
🔇 Additional comments (4)
apps/server/src/providers/claude-provider.ts (4)

7-11: LGTM!

The documentation clearly describes the three authentication sources now supported by the provider.


21-21: LGTM!

The new imports from the claude-settings module are properly used throughout the provider for settings file authentication.


164-173: Environment restoration logic is correct.

The finally block properly restores original values or deletes newly-set environment variables. However, this doesn't resolve the race condition issue during the execution window (see comment on lines 67-105).


179-203: LGTM! Multi-source authentication detection is well-implemented.

The method correctly checks all three authentication sources and sets the appropriate status fields. The authMethod priority (settings_file > api_key > none) matches the actual authentication priority in executeQuery.

Note: hasApiKey specifically tracks env/in-memory keys and doesn't include settings-based auth, while authenticated covers all sources. This distinction is intentional and clear from the field names.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature by adding support for ~/.claude/settings.json, which improves the user experience for those already using Claude's other tools. The implementation correctly adds the new authentication path to the backend providers, status checks, and the setup UI.

However, there are some critical concerns to address. The current approach of modifying process.env in claude-provider.ts and verify-claude-auth.ts is not safe for concurrent operations, which is a significant risk in a server environment. Additionally, there's a fair amount of duplicated code for reading and parsing the settings.json file across multiple files. Refactoring this into a shared utility would greatly improve maintainability. I've left specific suggestions on these points.

Comment on lines 114 to 142
// Track original environment to restore later
const originalEnv: Record<string, string | undefined> = {};
const envKeysToRestore: string[] = [];

// Load settings from ~/.claude/settings.json
const settingsEnv = await loadClaudeSettings();

// Set environment variables from settings file if available
if (settingsEnv) {
for (const [key, value] of Object.entries(settingsEnv)) {
// Save original value if it exists
if (key in process.env) {
originalEnv[key] = process.env[key];
envKeysToRestore.push(key);
}
// Set the environment variable
process.env[key] = value;
}
}

// If no settings file and no API key env var, try in-memory storage
const hasEnvApiKey = !!process.env.ANTHROPIC_API_KEY;
if (!hasEnvApiKey && !settingsEnv) {
const inMemoryApiKey = getAnthropicApiKey();
if (inMemoryApiKey) {
process.env.ANTHROPIC_API_KEY = inMemoryApiKey;
envKeysToRestore.push('ANTHROPIC_API_KEY');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Modifying the global process.env object is not safe for concurrent execution. If two requests call executeQuery at the same time, one request might use the environment variables set by the other, leading to incorrect authentication or data leakage. This is a critical issue for a server application.

Ideally, the credentials should be passed directly to the SDK's query function if its API supports it. If the SDK strictly relies on environment variables, you might need to consider a different approach, such as using child processes for execution or implementing a mutex/lock to ensure only one executeQuery runs at a time (which would hurt performance).

Comment on lines 142 to 157
} else if (authMethod === 'settings_file') {
// For settings_file verification, read the token from ~/.claude/settings.json
const settingsToken = await getSettingsFileToken();
if (settingsToken) {
process.env.ANTHROPIC_API_KEY = settingsToken;
logger.info('[Setup] Using token from ~/.claude/settings.json for verification');
} else {
res.json({
success: true,
authenticated: false,
error:
'No authentication token found in ~/.claude/settings.json. Please ensure the file exists and contains ANTHROPIC_AUTH_TOKEN in the env section.',
});
return;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Modifying the global process.env object within an API route handler is not safe for concurrent requests. If multiple users trigger this verification endpoint simultaneously with different authentication methods, they could interfere with each other's verification process. This is a critical concurrency issue.

Similar to the issue in claude-provider.ts, the ideal solution is to pass credentials directly to the SDK if possible, rather than relying on global environment variables.

Comment on lines 134 to 142
// If no settings file and no API key env var, try in-memory storage
const hasEnvApiKey = !!process.env.ANTHROPIC_API_KEY;
if (!hasEnvApiKey && !settingsEnv) {
const inMemoryApiKey = getAnthropicApiKey();
if (inMemoryApiKey) {
process.env.ANTHROPIC_API_KEY = inMemoryApiKey;
envKeysToRestore.push('ANTHROPIC_API_KEY');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The logic for falling back to an in-memory API key is incorrect. The condition !hasEnvApiKey && !settingsEnv prevents the fallback if a settings.json file exists but does not contain an API key. This would be unexpected for the user, who would assume the in-memory key would be used if no other key is available. The check should only depend on whether an API key has been found yet.

    // If no API key env var is set yet (from settings or original env), try in-memory storage
    if (!process.env.ANTHROPIC_API_KEY) {
      const inMemoryApiKey = getAnthropicApiKey();
      if (inMemoryApiKey) {
        process.env.ANTHROPIC_API_KEY = inMemoryApiKey;
        envKeysToRestore.push('ANTHROPIC_API_KEY');
      }
    }

Comment on lines 18 to 38
async function checkSettingsFileAuth(): Promise<boolean> {
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
try {
const content = await fs.readFile(settingsPath, 'utf-8');
const settings = JSON.parse(content);

// Check if settings has env with ANTHROPIC_AUTH_TOKEN
if (settings.env?.ANTHROPIC_AUTH_TOKEN) {
return true;
}

// Also check for api_key in settings
if (settings.apiKey || settings.api_key) {
return true;
}

return false;
} catch {
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This function checkSettingsFileAuth is a duplicate of hasClaudeSettingsWithAuth from claude-provider.ts. Duplicating code for reading and validating the settings file can lead to inconsistencies if one is updated and the other is not. This logic should be extracted into a shared utility function that both files can import.

Comment on lines 78 to 98
async function getSettingsFileToken(): Promise<string | null> {
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
try {
const content = await fs.readFile(settingsPath, 'utf-8');
const settings = JSON.parse(content);

// Check if settings has env with ANTHROPIC_AUTH_TOKEN
if (settings.env?.ANTHROPIC_AUTH_TOKEN) {
return settings.env.ANTHROPIC_AUTH_TOKEN;
}

// Also check for api_key in settings
if (settings.apiKey || settings.api_key) {
return settings.apiKey || settings.api_key;
}

return null;
} catch {
return null;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This function getSettingsFileToken duplicates the logic for reading and parsing ~/.claude/settings.json, which is also present in claude-provider.ts and get-claude-status.ts. To improve maintainability and avoid potential bugs from inconsistent implementations, all logic related to handling the settings.json file should be centralized in a single shared utility module.

Comment on lines 60 to 62
} catch {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The empty catch block swallows all errors, including JSON parsing errors or file permission issues. This can make it difficult to debug problems with a user's settings.json file. It's better to log unexpected errors while still returning false.

  } catch (error) {
    // It's fine if the file doesn't exist, but other errors should be logged.
    if (error.code !== 'ENOENT') {
      console.error('Error reading or parsing ~/.claude/settings.json:', error);
    }
    return false;
  }

Comment on lines 190 to 198
if (authMethod === 'cli') {
errorMessage =
"CLI authentication failed. Please run 'claude login' in your terminal to authenticate.";
} else if (authMethod === 'settings_file') {
errorMessage =
'Authentication from ~/.claude/settings.json failed. Please check that ANTHROPIC_AUTH_TOKEN is valid.';
} else {
errorMessage = 'API key is invalid or has been revoked.';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The if/else if chain for setting errorMessage based on authMethod is repeated in several places. This could be refactored into a helper function or a map to reduce duplication and make the code cleaner. For example:

function getAuthErrorMessage(authMethod?: 'cli' | 'api_key' | 'settings_file'): string {
  const errorMessages = {
    cli: "CLI authentication failed. Please run 'claude login' in your terminal to authenticate.",
    settings_file: 'Authentication from ~/.claude/settings.json failed. Please check that ANTHROPIC_AUTH_TOKEN is valid.',
    api_key: 'API key is invalid or has been revoked.',
  };
  return errorMessages[authMethod || 'api_key']; // Default to api_key message
}

// ... later in the code
if (containsAuthError(msgStr)) {
  logger.error('[Setup] Found auth error in message');
  errorMessage = getAuthErrorMessage(authMethod);
  break;
}

Comment on lines +356 to +369
// Helper to get status badge for Settings File
const getSettingsFileStatusBadge = () => {
if (settingsFileVerificationStatus === 'verified') {
return <StatusBadge status="authenticated" label="Verified" />;
}
if (settingsFileVerificationStatus === 'error') {
return <StatusBadge status="error" label="Error" />;
}
if (hasSettingsFileAuth) {
// Settings file has auth but not yet verified - show yellow unverified badge
return <StatusBadge status="unverified" label="Unverified" />;
}
return <StatusBadge status="not_authenticated" label="Not Available" />;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This new helper getSettingsFileStatusBadge is very similar in structure to getCliStatusBadge and getApiKeyStatusBadge. To reduce duplication, you could consider creating a more generic getAuthStatusBadge component or function that takes the verification status and other relevant state as props.

Comment on lines 721 to 829
{/* Option 3: Settings File */}
<AccordionItem value="settings-file" className="border-border">
<AccordionTrigger className="hover:no-underline">
<div className="flex items-center justify-between w-full pr-4">
<div className="flex items-center gap-3">
<File
className={`w-5 h-5 ${
settingsFileVerificationStatus === 'verified'
? 'text-green-500'
: 'text-muted-foreground'
}`}
/>
<div className="text-left">
<p className="font-medium text-foreground">
Settings File (~/.claude/settings.json)
</p>
<p className="text-sm text-muted-foreground">
Use existing Claude Code configuration
</p>
</div>
</div>
{getSettingsFileStatusBadge()}
</div>
</AccordionTrigger>
<AccordionContent className="pt-4 space-y-4">
{/* Settings File Info */}
<div className="space-y-4 p-4 rounded-lg bg-muted/30 border border-border">
<div className="flex items-center gap-2">
<Info className="w-4 h-4 text-muted-foreground" />
<p className="font-medium text-foreground">About Settings File</p>
</div>
<p className="text-sm text-muted-foreground">
If you have Claude Code installed and authenticated, your authentication token
is stored in{' '}
<code className="bg-muted px-2 py-1 rounded">~/.claude/settings.json</code>.
This option will use that token for authentication.
</p>
<p className="text-sm text-muted-foreground">
The settings file should contain{' '}
<code className="bg-muted px-2 py-1 rounded">ANTHROPIC_AUTH_TOKEN</code> in the{' '}
<code className="bg-muted px-2 py-1 rounded">env</code> section.
</p>
</div>

{/* Settings File Verification Status */}
{settingsFileVerificationStatus === 'verifying' && (
<div className="flex items-center gap-3 p-4 rounded-lg bg-blue-500/10 border border-blue-500/20">
<Loader2 className="w-5 h-5 text-blue-500 animate-spin" />
<div>
<p className="font-medium text-foreground">Verifying settings file...</p>
<p className="text-sm text-muted-foreground">
Checking ~/.claude/settings.json
</p>
</div>
</div>
)}

{settingsFileVerificationStatus === 'verified' && (
<div className="flex items-center gap-3 p-4 rounded-lg bg-green-500/10 border border-green-500/20">
<CheckCircle2 className="w-5 h-5 text-green-500" />
<div>
<p className="font-medium text-foreground">
Settings file authentication verified!
</p>
<p className="text-sm text-muted-foreground">
Your token from ~/.claude/settings.json is working correctly.
</p>
</div>
</div>
)}

{settingsFileVerificationStatus === 'error' && settingsFileVerificationError && (
<div className="flex items-start gap-3 p-4 rounded-lg bg-red-500/10 border border-red-500/20">
<XCircle className="w-5 h-5 text-red-500 shrink-0" />
<div className="flex-1">
<p className="font-medium text-foreground">Verification failed</p>
<p className="text-sm text-red-400 mt-1">{settingsFileVerificationError}</p>
</div>
</div>
)}

{/* Settings File Verify Button - Hide if verified */}
{settingsFileVerificationStatus !== 'verified' && (
<Button
onClick={verifySettingsFileAuth}
disabled={settingsFileVerificationStatus === 'verifying'}
className="w-full bg-brand-500 hover:bg-brand-600 text-white"
data-testid="verify-settings-file-button"
>
{settingsFileVerificationStatus === 'verifying' ? (
<>
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
Verifying...
</>
) : settingsFileVerificationStatus === 'error' ? (
<>
<RefreshCw className="w-4 h-4 mr-2" />
Retry Verification
</>
) : (
<>
<ShieldCheck className="w-4 h-4 mr-2" />
Verify Settings File
</>
)}
</Button>
)}
</AccordionContent>
</AccordionItem>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This new AccordionItem for the settings file is quite large and shares a lot of common structure with the other two authentication methods (CLI and API Key). Consider refactoring the AccordionItem and its content into a reusable component, perhaps an AuthMethodAccordionItem, to which you could pass the specific details (icon, title, description, status badge, and content) as props. This would make the main component cleaner and easier to manage.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
apps/server/src/routes/setup/get-claude-status.ts (1)

14-38: Code duplication: Same logic as other files.

This checkSettingsFileAuth() function duplicates the same settings file reading logic already flagged in verify-claude-auth.ts (line 74-98). Please refer to the consolidation suggestion in that file's review.

🧹 Nitpick comments (1)
apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx (1)

356-369: Consider consistent labeling across authentication methods.

Line 368 uses "Not Available" for the settings file, while line 353 uses "Not Set" for the API key. This inconsistency might confuse users. Consider using consistent terminology across all authentication methods, or provide a clear distinction if the different labels are intentional.

🔎 Suggested fix for consistency
-    return <StatusBadge status="not_authenticated" label="Not Available" />;
+    return <StatusBadge status="not_authenticated" label="Not Set" />;
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 629b7e7 and d90147a.

📒 Files selected for processing (5)
  • apps/server/src/providers/claude-provider.ts
  • apps/server/src/providers/types.ts
  • apps/server/src/routes/setup/get-claude-status.ts
  • apps/server/src/routes/setup/routes/verify-claude-auth.ts
  • apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
apps/server/src/providers/claude-provider.ts (1)
apps/server/src/providers/types.ts (1)
  • InstallationStatus (70-79)
🔇 Additional comments (10)
apps/server/src/providers/types.ts (1)

77-77: LGTM! Clean type extension.

The optional authMethod field cleanly extends the authentication metadata without breaking existing code. The union type comprehensively covers all authentication sources introduced by this PR.

apps/server/src/routes/setup/routes/verify-claude-auth.ts (1)

142-156: LGTM! Settings file authentication flow is correctly implemented.

The settings_file authentication branch properly:

  • Reads the token from ~/.claude/settings.json
  • Sets it as ANTHROPIC_API_KEY for the SDK
  • Returns appropriate error messages when the token is missing
apps/server/src/providers/claude-provider.ts (2)

199-207: LGTM! Environment restoration is correctly implemented.

The finally block ensures that environment variables are properly restored even if the query fails, preventing environment pollution across requests.


216-229: LGTM! Authentication detection correctly prioritizes settings file.

The detection logic properly checks both API key sources and settings file authentication, setting the appropriate authMethod based on what's available.

apps/server/src/routes/setup/get-claude-status.ts (1)

127-132: LGTM! Correct prioritization of settings file authentication.

Checking settings file authentication first makes sense because:

  • The Claude Agent SDK directly uses ~/.claude/settings.json
  • It should take precedence over other authentication methods to match SDK behavior
  • The comment clearly documents this priority decision
apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx (5)

30-30: LGTM! Appropriate icon choice.

The File icon is a good visual representation for the settings file authentication option.


69-74: LGTM! Consistent state management.

The settings file verification state follows the same pattern as the existing CLI and API key verification states.


313-314: LGTM! Correct readiness logic.

The settings file verification is properly integrated into the readiness check, allowing users to proceed when any of the three authentication methods is verified.


316-321: LGTM! Clear method labeling.

The authentication method label correctly identifies the settings file option.


721-829: Well-structured UI that follows existing patterns.

The Settings File accordion item is consistent with the CLI and API Key options. The informational content clearly explains where the file is located and what it should contain. The read-only approach (verify only, no creation/editing) is appropriate since users manage this file through Claude Code installation.

Comment on lines 118 to 142
// Load settings from ~/.claude/settings.json
const settingsEnv = await loadClaudeSettings();

// Set environment variables from settings file if available
if (settingsEnv) {
for (const [key, value] of Object.entries(settingsEnv)) {
// Save original value if it exists
if (key in process.env) {
originalEnv[key] = process.env[key];
envKeysToRestore.push(key);
}
// Set the environment variable
process.env[key] = value;
}
}

// If no settings file and no API key env var, try in-memory storage
const hasEnvApiKey = !!process.env.ANTHROPIC_API_KEY;
if (!hasEnvApiKey && !settingsEnv) {
const inMemoryApiKey = getAnthropicApiKey();
if (inMemoryApiKey) {
process.env.ANTHROPIC_API_KEY = inMemoryApiKey;
envKeysToRestore.push('ANTHROPIC_API_KEY');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the actual file to understand the full context
cat -n apps/server/src/providers/claude-provider.ts | head -250

Repository: AutoMaker-Org/automaker

Length of output: 9075


🏁 Script executed:

# Also check if the file exists and get its size
wc -l apps/server/src/providers/claude-provider.ts

Repository: AutoMaker-Org/automaker

Length of output: 115


🏁 Script executed:

# Search for the Options type/interface definition in the codebase
rg -t ts -A 10 "interface\s+Options|type\s+Options" --max-count=20

Repository: AutoMaker-Org/automaker

Length of output: 886


🏁 Script executed:

# Check if there are any existing mutex or synchronization patterns in the codebase
rg -t ts "Mutex|Lock|acquire|release" --max-count=30

Repository: AutoMaker-Org/automaker

Length of output: 3823


🏁 Script executed:

# Look for how executeQuery is called to understand if it's actually concurrent
rg -t ts "executeQuery|executeQuery\(" apps/server/src/providers/ -B 2 -A 2

Repository: AutoMaker-Org/automaker

Length of output: 1228


🏁 Script executed:

# Check if Claude SDK is available and search for Options type definition
find node_modules/@anthropic-ai -name "*.d.ts" -o -name "*.ts" 2>/dev/null | head -20

Repository: AutoMaker-Org/automaker

Length of output: 49


🏁 Script executed:

# Try to find the Options interface definition in node_modules
find node_modules/@anthropic-ai -type f -name "*.d.ts" -exec grep -l "Options" {} \; 2>/dev/null | head -5

Repository: AutoMaker-Org/automaker

Length of output: 49


🏁 Script executed:

# Search for where executeQuery is called/invoked
rg -t ts "executeQuery\(" --max-count=20 -B 2 -A 2

Repository: AutoMaker-Org/automaker

Length of output: 8680


🏁 Script executed:

# Check for concurrent request handling patterns or queuing mechanisms
rg -t ts "Promise\.all|Promise\.race|Promise\.allSettled" apps/server/src/ -B 2 -A 2 --max-count=15

Repository: AutoMaker-Org/automaker

Length of output: 1511


🏁 Script executed:

# Look for any concurrency-related comments or TODOs
rg -t ts "(concurrent|parallel|race|queue|mutex|lock|serialize)" apps/server/src/providers/ -i

Repository: AutoMaker-Org/automaker

Length of output: 299


🏁 Script executed:

# Check package.json for Claude SDK version and see if it's listed as a dependency
cat package.json | grep -A 5 -B 5 "anthropic\|claude" | head -40

Repository: AutoMaker-Org/automaker

Length of output: 49


🏁 Script executed:

# Check if there's a package-lock.json or yarn.lock that might reference the SDK
find . -name "package.json" -type f | xargs grep -l "anthropic" 2>/dev/null | head -5

Repository: AutoMaker-Org/automaker

Length of output: 131


🏁 Script executed:

# Look at agent-service to understand how executeQuery is called
sed -n '1,100p' apps/server/src/services/agent-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 2949


🏁 Script executed:

# Check if there are simultaneous calls to executeQuery in auto-mode-service
grep -n "executeQuery" apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 399


🏁 Script executed:

# Search for test files related to concurrency or parallel execution
find apps/server/tests -name "*.test.ts" | xargs grep -l "concurrent\|parallel" 2>/dev/null

Repository: AutoMaker-Org/automaker

Length of output: 143


🏁 Script executed:

# Look at the auto-mode-service to see the context around executeQuery calls
sed -n '1100,1120p' apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 787


🏁 Script executed:

# Check the context around line 1830
sed -n '1820,1850p' apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 1297


🏁 Script executed:

# Look for the context around line 2047
sed -n '2035,2060p' apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 1232


🏁 Script executed:

# Check if any of these executeQuery calls happen within Promise.all or similar concurrent patterns
grep -n "Promise.all\|Promise.race\|Promise.allSettled" apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 49


🏁 Script executed:

# Check the structure - are executeQuery calls awaited sequentially?
sed -n '2040,2080p' apps/server/src/services/auto-mode-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 2091


🏁 Script executed:

# Check if there are websocket or HTTP handlers that might call executeQuery from different concurrent requests
grep -n "executeQuery\|agentService\|provider.executeQuery" apps/server/src/routes/*.ts apps/server/src/routes/**/*.ts 2>/dev/null | head -40

Repository: AutoMaker-Org/automaker

Length of output: 1596


🏁 Script executed:

# Look at how agent-service methods are called from routes (potential concurrency point)
grep -rn "startConversation\|handleUserMessage" apps/server/src/routes --include="*.ts" | head -20

Repository: AutoMaker-Org/automaker

Length of output: 174


🏁 Script executed:

# Check if there's any concurrency protection in agent-service when handling requests
sed -n '150,300p' apps/server/src/services/agent-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 5481


🏁 Script executed:

# Check for WebSocket or HTTP request handlers that might handle multiple concurrent requests
find apps/server/src/routes -name "*.ts" -type f | xargs grep -l "WebSocket\|ws\|concurrent" 2>/dev/null

Repository: AutoMaker-Org/automaker

Length of output: 946


🏁 Script executed:

# Look for rate limiting, queueing, or concurrency control mechanisms
rg -t ts "queue|Queue|limit|Limit|serial|Serial|concurrency" apps/server/src/ --max-count=20

Repository: AutoMaker-Org/automaker

Length of output: 6170


🏁 Script executed:

# Look at the send.ts route to see how executeQuery is called from HTTP handlers
cat -n apps/server/src/routes/agent/routes/send.ts | head -100

Repository: AutoMaker-Org/automaker

Length of output: 1914


🏁 Script executed:

# Check if there's a single provider instance or multiple
grep -n "ProviderFactory\|getProviderForModel\|new ClaudeProvider" apps/server/src -r --include="*.ts"

Repository: AutoMaker-Org/automaker

Length of output: 1578


🏁 Script executed:

# Look at how multiple concurrent requests could hit executeQuery
sed -n '1,50p' apps/server/src/routes/agent/routes/send.ts

Repository: AutoMaker-Org/automaker

Length of output: 1564


🏁 Script executed:

# Search for the Options type from Claude SDK - check what properties it supports
rg -t ts -A 30 "export.*type.*Options|export.*interface.*Options" apps/server/src --max-count=5

Repository: AutoMaker-Org/automaker

Length of output: 6323


🏁 Script executed:

# Check the actual import and see if we can find SDK type definitions
grep -A 20 "from '@anthropic-ai/claude-agent-sdk'" apps/server/src/providers/claude-provider.ts

Repository: AutoMaker-Org/automaker

Length of output: 759


🏁 Script executed:

# Try to find Claude SDK in package.json to see the version
grep -A 2 -B 2 "claude-agent-sdk\|@anthropic-ai" apps/server/package.json

Repository: AutoMaker-Org/automaker

Length of output: 226


🏁 Script executed:

# Look for any documentation or comments about the Claude SDK Options
rg -t ts "Claude.*Option|SDK.*Option" apps/server/src --max-count=10

Repository: AutoMaker-Org/automaker

Length of output: 598


🏁 Script executed:

# Check if there are concurrent sendMessage calls that could overlap
grep -n "sendMessage\|executeQuery" apps/server/src/services/agent-service.ts | head -20

Repository: AutoMaker-Org/automaker

Length of output: 149


🏁 Script executed:

# Look at the actual session handling to see if there's any serialization
sed -n '290,330p' apps/server/src/services/agent-service.ts

Repository: AutoMaker-Org/automaker

Length of output: 1194


Risk: Global state mutation causes concurrency issues in concurrent request scenarios.

The code modifies process.env directly (lines 122-142) with proper restoration in the finally block (lines 199-207), but this approach has a race condition window when multiple requests execute concurrently:

  • The HTTP /send handler (send.ts) launches agentService.sendMessage() without awaiting it, enabling concurrent background execution
  • Multiple concurrent requests can trigger overlapping executeQuery() calls with process.env mutations
  • Although each request restores its environment, the window between setting env vars and restoring them can cause different concurrent executions to interfere with each other's configurations

Suggested improvements:

  1. Pass environment to SDK directly (requires verification): Check if the Claude Agent SDK (@anthropic-ai/claude-agent-sdk v0.1.72+) accepts environment configuration as an Options parameter instead of mutating process.env.

  2. Add mutex/lock for env mutations: If the SDK doesn't support env config, wrap the environment manipulation in a mutex to serialize access:

import { Mutex } from 'async-mutex';
const envMutex = new Mutex();

async *executeQuery(options: ExecuteOptions) {
  const release = await envMutex.acquire();
  try {
    // ... environment manipulation
  } finally {
    release();
    // ... restore environment
  }
}
  1. Spawn child process for isolation if performance permits.
🤖 Prompt for AI Agents
In apps/server/src/providers/claude-provider.ts around lines 118 to 142, the
code mutates process.env to inject Anthropic settings which creates a race
condition when multiple requests call executeQuery concurrently; replace this
mutation with one of the following fixes: (1) prefer passing the settings
directly to the Claude SDK/agent when creating the client or invoking methods
(check the SDK docs for an options/config parameter) so no global state is
changed; (2) if the SDK has no config parameter, protect the environment
mutation with a mutex/lock so only one execution mutates process.env at a time
(acquire before setting, release after restoring) to serialize access; or (3) if
low contention/strong isolation is required, run the SDK call in a short-lived
child process with the env injected for that process only. Implement the chosen
approach and remove or keep the current process.env mutation only when it is
guarded by the mutex or scoped to a child process to eliminate concurrent
interference.

Comment on lines +251 to +285
// Verify Settings File authentication (uses token from ~/.claude/settings.json)
const verifySettingsFileAuth = useCallback(async () => {
setSettingsFileVerificationStatus('verifying');
setSettingsFileVerificationError(null);

try {
const api = getElectronAPI();
if (!api.setup?.verifyClaudeAuth) {
setSettingsFileVerificationStatus('error');
setSettingsFileVerificationError('Verification API not available');
return;
}

// Pass "settings_file" to verify settings file authentication only
const result = await api.setup.verifyClaudeAuth('settings_file');

if (result.authenticated) {
setSettingsFileVerificationStatus('verified');
setClaudeAuthStatus({
authenticated: true,
method: 'settings_file',
hasCredentialsFile: false,
apiKeyValid: true,
});
toast.success('Settings file authentication verified!');
} else {
setSettingsFileVerificationStatus('error');
setSettingsFileVerificationError(result.error || 'Authentication failed');
}
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Verification failed';
setSettingsFileVerificationStatus('error');
setSettingsFileVerificationError(errorMessage);
}
}, [setClaudeAuthStatus]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for usages of hasCredentialsFile and apiKeyValid

echo "=== Searching for hasCredentialsFile usage ==="
rg -n --type=ts --type=tsx -C3 'hasCredentialsFile' 2>/dev/null | head -100

echo -e "\n=== Searching for apiKeyValid usage ==="
rg -n --type=ts --type=tsx -C3 'apiKeyValid' 2>/dev/null | head -100

echo -e "\n=== Searching for ClaudeAuthStatus type definition ==="
rg -n --type=ts --type=tsx 'ClaudeAuthStatus' 2>/dev/null | head -50

Repository: AutoMaker-Org/automaker

Length of output: 210


🏁 Script executed:

#!/bin/bash
# Broader search without type restrictions

echo "=== Searching for hasCredentialsFile in all files ==="
rg -i 'hasCredentialsFile' 2>/dev/null | head -50

echo -e "\n=== Searching for apiKeyValid in all files ==="
rg -i 'apiKeyValid' 2>/dev/null | head -50

echo -e "\n=== Searching for ClaudeAuthStatus in all files ==="
rg -i 'ClaudeAuthStatus' 2>/dev/null | head -50

echo -e "\n=== Looking at the file containing the function ==="
rg -n 'verifySettingsFileAuth' 2>/dev/null

echo -e "\n=== Searching for setClaudeAuthStatus usage ==="
rg -n 'setClaudeAuthStatus' 2>/dev/null | head -30

Repository: AutoMaker-Org/automaker

Length of output: 10616


🏁 Script executed:

#!/bin/bash
# Get the ClaudeAuthStatus interface definition
echo "=== ClaudeAuthStatus interface definition ==="
rg -A 10 'export interface ClaudeAuthStatus' apps/ui/src/store/setup-store.ts

echo -e "\n=== How hasCredentialsFile is set to true in server ==="
rg -B 5 -A 5 'hasCredentialsFile = true' apps/server/src/routes/setup/get-claude-status.ts

echo -e "\n=== Full context around hasCredentialsFile in server ==="
sed -n '1,100p' apps/server/src/routes/setup/get-claude-status.ts | cat -n

echo -e "\n=== Full context around apiKeyValid in server ==="
rg -B 10 -A 2 'apiKeyValid = true' apps/server/src/routes/setup/get-claude-status.ts | head -50

Repository: AutoMaker-Org/automaker

Length of output: 6197


🏁 Script executed:

#!/bin/bash
# Look at verifySettingsFileAuth and related functions
echo "=== verifySettingsFileAuth and related functions ==="
sed -n '250,290p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

echo -e "\n=== verifyCliAuth function for comparison ==="
sed -n '180,220p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

echo -e "\n=== verifyApiKeyAuth function for comparison ==="
sed -n '220,250p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

echo -e "\n=== Check server code for settings_file method ==="
rg -n "settings_file" apps/server/src/routes/setup/get-claude-status.ts

echo -e "\n=== Check how method field is actually used in UI ==="
rg -B 2 -A 2 "method === 'settings_file'" apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx

Repository: AutoMaker-Org/automaker

Length of output: 5022


🏁 Script executed:

#!/bin/bash
# Look for the Electron/IPC implementation of verifyClaudeAuth
echo "=== Searching for verifyClaudeAuth implementation ==="
rg -n 'verifyClaudeAuth' apps/server/ --type=ts --type=js

echo -e "\n=== Look at the actual verification method in server ==="
rg -B 10 -A 30 "method.*settings_file" apps/server/src/routes/setup/get-claude-status.ts

echo -e "\n=== Full get-claude-status.ts to understand auth methods ==="
wc -l apps/server/src/routes/setup/get-claude-status.ts
</shell>

Repository: AutoMaker-Org/automaker

Length of output: 1965


🏁 Script executed:

#!/bin/bash
# Search more carefully for how verifyClaudeAuth is implemented
echo "=== Looking for setup route handlers ==="
find apps -name "*.ts" -o -name "*.js" | xargs grep -l "verifyClaudeAuth" 2>/dev/null | head -20

echo -e "\n=== Search for API/IPC setup handlers ==="
find apps -type f -name "*setup*" | grep -E "(routes|handlers|ipc)" | head -20

echo -e "\n=== Look at electron.ts for IPC definitions ==="
rg -n "setup\." apps/ui/src/lib/electron.ts | head -30

Repository: AutoMaker-Org/automaker

Length of output: 375


🏁 Script executed:

#!/bin/bash
# Check the electron.ts IPC definitions for setup
echo "=== electron.ts setup definitions ==="
rg -A 20 "setup:" apps/ui/src/lib/electron.ts | head -100

echo -e "\n=== http-api-client.ts verifyClaudeAuth ==="
rg -B 5 -A 20 "verifyClaudeAuth" apps/ui/src/lib/http-api-client.ts

echo -e "\n=== Check the use-api-key-management.ts ==="
rg -B 3 -A 10 "verifyClaudeAuth" apps/ui/src/components/views/settings-view/api-keys/hooks/use-api-key-management.ts

Repository: AutoMaker-Org/automaker

Length of output: 1857


🏁 Script executed:

#!/bin/bash
# Find the actual verify-claude-auth endpoint
echo "=== Search for verify-claude-auth endpoint ==="
find apps/server -type f \( -name "*.ts" -o -name "*.js" \) | xargs grep -l "verify-claude-auth" 2>/dev/null

echo -e "\n=== Look for setup routes in server ==="
find apps/server -path "*/routes/setup*" -type f

echo -e "\n=== Check the main setup route file ==="
find apps/server/src/routes -name "*setup*" -type f
</shell>

Repository: AutoMaker-Org/automaker

Length of output: 1007


🏁 Script executed:

#!/bin/bash
# Read the verify-claude-auth.ts file
echo "=== verify-claude-auth.ts implementation ==="
cat apps/server/src/routes/setup/routes/verify-claude-auth.ts

Repository: AutoMaker-Org/automaker

Length of output: 13973


🏁 Script executed:

#!/bin/bash
# Search for hasSettingsFileAuth usage
echo "=== hasSettingsFileAuth usage ==="
rg -n 'hasSettingsFileAuth' 2>/dev/null

echo -e "\n=== Check what ClaudeAuthMethod includes ==="
rg -B 2 -A 8 'type ClaudeAuthMethod' apps/ui/src/store/setup-store.ts

echo -e "\n=== Look at the full verifySettingsFileAuth context ==="
sed -n '240,295p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

Repository: AutoMaker-Org/automaker

Length of output: 3618


🏁 Script executed:

#!/bin/bash
# Get the complete ClaudeAuthStatus interface
echo "=== Complete ClaudeAuthStatus interface ==="
sed -n '1,100p' apps/ui/src/store/setup-store.ts | cat -n | grep -A 15 "interface ClaudeAuthStatus"

echo -e "\n=== Check if hasSettingsFileAuth is in the interface ==="
rg -A 15 "export interface ClaudeAuthStatus" apps/ui/src/store/setup-store.ts

Repository: AutoMaker-Org/automaker

Length of output: 1060


🏁 Script executed:

#!/bin/bash
# Check all places where method is set to 'settings_file'
echo "=== Places setting method: 'settings_file' ==="
rg -n "method.*settings_file" 2>/dev/null

echo -e "\n=== Check if ClaudeAuthMethod is missing 'settings_file' ==="
rg -A 12 "type ClaudeAuthMethod" apps/ui/src/store/setup-store.ts

echo -e "\n=== See the complete method field usage in verifySettingsFileAuth ==="
sed -n '251,285p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx

Repository: AutoMaker-Org/automaker

Length of output: 2289


🏁 Script executed:

#!/bin/bash
# Check if TypeScript compilation catches these errors
echo "=== Look for tsconfig and type checking setup ==="
find . -name "tsconfig.json" -o -name "vitest.config.ts" -o -name "vite.config.ts" | head -5

echo -e "\n=== Search for any type assertion or @ts-ignore around these lines ==="
sed -n '268,280p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

echo -e "\n=== Check if settings_file should be added to ClaudeAuthMethod type ==="
rg -n "settings_file" apps/server/src/routes/setup/get-claude-status.ts | head -5

echo -e "\n=== Look at the usage of hasSettingsFileAuth in UI ==="
sed -n '305,370p' apps/ui/src/components/views/setup-view/steps/claude-setup-step.tsx | cat -n

Repository: AutoMaker-Org/automaker

Length of output: 4177


Fix type mismatches and undefined field references in settings file authentication.

The verifySettingsFileAuth function has several critical issues:

  1. Invalid method type (line 271): Sets method: 'settings_file', but ClaudeAuthMethod does not include 'settings_file' as a valid option. Valid options are: 'oauth_token_env' | 'oauth_token' | 'api_key_env' | 'api_key' | 'credentials_file' | 'cli_authenticated' | 'none'. This will cause a TypeScript error.

  2. Undefined field reference (line 310): The code accesses claudeAuthStatus?.hasSettingsFileAuth, but this field is not defined in the ClaudeAuthStatus interface. The interface only includes: authenticated, method, hasCredentialsFile, oauthTokenValid, apiKeyValid, hasEnvOAuthToken, hasEnvApiKey, error.

  3. Misleading apiKeyValid flag (line 273): Sets apiKeyValid: true unconditionally, but the settings file can contain either an OAuth token (ANTHROPIC_AUTH_TOKEN) or an API key. The flag should reflect which type of token was actually found, or separate flags should be used.

Add 'settings_file' to the ClaudeAuthMethod type definition, add hasSettingsFileAuth to the ClaudeAuthStatus interface, and update the flag logic to accurately represent the token type found in the settings file.

@Shironex Shironex added Enhancement Improvements to existing functionality or UI. Testers-Requested Request for others to test an enhancement or bug fix/etc. Do Not Merge Use this label if something should not be merged. labels Dec 23, 2025
@webdevcody
Copy link
Collaborator

there are a lot of major and critical reviews found by the ai reviewers. please look through and address the things you think are valid. leave a comment if you think the review is wrong.

@NylonDiamond
Copy link

setup process now have third option to use settings.json file. This is how you can use GLM together with claude code.

Summary by CodeRabbit

  • New Features

    • Added Claude authentication support via settings file (~/.claude/settings.json)
    • New settings file verification option in the setup interface
    • System now identifies and displays which authentication method is active

✏️ Tip: You can customize this high-level summary in your review settings.

@michalCapo is this working for you? I can't seem to get it working with GLM.

@michalCapo
Copy link
Author

michalCapo commented Dec 27, 2025

setup process now have third option to use settings.json file. This is how you can use GLM together with claude code.

Summary by CodeRabbit

  • New Features

    • Added Claude authentication support via settings file (~/.claude/settings.json)
    • New settings file verification option in the setup interface
    • System now identifies and displays which authentication method is active

✏️ Tip: You can customize this high-level summary in your review settings.

@michalCapo is this working for you? I can't seem to get it working with GLM.

Yes, but probably there was an issue. I made changes to this PR and also was overview discrepancies.

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "<your token>",
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "model": "opus"
}

@webdevcody
Copy link
Collaborator

keep branch around, closing to clean up pr queue

@webdevcody webdevcody closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Use this label if something should not be merged. Enhancement Improvements to existing functionality or UI. Testers-Requested Request for others to test an enhancement or bug fix/etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants