From 1ade09eaa3f429c213480d5f50926c9bd1e0e476 Mon Sep 17 00:00:00 2001 From: zmeir Date: Thu, 4 Jan 2024 14:49:34 +0200 Subject: [PATCH] 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' ``` --- pr_agent/tools/pr_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_config.py b/pr_agent/tools/pr_config.py index 44ab7e23..1d18f9d0 100644 --- a/pr_agent/tools/pr_config.py +++ b/pr_agent/tools/pr_config.py @@ -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.