mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-07 21:35:34 -05:00
## Summary - Add helper functions in `service.py` to create standardized error responses with `error_type` classification - Update service functions to return error dicts instead of `None`, preserving error details from the Agent Generator microservice - Update `core.py` to pass through error responses properly - Update `create_agent.py` to handle error responses with user-friendly messages based on error type ## Error Types Now Propagated | Error Type | Description | User Message | |------------|-------------|--------------| | `llm_parse_error` | LLM returned unparseable response | "The AI had trouble understanding this request" | | `llm_timeout` / `timeout` | Request timed out | "The request took too long" | | `llm_rate_limit` / `rate_limit` | Rate limited | "The service is currently busy" | | `validation_error` | Agent validation failed | "The generated agent failed validation" | | `connection_error` | Could not connect to Agent Generator | Generic error message | | `http_error` | HTTP error from Agent Generator | Generic error message | | `unknown` | Unclassified error | Generic error message | ## Motivation This enables better debugging for issues like SECRT-1817 where decomposition failed due to transient LLM errors but the root cause was unclear in the logs. Now: 1. Error details from the Agent Generator microservice are preserved 2. Users get more helpful error messages based on error type 3. Debugging is easier with `error_type` in response details ## Related PR - Agent Generator side: https://github.com/Significant-Gravitas/AutoGPT-Agent-Generator/pull/102 ## Test Plan - [ ] Test decomposition with various error scenarios (timeout, parse error) - [ ] Verify user-friendly messages are shown based on error type - [ ] Check that error details are logged properly