From b334bcd25099c5a782ab13751710631339cdd53c Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 12 May 2025 16:54:28 +0300 Subject: [PATCH 1/4] docs: enhance improve.md with manual suggestions for Bitbucket and GitLab --- docs/docs/tools/improve.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index aa0c051f..2777a6d5 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -20,6 +20,7 @@ ___ !!! note "The following features are available only for Qodo Merge 💎 users:" - The `Apply / Chat` checkbox, which interactively converts a suggestion into a committable code comment - The `More` checkbox to generate additional suggestions + - On Bitbucket (Cloud & Data Center) and GitLab Server (v16 and earlier), you can invoke [More Suggestions manually](#manual-more-suggestions) ## Example usage @@ -44,6 +45,13 @@ For example, you can choose to present all the suggestions as committable code c As can be seen, a single table comment has a significantly smaller PR footprint. We recommend this mode for most cases. Also note that collapsible are not supported in _Bitbucket_. Hence, the suggestions can only be presented in Bitbucket as code comments. +#### Manual more suggestions +To generate more suggestions (distinct from the ones already generated), for git-providers that don't support interactive checkbox option, you can manually run: + +``` +/improve --more_suggestions=true +``` + ### Automatic triggering To run the `improve` automatically when a PR is opened, define in a [configuration file](https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/#wiki-configuration-file): From e7317ce99f95e2a743cc5867318ab67ee9ecf8d9 Mon Sep 17 00:00:00 2001 From: dst03106 Date: Tue, 13 May 2025 14:46:50 +0900 Subject: [PATCH 2/4] Add timeout to asyncio.wait --- pr_agent/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index ef161437..13058971 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -86,7 +86,9 @@ def run(inargs=None, args=None): if get_settings().litellm.get("enable_callbacks", False): # There may be additional events on the event queue from the run above. If there are give them time to complete. get_logger().debug("Waiting for event queue to complete") - await asyncio.wait([task for task in asyncio.all_tasks() if task is not asyncio.current_task()]) + tasks = [task for task in asyncio.all_tasks() if task is not asyncio.current_task()] + if tasks: + await asyncio.wait(tasks, timeout=30) return result From d86d1ef3dc072523dbac29ef62e5e8c26db1d14e Mon Sep 17 00:00:00 2001 From: Yunhui Chae <53514545+dst03106@users.noreply.github.com> Date: Tue, 13 May 2025 17:34:30 +0900 Subject: [PATCH 3/4] Log a warning when there are pending asyncio tasks Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com> --- pr_agent/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index 13058971..64ea5199 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -88,7 +88,9 @@ def run(inargs=None, args=None): get_logger().debug("Waiting for event queue to complete") tasks = [task for task in asyncio.all_tasks() if task is not asyncio.current_task()] if tasks: - await asyncio.wait(tasks, timeout=30) + done, pending = await asyncio.wait(tasks, timeout=30) + if pending: + get_logger().warning(f"{len(pending)} callback tasks did not complete within timeout") return result From e2af22d2a00504d2f67de2cf3fe45276c336114d Mon Sep 17 00:00:00 2001 From: dst03106 Date: Tue, 13 May 2025 17:37:09 +0900 Subject: [PATCH 4/4] Log a warning for pending asyncio tasks with coroutine details --- pr_agent/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index 64ea5199..a741a0b8 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -88,9 +88,11 @@ def run(inargs=None, args=None): get_logger().debug("Waiting for event queue to complete") tasks = [task for task in asyncio.all_tasks() if task is not asyncio.current_task()] if tasks: - done, pending = await asyncio.wait(tasks, timeout=30) + _, pending = await asyncio.wait(tasks, timeout=30) if pending: - get_logger().warning(f"{len(pending)} callback tasks did not complete within timeout") + get_logger().warning( + f"{len(pending)} callback tasks({[task.get_coro() for task in pending]}) did not complete within timeout" + ) return result