// These gateway responses can occur on a valid session when the shared service is busy. export function isTransientGatewayReadError(status: number, payload: unknown): boolean { if (!payload || typeof payload !== 'object') return false; const body = payload as { error?: string; code?: number }; return (status === 500 && body.error === 'read_failed') || (status === 401 && body.code == null && body.error === '认证失败'); }