Skip to content

Adding error output to terminal in the case of missing LLM API Key  #76

@denizbt

Description

@denizbt

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.
Screenshot 2024-10-21 at 15 48 09

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions