23
23
from observability import setup_observability
24
24
from tools .commands import RunShellCommandTool
25
25
from tools .patch_validator import PatchValidatorTool
26
- from utils import get_agent_execution_config , mcp_tools , redis_client
26
+ from utils import fixAwait , get_agent_execution_config , mcp_tools , redis_client
27
27
28
28
logger = logging .getLogger (__name__ )
29
29
@@ -285,7 +285,7 @@ class Task(BaseModel):
285
285
286
286
while True :
287
287
logger .info ("Waiting for tasks from triage_queue (timeout: 30s)..." )
288
- element = await redis .brpop ("triage_queue" , timeout = 30 )
288
+ element = await fixAwait ( redis .brpop ([ "triage_queue" ] , timeout = 30 ) )
289
289
if element is None :
290
290
logger .info ("No tasks received, continuing to wait..." )
291
291
continue
@@ -304,12 +304,12 @@ async def retry(task, error):
304
304
f"Task failed (attempt { task .attempts } /{ max_retries } ), "
305
305
f"re-queuing for retry: { input .issue } "
306
306
)
307
- await redis .lpush ("triage_queue" , task .model_dump_json ())
307
+ await fixAwait ( redis .lpush ("triage_queue" , task .model_dump_json () ))
308
308
else :
309
309
logger .error (
310
310
f"Task failed after { max_retries } attempts, " f"moving to error list: { input .issue } "
311
311
)
312
- await redis .lpush ("error_list" , error )
312
+ await fixAwait ( redis .lpush ("error_list" , error ) )
313
313
314
314
try :
315
315
logger .info (f"Starting triage processing for { input .issue } " )
@@ -329,21 +329,21 @@ async def retry(task, error):
329
329
if output .resolution == Resolution .REBASE :
330
330
logger .info (f"Triage resolved as REBASE for { input .issue } , " f"adding to rebase queue" )
331
331
task = Task (metadata = output .data .model_dump ())
332
- await redis .lpush ("rebase_queue" , task .model_dump_json ())
332
+ await fixAwait ( redis .lpush ("rebase_queue" , task .model_dump_json () ))
333
333
elif output .resolution == Resolution .BACKPORT :
334
334
logger .info (f"Triage resolved as BACKPORT for { input .issue } , " f"adding to backport queue" )
335
335
task = Task (metadata = output .data .model_dump ())
336
- await redis .lpush ("backport_queue" , task .model_dump_json ())
336
+ await fixAwait ( redis .lpush ("backport_queue" , task .model_dump_json () ))
337
337
elif output .resolution == Resolution .CLARIFICATION_NEEDED :
338
338
logger .info (
339
339
f"Triage resolved as CLARIFICATION_NEEDED for { input .issue } , "
340
340
f"adding to clarification needed queue"
341
341
)
342
342
task = Task (metadata = output .data .model_dump ())
343
- await redis .lpush ("clarification_needed_queue" , task .model_dump_json ())
343
+ await fixAwait ( redis .lpush ("clarification_needed_queue" , task .model_dump_json () ))
344
344
elif output .resolution == Resolution .NO_ACTION :
345
345
logger .info (f"Triage resolved as NO_ACTION for { input .issue } , " f"adding to no action list" )
346
- await redis .lpush ("no_action_list" , output .data .model_dump_json ())
346
+ await fixAwait ( redis .lpush ("no_action_list" , output .data .model_dump_json () ))
347
347
elif output .resolution == Resolution .ERROR :
348
348
logger .warning (f"Triage resolved as ERROR for { input .issue } , retrying" )
349
349
await retry (task , output .data .model_dump_json ())
0 commit comments