Skip to content

[Bug]: Startup warning ignores Claude OAuth credentials #721

@JasonBroderick

Description

@JasonBroderick

Operating System

Linux (WSL2)

Run Mode

Docker

App Version

v0.14.0rc

Bug Description

When running Automaker via Docker with Claude OAuth credentials mounted (from ~/.claude/.credentials.json), the server startup still shows:

WARN  [Server]
╔═════════════════════════════════════════════════════════════════════╗
║  ⚠️  WARNING: No Claude authentication configured                   ║
╠═════════════════════════════════════════════════════════════════════╣
║                                                                     ║
║  The Claude Agent SDK requires authentication to function.          ║
║                                                                     ║
║  Set your Anthropic API key:                                        ║
║    export ANTHROPIC_API_KEY="sk-ant-..."                            ║
║                                                                     ║
║  Or use the setup wizard in Settings to configure authentication.   ║
║                                                                     ║
╚═════════════════════════════════════════════════════════════════════╝

This warning appears even though OAuth credentials are properly mounted and accessible inside the container.

Root Cause

The startup check in apps/server/src/index.ts:121-148 only checks for ANTHROPIC_API_KEY environment variable:

const hasAnthropicKey = !!process.env.ANTHROPIC_API_KEY;

if (!hasAnthropicKey) {
  // Shows warning
}

However, the getClaudeStatus() function in apps/server/src/routes/setup/get-claude-status.ts:102-172 has comprehensive OAuth detection logic that:

  • Checks for .credentials.json with OAuth tokens via getClaudeAuthIndicators()
  • Detects CLI authentication indicators
  • Checks for recent activity

The startup warning should use the same detection logic (or a simplified sync version) to also detect OAuth credentials before displaying the warning.

Steps to Reproduce

  1. Authenticate with Claude CLI (claude login) on host
  2. Configure docker-compose.override.yml to mount ~/.claude directory
  3. Run docker-compose up
  4. Observe the warning despite OAuth credentials being available

Expected Behavior

The startup check should detect OAuth credentials from ~/.claude/.credentials.json and NOT show the warning when valid OAuth credentials are present.

Actual Behavior

Warning is always shown when ANTHROPIC_API_KEY is not set, even if OAuth credentials are configured.

Suggested Fix

The startup check should call getClaudeAuthIndicators() from @automaker/platform (or a simplified sync check) to detect OAuth credentials. Something like:

import { getClaudeAuthIndicators } from '@automaker/platform';

// At startup
const hasAnthropicKey = !!process.env.ANTHROPIC_API_KEY;
const indicators = await getClaudeAuthIndicators();
const hasOAuth = indicators.hasCredentialsFile && indicators.credentials?.hasOAuthToken;

if (!hasAnthropicKey && !hasOAuth) {
  // Show warning
} else if (hasOAuth && !hasAnthropicKey) {
  logger.info('✓ Claude OAuth credentials detected');
}

Screenshots

No response

Relevant Logs

automaker-server  | WARN  [Server]
automaker-server  | ╔═════════════════════════════════════════════════════════════════════╗
automaker-server  | ║  ⚠️  WARNING: No Claude authentication configured                   ║
...

Additional Context

The OAuth credentials are accessible inside the container (verified with ls -la showing .credentials.json).

Checklist

  • I have searched existing issues to ensure this bug hasn't been reported already
  • I have provided all required information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions