Skip to content

Preserve provider error details in high-level streams - #25

Open
agocharbhatia wants to merge 1 commit into
Factory-AI:mainfrom
agocharbhatia:preserve-high-level-error-details
Open

agocharbhatia wants to merge 1 commit into
Factory-AI:mainfrom
agocharbhatia:preserve-high-level-error-details

Conversation

@agocharbhatia

Copy link
Copy Markdown

Problem

The current high-level Session/RunStream API drops nested provider error identity when converting ErrorNotification to ErrorEvent. Callers receive the generic top-level category and message, even when the parsed notification carries a specific name such as LLMInvalidRequestError.

Issue #5 describes this integration need. PR #6 fixed it for the legacy stream API; the separate current high-level API still omits the corresponding data. This change addresses that high-level parity gap.

Change

Add optional keyword-only error_name and error_detail fields to the high-level ErrorEvent, and forward the parsed nested payload in the existing converter. Use the established recursive freezing helper so event details remain immutable and detached from caller input.

The first three positional constructor arguments, top-level error category, timestamp, terminal behavior and absent-detail defaults remain compatible. No transport, retry, authentication or permission behavior changes.

Validation

  • The same final tests on unchanged base aa6fd94 fail for the added contract, including public RunStream cases with equal messages and different provider error names.
  • 135 focused high-level and legacy streaming tests pass, independently repeated in the publication checkout.
  • Full local SDK suite: 1537 passed, 15 skipped. Targeted Ruff/format, mypy and Pyright checks pass.
  • Independent source review checks input preservation, detached nested details and positional/match compatibility.

Only deterministic notification fixtures were used. No live CLI, backend or provider calls, production incidence, performance measurement or hosted-CI pass is claimed.

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.

1 participant