@@ -72,17 +72,17 @@ const isRequestOverflowFailure = (failure: unknown) =>
7272 * Proxies and gateways often reject oversized bodies with an unclassified 4xx instead of a size
7373 * signal, while media counts flat toward tokens and dominates bytes. An unclassified client
7474 * rejection against a huge request is most likely size-caused, so it recovers like a payload
75- * rejection. Genuine client bugs stay untouched: small requests never qualify.
75+ * rejection. Genuine client bugs stay untouched: small requests never qualify. Only thrown
76+ * failures carry HTTP status, so streamed provider errors are left to the classified paths.
7677 */
7778const isOversizedRejection = ( failure : unknown , requestBytes : number ) =>
7879 requestBytes >= OVERSIZED_REQUEST_BYTES &&
79- ( ( failure instanceof AIError &&
80- failure . reason . _tag === "InvalidRequest" &&
81- failure . reason . classification === undefined &&
82- failure . reason . http !== undefined &&
83- failure . reason . http . status >= 400 &&
84- failure . reason . http . status < 500 ) ||
85- ( LLMEvent . is . providerError ( failure ) && failure . classification === undefined ) )
80+ failure instanceof AIError &&
81+ failure . reason . _tag === "InvalidRequest" &&
82+ failure . reason . classification === undefined &&
83+ failure . reason . http !== undefined &&
84+ failure . reason . http . status >= 400 &&
85+ failure . reason . http . status < 500
8686
8787/** Captures Location-scoped dependencies without introducing another service or execution loop. */
8888export const make = Effect . gen ( function * ( ) {
0 commit comments