mirror of https://github.com/kortix-ai/suna.git
fix(agent): ensure active run key is deleted upon stopping agent run
This commit is contained in:
parent
54827b6582
commit
a022694e4a
|
@ -202,6 +202,8 @@ async def stop_agent_run(agent_run_id: str, error_message: Optional[str] = None)
|
|||
await update_agent_run_status(
|
||||
client, agent_run_id, final_status, error=error_message
|
||||
)
|
||||
instance_key = f"active_run:{instance_id}:{agent_run_id}"
|
||||
await redis.client.delete(instance_key)
|
||||
logger.info(f"Successfully initiated stop process for agent run: {agent_run_id}")
|
||||
|
||||
# async def restore_running_agent_runs():
|
||||
|
|
|
@ -227,6 +227,8 @@ async def run_agent_background(
|
|||
)
|
||||
|
||||
finally:
|
||||
instance_key = f"active_run:{instance_id}:{agent_run_id}"
|
||||
await redis.client.delete(instance_key)
|
||||
logger.info(
|
||||
f"Agent run completed for: {agent_run_id} (Instance: {instance_id}) with final status: {final_status}"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue