LobeHub converts known model-runtime errors from aiChat.outputJSON into native TRPCError instances so provider, config, quota, and request failures return correct HTTP status codes instead of surfacing as generic 500 errors.
Normalizes model-runtime errors into typed TRPCError instances using tRPC's status-code mapping, removing custom error handling from the router and fixing misclassification of provider auth failures as session-expired errors.
Users and operators of LobeHub-powered AI chat get accurate error messages instead of blanket 500 responses, making it easier to diagnose provider configuration, quota, and auth problems without digging through server logs. The fix also stops provider auth failures like InvalidProviderAPIKey from being silently rewritten into session-expired responses, which previously sent users down the wrong troubleshooting path. Monitor whether the OIDC stream-passthrough change introduces regressions in token endpoint handling under high concurrency or unusual grant_type combinations.