Skip to content

Add error handling for missing API keys on startup #16

@thegreatalxx

Description

@thegreatalxx

Summary

When Conductor starts up with a missing or invalid API key (e.g. for Claude, OpenAI, Gemini), the error message can be cryptic or buried in a stack trace. New users frequently get stuck at this step. A clear, friendly error at startup would significantly improve the onboarding experience.

What to build

In src/core/Conductor.ts (or wherever the AI provider is initialized), add a check that:

  1. Detects when the configured API key is missing or empty
    1. Prints a clear, human-readable error message explaining what's wrong
    1. Points the user to the fix: conductor ai setup
      Example of what it should look like:
✗ Missing API key for Claude.
  Run: conductor ai setup → choose your provider and enter your key.
  Or set ANTHROPIC_API_KEY in your environment.

Where to look

  • src/core/Conductor.ts — main initialization
    • src/ai/ — provider implementations (ClaudeProvider, OpenAIProvider, etc.)
      • Each provider's test() method already validates the connection — the startup check could call test() early and catch failures gracefully

Why it's a good first issue

  • Isolated change — only touches startup/init logic
    • No new dependencies needed
      • Improves DX for every new user of the project
        • Good way to learn how the AI provider layer works

Acceptance criteria

  • Starting conductor with no API key shows a clear error message (not a raw stack trace)
    • Message includes the command to fix it (conductor ai setup)
      • Works for all supported providers (Claude, OpenAI, Gemini, Ollama, OpenRouter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions