Skip to content

fix: expose nested error name on high-level ErrorEvent - #27

Open
factory-droid[bot] wants to merge 1 commit into
mainfrom
fix/error-event-error-name
Open

factory-droid[bot] wants to merge 1 commit into
mainfrom
fix/error-event-error-name

Conversation

@factory-droid

@factory-droid factory-droid Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add error_name and error_detail to the high-level ErrorEvent (the one Session streams and RunResult collects), populated from the nested error object on the error notification
  • error_detail is frozen like the other high-level JSON payloads
  • both fields default to None, so existing positional and keyword construction keeps working

The low-level droid_sdk.stream.ErrorEvent has carried error_name/error_detail since #6. The high-level ErrorEvent added later did not, so Session users still got only error_type="Error" for frames like the one in #5:

{"type": "error", "message": "Requested model was not found on the API provider", "errorType": "Error",
 "timestamp": "2026-08-02T11:00:13.647Z",
 "error": {"name": "LLMInvalidRequestError", "message": "Requested model was not found on the API provider"}}

Before: ErrorEvent(message=..., error_type=<ErrorType.ERROR>, timestamp=...)
After: same, plus error_name='LLMInvalidRequestError' and error_detail={'name': 'LLMInvalidRequestError', 'message': ...}

Closes #5

Testing

  • uv run --frozen ruff check src tests
  • uv run --frozen ruff format --check on changed files
  • uv run --frozen mypy
  • uv run --frozen pyright
  • uv run --frozen pytest --ignore=tests/test_cache.py -q (1,533 passed, 15 skipped)
  • the new test, built from the wire frame in ErrorEvent hides the nested error.name that arrives on the wire #5, fails against main and passes with this change

Risk

Low. Additive optional fields on a frozen dataclass. No protocol changes.

Closes #5

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ErrorEvent hides the nested error.name that arrives on the wire

0 participants