Suggest CLI providers when API key is missing#91
Conversation
When no API key is configured, the error message now hints that users can use --provider claude-cli or --provider codex-cli to run without an API key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR improves the developer experience when running Key observations:
Confidence Score: 5/5Safe to merge — the change only extends an error message string and has no impact on runtime behavior or control flow The diff touches only two string literals inside the error path of resolve_api_key_with_source(). The Rust line-continuation escapes are used correctly, CLI providers are properly excluded from this code path both in create_provider() and in preflight.rs, and no logic, data structures, or public API contracts are altered. No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[create_provider called] --> B{provider == claude-cli\nor codex-cli?}
B -- Yes --> C[Return CLI provider\nno API key needed]
B -- No --> D[resolve_api_key called]
D --> E{explicit_key\nnon-empty?}
E -- Yes --> F[Return explicit key]
E -- No --> G{provider_env\nvar set?}
G -- Yes --> H[Return env key]
G -- No --> I{LLM_API_KEY\nset?}
I -- Yes --> J[Return LLM_API_KEY]
I -- No --> K[Build error hint]
K --> L{provider_env\nempty?}
L -- Yes --> M["No API key found...\nTip: use --provider claude-cli or --provider codex-cli"]
L -- No --> N["No API key found... {provider_env}\nTip: use --provider claude-cli or --provider codex-cli"]
M --> O[Err AppError::Config]
N --> O
Reviews (1): Last reviewed commit: "improve: suggest CLI providers when API ..." | Re-trigger Greptile |
Apply rustfmt to orchestration.rs and increase timeout for the flaky send_request_cleans_up_request_and_response_files test from 10s to 30s to handle slow CI runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
--provider claude-clior--provider codex-clias alternatives that don't require an API keyresolve_api_key_with_source()Test plan
desktest run task.jsonwithout any API key set and verify the tip appearsdesktest run task.json --provider claude-cliand verify no API key error🤖 Generated with Claude Code