Skip to content

effect: classify AiError.InvalidResponseError as malformed-response #376

Closed

Description

@ThomasK33

effect 4.0.6 adds a non-retryable AiError.InvalidResponseError reason for provider response-schema and SSE decoding failures. Its release notes ask exhaustive AiErrorReason matches to handle the new tag.

classifyReason in packages/effect/src/errors.ts is not exhaustive. An AiError with this reason (only another effect/ai provider can produce one, because this bridge never does) falls through to the HTTP-status check:

  • With a 5xx HTTP context, classifyError returns "provider-unavailable" and isTransient returns true, but effect marks the reason non-retryable.
  • With no status, it returns "unknown".

Proposed fix: add case "InvalidResponseError": to the "malformed-response" group next to InvalidOutputError/StructuredOutputError, with a unit test in packages/effect/test/errors.test.ts.

Found while bumping effect to 4.0.6 in the daily dependency batch (branch deps-batch-oct23). Recheck trigger: before the effect 0.1.0 release (#325) merges.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions