Problem
NewClient's default branch silently sets client.provider = "openai" when no provider is specified. A brand-new user who never ran config init then hits 'OpenAI API key not configured (or run clanker auth login for OAuth)' — an OpenAI-specific error for a provider they never chose, with no hint that nothing is configured and that clanker config init is the fix. This is a UX/error-message quality issue, not a functional defect.
Where
internal/ai/client.go:574-578
internal/ai/client.go:1219
Root cause
The 'no provider selected' state is collapsed into provider=openai at construction, so downstream errors cannot distinguish 'OpenAI chosen, key missing' from 'nothing configured at all'.
How to fix
Detect the genuinely-unconfigured case (no provider and no keys in viper/env) and emit a first-run-aware message naming clanker config init, reusing the actionable 'Set ... in ~/.clanker.yaml' phrasing of other provider errors.
Acceptance criteria
clanker ask with a fresh empty config prints a message naming clanker config init; choosing OpenAI explicitly but omitting the key still prints the OpenAI-specific message.
Severity: low · from holistic hardening review.
Problem
NewClient's default branch silently sets client.provider = "openai" when no provider is specified. A brand-new user who never ran config init then hits 'OpenAI API key not configured (or run clanker auth login for OAuth)' — an OpenAI-specific error for a provider they never chose, with no hint that nothing is configured and that clanker config init is the fix. This is a UX/error-message quality issue, not a functional defect.
Where
internal/ai/client.go:574-578internal/ai/client.go:1219Root cause
The 'no provider selected' state is collapsed into provider=openai at construction, so downstream errors cannot distinguish 'OpenAI chosen, key missing' from 'nothing configured at all'.
How to fix
Detect the genuinely-unconfigured case (no provider and no keys in viper/env) and emit a first-run-aware message naming clanker config init, reusing the actionable 'Set ... in ~/.clanker.yaml' phrasing of other provider errors.
Acceptance criteria
clanker ask with a fresh empty config prints a message naming clanker config init; choosing OpenAI explicitly but omitting the key still prints the OpenAI-specific message.
Severity: low · from holistic hardening review.