mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
Fix function to return an empty list instead of a single joined string when patches_extended is empty.
This commit is contained in:
@ -70,7 +70,10 @@ def get_pr_diff(git_provider: GitProvider, token_handler: TokenHandler,
|
|||||||
if total_tokens + OUTPUT_BUFFER_TOKENS_SOFT_THRESHOLD < get_max_tokens(model):
|
if total_tokens + OUTPUT_BUFFER_TOKENS_SOFT_THRESHOLD < get_max_tokens(model):
|
||||||
get_logger().info(f"Tokens: {total_tokens}, total tokens under limit: {get_max_tokens(model)}, "
|
get_logger().info(f"Tokens: {total_tokens}, total tokens under limit: {get_max_tokens(model)}, "
|
||||||
f"returning full diff.")
|
f"returning full diff.")
|
||||||
return "\n".join(patches_extended)
|
if patches_extended :
|
||||||
|
return ["\n".join(patches_extended)]
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
# if we are over the limit, start pruning
|
# if we are over the limit, start pruning
|
||||||
get_logger().info(f"Tokens: {total_tokens}, total tokens over limit: {get_max_tokens(model)}, "
|
get_logger().info(f"Tokens: {total_tokens}, total tokens over limit: {get_max_tokens(model)}, "
|
||||||
|
Reference in New Issue
Block a user