Adding error output to terminal in the case of missing LLM API Key
denizbt opened this issue · 2 comments
I noticed that the default behavior foragent config aider is to generate a config file .agent.yaml with parameter model_name: claude-3-5-sonnet-20240620. So, if a user does not set the environment variable with export ANTHROPIC_API_KEY="...", the commit0 agent is not able to write any code. The error code for the missing API key is written to the .aider.log files, however it is not printed to the terminal. Therefore, for a new commit0 user, it is unclear why aider is not working.
This is commit0's current terminal output when you call agent run BRANCH without having set the API key variable.

I would suggest adding a descriptive error output in the case API key for the specified agent's LLM is missing. The description should direct the user to the yaml file, and advise that they must change the model name and export the API key. Something like this would be instructive:
API Key Error: There is no API key associated with the model for this agent. Edit model_name parameter in .agent.yaml, export API key for that model, and try again.
@nanjiangwill can you work on a solution for this?
fixed, will push soon