mirror of https://github.com/kortix-ai/suna.git
fix(agent): increase timeout for pending Redis operations and improve error logging for cost calculation
This commit is contained in:
parent
a1a71a05de
commit
6fb2c544d3
|
@ -578,8 +578,8 @@ class ResponseProcessor:
|
||||||
logger.info("Stream cost calculation resulted in zero or None, not storing cost message.")
|
logger.info("Stream cost calculation resulted in zero or None, not storing cost message.")
|
||||||
self.trace.update(metadata={"cost": 0})
|
self.trace.update(metadata={"cost": 0})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error calculating final cost for stream: {str(e)}")
|
logger.warning(f"Failed to calculate final cost for stream: {str(e)}")
|
||||||
self.trace.event(name="error_calculating_final_cost_for_stream", level="ERROR", status_message=(f"Error calculating final cost for stream: {str(e)}"))
|
self.trace.event(name="failed_to_calculate_final_cost_for_stream", level="WARNING", status_message=(f"Failed to calculate final cost for stream: {str(e)}"))
|
||||||
|
|
||||||
|
|
||||||
# --- Final Finish Status ---
|
# --- Final Finish Status ---
|
||||||
|
@ -1069,7 +1069,7 @@ class ResponseProcessor:
|
||||||
"arguments": params # The extracted parameters
|
"arguments": params # The extracted parameters
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(f"Created tool call: {tool_call}")
|
# logger.debug(f"Created tool call: {tool_call}")
|
||||||
return tool_call, parsing_details # Return both dicts
|
return tool_call, parsing_details # Return both dicts
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -235,7 +235,7 @@ async def run_agent_background(
|
||||||
|
|
||||||
# Wait for all pending redis operations to complete, with timeout
|
# Wait for all pending redis operations to complete, with timeout
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(asyncio.gather(*pending_redis_operations), timeout=5.0)
|
await asyncio.wait_for(asyncio.gather(*pending_redis_operations), timeout=30.0)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
logger.warning(f"Timeout waiting for pending Redis operations for {agent_run_id}")
|
logger.warning(f"Timeout waiting for pending Redis operations for {agent_run_id}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue