Skip to content

Cannot Detect rate_limit ErrorsΒ #401

@Equlnox

Description

@Equlnox

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions