Fix failing /config command

All commands need the `ai_handler` argument. The PRConfig class was missing it in the `__init__` method and so it failed with this error:

```
File "/home/vcap/app/pr_agent/agent/pr_agent.py", line 76, in handle_request
    await command2class[action](pr_url, ai_handler=self.ai_handler, args=args).run()
TypeError: PRConfig.__init__() got an unexpected keyword argument 'ai_handler'
```
This commit is contained in:
zmeir
2024-01-04 14:49:34 +02:00
parent b7af45166a
commit 1ade09eaa3

View File

@ -7,7 +7,7 @@ class PRConfig:
"""
The PRConfig class is responsible for listing all configuration options available for the user.
"""
def __init__(self, pr_url: str, args=None):
def __init__(self, pr_url: str, args=None, ai_handler=None):
"""
Initialize the PRConfig object with the necessary attributes and objects to comment on a pull request.