fix: improve auth status display and remove verbose console logging

- Fix authentication status display in settings showing "Method: Unknown"
  - Add support for CLAUDE_CODE_OAUTH_TOKEN environment variable
  - Update ClaudeAuthStatus type to include all auth methods
  - Fix method mapping in use-cli-status hook
  - Display correct auth method labels in UI

- Remove verbose console logging from:
  - claude-cli-detector.js
  - codex-cli-detector.js
  - agent-service.js
  - main.js (IPC, Security logs)

- Fix TypeScript errors:
  - Add proper type exports for AutoModeEvent
  - Fix Project import paths
  - Add null checks for api.features
  - Add openExternalLink to ElectronAPI type
  - Add type annotation for REQUIRED_STRUCTURE

- Update README with clearer getting started guide

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
SuperComboGamer
2025-12-10 22:28:27 -05:00
parent 41f14167a6
commit d474208e8b
16 changed files with 232 additions and 419 deletions

View File

@@ -764,7 +764,13 @@ ${Object.entries(projectAnalysis.filesByExtension)
}
for (const feature of detectedFeatures) {
await api.features.create(currentProject.path, feature);
await api.features.create(currentProject.path, {
id: crypto.randomUUID(),
category: feature.category,
description: feature.description,
steps: feature.steps,
status: "backlog",
});
}
setFeatureListGenerated(true);

View File

@@ -317,7 +317,7 @@ export function InterviewView() {
id: `feature-${Date.now()}-0`,
category: "Core",
description: "Initial project setup",
status: "backlog",
status: "backlog" as const,
steps: [
"Step 1: Review app_spec.txt",
"Step 2: Set up development environment",
@@ -325,7 +325,9 @@ export function InterviewView() {
],
skipTests: true,
};
await api.features.create(fullProjectPath, initialFeature);
if (api.features) {
await api.features.create(fullProjectPath, initialFeature);
}
const project = {
id: `project-${Date.now()}`,

View File

@@ -53,41 +53,22 @@ export function AuthenticationStatusDisplay({
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-muted-foreground">
Method:{" "}
<span className="font-mono text-foreground">
{claudeAuthStatus.method === "oauth"
? "OAuth Token"
: claudeAuthStatus.method === "api_key"
? "API Key"
: "Unknown"}
</span>
<span className="text-green-400 font-medium">Authenticated</span>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<Info className="w-3 h-3 shrink-0" />
<span>
{claudeAuthStatus.method === "oauth_token_env"
? "Using CLAUDE_CODE_OAUTH_TOKEN"
: claudeAuthStatus.method === "oauth_token"
? "Using stored OAuth token"
: claudeAuthStatus.method === "api_key_env"
? "Using ANTHROPIC_API_KEY"
: claudeAuthStatus.method === "api_key"
? "Using stored API key"
: "Unknown method"}
</span>
</div>
{claudeAuthStatus.oauthTokenValid && (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>OAuth token configured</span>
</div>
)}
{claudeAuthStatus.apiKeyValid && (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>API key configured</span>
</div>
)}
{apiKeyStatus?.hasAnthropicKey && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Environment variable detected</span>
</div>
)}
{apiKeys.anthropic && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Manual API key in settings</span>
</div>
)}
</>
) : apiKeyStatus?.hasAnthropicKey ? (
<div className="flex items-center gap-2 text-blue-400">
@@ -100,9 +81,9 @@ export function AuthenticationStatusDisplay({
<span>Using manual API key from settings</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
<div className="flex items-center gap-1.5 text-yellow-500 py-0.5">
<AlertCircle className="w-3 h-3 shrink-0" />
<span className="text-xs">Not configured</span>
</div>
)}
</div>
@@ -121,44 +102,21 @@ export function AuthenticationStatusDisplay({
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-muted-foreground">
Method:{" "}
<span className="font-mono text-foreground">
{codexAuthStatus.method === "cli_verified" ||
codexAuthStatus.method === "cli_tokens"
? "CLI Login (OpenAI Account)"
: codexAuthStatus.method === "api_key"
? "API Key (Auth File)"
: codexAuthStatus.method === "env"
? "API Key (Environment)"
: "Unknown"}
</span>
<span className="text-green-400 font-medium">Authenticated</span>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<Info className="w-3 h-3 shrink-0" />
<span>
{codexAuthStatus.method === "cli_verified" ||
codexAuthStatus.method === "cli_tokens"
? "Using CLI login (OpenAI account)"
: codexAuthStatus.method === "api_key"
? "Using stored API key"
: codexAuthStatus.method === "env"
? "Using OPENAI_API_KEY"
: "Unknown method"}
</span>
</div>
{codexAuthStatus.method === "cli_verified" ||
codexAuthStatus.method === "cli_tokens" ? (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>Account authenticated</span>
</div>
) : codexAuthStatus.apiKeyValid ? (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>API key configured</span>
</div>
) : null}
{apiKeyStatus?.hasOpenAIKey && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Environment variable detected</span>
</div>
)}
{apiKeys.openai && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Manual API key in settings</span>
</div>
)}
</>
) : apiKeyStatus?.hasOpenAIKey ? (
<div className="flex items-center gap-2 text-blue-400">
@@ -171,9 +129,9 @@ export function AuthenticationStatusDisplay({
<span>Using manual API key from settings</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
<div className="flex items-center gap-1.5 text-yellow-500 py-0.5">
<AlertCircle className="w-3 h-3 shrink-0" />
<span className="text-xs">Not configured</span>
</div>
)}
</div>
@@ -189,19 +147,31 @@ export function AuthenticationStatusDisplay({
</div>
<div className="space-y-1.5 text-xs min-h-12">
{apiKeyStatus?.hasGoogleKey ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using environment variable (GOOGLE_API_KEY)</span>
</div>
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-green-400 font-medium">Authenticated</span>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<Info className="w-3 h-3 shrink-0" />
<span>Using GOOGLE_API_KEY</span>
</div>
</>
) : apiKeys.google ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using manual API key from settings</span>
</div>
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-green-400 font-medium">Authenticated</span>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<Info className="w-3 h-3 shrink-0" />
<span>Using stored API key</span>
</div>
</>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
<div className="flex items-center gap-1.5 text-yellow-500 py-0.5">
<AlertCircle className="w-3 h-3 shrink-0" />
<span className="text-xs">Not configured</span>
</div>
)}
</div>

View File

@@ -8,7 +8,7 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import type { Project } from "@/store/app-store";
import type { Project } from "@/lib/electron";
interface DeleteProjectDialogProps {
open: boolean;

View File

@@ -1,5 +1,5 @@
import { cn } from "@/lib/utils";
import type { Project } from "@/store/app-store";
import type { Project } from "@/lib/electron";
import type { NavigationItem } from "../config/navigation";
interface SettingsNavigationProps {

View File

@@ -69,17 +69,22 @@ export function useCliStatus() {
const result = await api.setup.getClaudeStatus();
if (result.success && result.auth) {
const auth = result.auth;
// Map the method directly from detector
const methodMap: Record<string, "oauth_token_env" | "oauth_token" | "api_key" | "api_key_env" | "none"> = {
oauth_token_env: "oauth_token_env",
oauth_token: "oauth_token",
api_key: "api_key",
api_key_env: "api_key_env",
none: "none",
};
const authStatus = {
authenticated: auth.authenticated,
method:
auth.method === "oauth_token"
? ("oauth" as const)
: auth.method?.includes("api_key")
? ("api_key" as const)
: ("none" as const),
method: methodMap[auth.method] || "none",
hasCredentialsFile: auth.hasCredentialsFile ?? false,
oauthTokenValid: auth.hasStoredOAuthToken,
oauthTokenValid: auth.hasStoredOAuthToken || auth.hasEnvOAuthToken,
apiKeyValid: auth.hasStoredApiKey || auth.hasEnvApiKey,
hasEnvOAuthToken: auth.hasEnvOAuthToken,
hasEnvApiKey: auth.hasEnvApiKey,
};
setClaudeAuthStatus(authStatus);
}

View File

@@ -233,19 +233,23 @@ function ClaudeSetupStep({
setClaudeCliStatus(cliStatus);
if (result.auth) {
const methodMap: Record<string, "oauth_token_env" | "oauth_token" | "api_key" | "api_key_env" | "none"> = {
oauth_token_env: "oauth_token_env",
oauth_token: "oauth_token",
api_key: "api_key",
api_key_env: "api_key_env",
none: "none",
};
const authStatus = {
authenticated: result.auth.authenticated,
method: result.auth.method === "oauth_token"
? "oauth"
: result.auth.method?.includes("api_key")
? "api_key"
: "none",
method: methodMap[result.auth.method] || "none",
hasCredentialsFile: false,
oauthTokenValid: result.auth.hasStoredOAuthToken,
oauthTokenValid: result.auth.hasStoredOAuthToken || result.auth.hasEnvOAuthToken,
apiKeyValid: result.auth.hasStoredApiKey || result.auth.hasEnvApiKey,
hasEnvOAuthToken: result.auth.hasEnvOAuthToken,
hasEnvApiKey: result.auth.hasEnvApiKey,
};
console.log("[Claude Setup] Auth Status:", authStatus);
setClaudeAuthStatus(authStatus as any);
setClaudeAuthStatus(authStatus);
}
}
}
@@ -355,7 +359,7 @@ function ClaudeSetupStep({
if (result.success) {
setClaudeAuthStatus({
authenticated: true,
method: "oauth",
method: "oauth_token",
hasCredentialsFile: false,
oauthTokenValid: true,
});
@@ -433,8 +437,8 @@ function ClaudeSetupStep({
const getAuthMethodLabel = () => {
if (!isAuthenticated) return null;
if (claudeAuthStatus?.method === "oauth") return "Subscription Token";
if (apiKeys.anthropic || claudeAuthStatus?.method === "api_key") return "API Key";
if (claudeAuthStatus?.method === "oauth_token_env" || claudeAuthStatus?.method === "oauth_token") return "Subscription Token";
if (apiKeys.anthropic || claudeAuthStatus?.method === "api_key" || claudeAuthStatus?.method === "api_key_env") return "API Key";
return "Authenticated";
};

View File

@@ -41,8 +41,22 @@ export interface StatResult {
error?: string;
}
// Auto Mode types - Import from electron.d.ts to avoid duplication
// Auto Mode types - Import from electron.d.ts for internal use
import type {
AutoModeEvent as AutoModeEventType,
ModelDefinition as ModelDefinitionType,
ProviderStatus as ProviderStatusType,
WorktreeAPI as WorktreeAPIType,
GitAPI as GitAPIType,
WorktreeInfo as WorktreeInfoType,
WorktreeStatus as WorktreeStatusType,
FileDiffsResult as FileDiffsResultType,
FileDiffResult as FileDiffResultType,
FileStatus as FileStatusType,
} from "@/types/electron";
// Re-export types for external use
export type {
AutoModeEvent,
ModelDefinition,
ProviderStatus,
@@ -55,6 +69,18 @@ import type {
FileStatus,
} from "@/types/electron";
// Type aliases for internal use
type AutoModeEvent = AutoModeEventType;
type ModelDefinition = ModelDefinitionType;
type ProviderStatus = ProviderStatusType;
type WorktreeAPI = WorktreeAPIType;
type GitAPI = GitAPIType;
type WorktreeInfo = WorktreeInfoType;
type WorktreeStatus = WorktreeStatusType;
type FileDiffsResult = FileDiffsResultType;
type FileDiffResult = FileDiffResultType;
type FileStatus = FileStatusType;
// Feature type - Import from app-store
import type { Feature } from "@/store/app-store";
@@ -308,17 +334,19 @@ export interface ElectronAPI {
getClaudeStatus: () => Promise<{
success: boolean;
status?: string;
installed?: boolean;
method?: string;
version?: string;
path?: string;
auth?: {
authenticated: boolean;
method: string;
hasCredentialsFile: boolean;
hasToken: boolean;
hasCredentialsFile?: boolean;
hasToken?: boolean;
hasStoredOAuthToken?: boolean;
hasStoredApiKey?: boolean;
hasEnvApiKey?: boolean;
hasEnvOAuthToken?: boolean;
};
error?: string;
}>;

View File

@@ -19,7 +19,10 @@ export interface ProjectInitResult {
* Required files and directories in the .automaker directory
* Note: app_spec.txt is NOT created automatically - user must set it up via the spec editor
*/
const REQUIRED_STRUCTURE = {
const REQUIRED_STRUCTURE: {
directories: string[];
files: Record<string, string>;
} = {
directories: [
".automaker",
".automaker/context",

View File

@@ -13,10 +13,12 @@ export interface CliStatus {
// Claude Auth Status
export interface ClaudeAuthStatus {
authenticated: boolean;
method: "oauth" | "api_key" | "none";
hasCredentialsFile: boolean;
method: "oauth_token_env" | "oauth_token" | "api_key" | "api_key_env" | "none";
hasCredentialsFile?: boolean;
oauthTokenValid?: boolean;
apiKeyValid?: boolean;
hasEnvOAuthToken?: boolean;
hasEnvApiKey?: boolean;
error?: string;
}

View File

@@ -345,6 +345,7 @@ export interface AutoModeAPI {
export interface ElectronAPI {
ping: () => Promise<string>;
openExternalLink: (url: string) => Promise<{ success: boolean; error?: string }>;
// Dialog APIs
openDirectory: () => Promise<{