AssistantMessage.error Not Parsed → Cannot Detect rate_limit Errors
The SDK defines AssistantMessage.error (including "rate_limit"), but the message parser never sets this field. This makes it impossible for applications to detect rate limits or implement retry logic.
Expected
AssistantMessage.error should be populated when the API returns an error.
Actual
The parser only extracts content, model, and parent_tool_use_id; the error field is ignored.
Suggested Fix
Add error parsing, e.g.:
error = data["message"].get("error")
return AssistantMessage(..., error=error)
AssistantMessage.errorNot Parsed → Cannot Detectrate_limitErrorsThe SDK defines
AssistantMessage.error(including"rate_limit"), but the message parser never sets this field. This makes it impossible for applications to detect rate limits or implement retry logic.Expected
AssistantMessage.errorshould be populated when the API returns an error.Actual
The parser only extracts
content,model, andparent_tool_use_id; theerrorfield is ignored.Suggested Fix
Add error parsing, e.g.: