mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend): validate completed job result type in _submit_and_poll
This commit is contained in:
@@ -230,7 +230,13 @@ async def _submit_and_poll(
|
||||
|
||||
if status == "completed":
|
||||
logger.info(f"Agent Generator job {job_id} completed")
|
||||
return poll_data.get("result", {})
|
||||
result = poll_data.get("result", {})
|
||||
if not isinstance(result, dict):
|
||||
return _create_error_response(
|
||||
"Agent Generator returned invalid result payload",
|
||||
"invalid_response",
|
||||
)
|
||||
return result
|
||||
elif status == "failed":
|
||||
error_msg = poll_data.get("error", "Job failed")
|
||||
logger.error(f"Agent Generator job {job_id} failed: {error_msg}")
|
||||
|
||||
Reference in New Issue
Block a user