24
24
from tools .commands import RunShellCommandTool
25
25
from tools .patch_validator import PatchValidatorTool
26
26
from tools .version_mapper import VersionMapperTool
27
- from utils import get_agent_execution_config , mcp_tools , redis_client , post_private_jira_comment
27
+ from utils import fix_await , get_agent_execution_config , mcp_tools , redis_client , post_private_jira_comment
28
28
29
29
logger = logging .getLogger (__name__ )
30
30
@@ -303,7 +303,7 @@ class Task(BaseModel):
303
303
304
304
while True :
305
305
logger .info ("Waiting for tasks from triage_queue (timeout: 30s)..." )
306
- element = await redis .brpop ("triage_queue" , timeout = 30 )
306
+ element = await fix_await ( redis .brpop ([ "triage_queue" ] , timeout = 30 ) )
307
307
if element is None :
308
308
logger .info ("No tasks received, continuing to wait..." )
309
309
continue
@@ -322,12 +322,12 @@ async def retry(task, error):
322
322
f"Task failed (attempt { task .attempts } /{ max_retries } ), "
323
323
f"re-queuing for retry: { input .issue } "
324
324
)
325
- await redis .lpush ("triage_queue" , task .model_dump_json ())
325
+ await fix_await ( redis .lpush ("triage_queue" , task .model_dump_json () ))
326
326
else :
327
327
logger .error (
328
328
f"Task failed after { max_retries } attempts, " f"moving to error list: { input .issue } "
329
329
)
330
- await redis .lpush ("error_list" , error )
330
+ await fix_await ( redis .lpush ("error_list" , error ) )
331
331
332
332
try :
333
333
logger .info (f"Starting triage processing for { input .issue } " )
@@ -353,21 +353,21 @@ async def retry(task, error):
353
353
if output .resolution == Resolution .REBASE :
354
354
logger .info (f"Triage resolved as REBASE for { input .issue } , " f"adding to rebase queue" )
355
355
task = Task (metadata = output .data .model_dump ())
356
- await redis .lpush ("rebase_queue" , task .model_dump_json ())
356
+ await fix_await ( redis .lpush ("rebase_queue" , task .model_dump_json () ))
357
357
elif output .resolution == Resolution .BACKPORT :
358
358
logger .info (f"Triage resolved as BACKPORT for { input .issue } , " f"adding to backport queue" )
359
359
task = Task (metadata = output .data .model_dump ())
360
- await redis .lpush ("backport_queue" , task .model_dump_json ())
360
+ await fix_await ( redis .lpush ("backport_queue" , task .model_dump_json () ))
361
361
elif output .resolution == Resolution .CLARIFICATION_NEEDED :
362
362
logger .info (
363
363
f"Triage resolved as CLARIFICATION_NEEDED for { input .issue } , "
364
364
f"adding to clarification needed queue"
365
365
)
366
366
task = Task (metadata = output .data .model_dump ())
367
- await redis .lpush ("clarification_needed_queue" , task .model_dump_json ())
367
+ await fix_await ( redis .lpush ("clarification_needed_queue" , task .model_dump_json () ))
368
368
elif output .resolution == Resolution .NO_ACTION :
369
369
logger .info (f"Triage resolved as NO_ACTION for { input .issue } , " f"adding to no action list" )
370
- await redis .lpush ("no_action_list" , output .data .model_dump_json ())
370
+ await fix_await ( redis .lpush ("no_action_list" , output .data .model_dump_json () ))
371
371
elif output .resolution == Resolution .ERROR :
372
372
logger .warning (f"Triage resolved as ERROR for { input .issue } , retrying" )
373
373
await retry (task , output .data .model_dump_json ())
0 commit comments