async def _generate_attachment_entities_from_description(
        self,
        client: httpx.AsyncClient,
        issue_id: str,
        issue_identifier: str,
        issue_description: str,
        breadcrumbs: List[Breadcrumb],
    ) -> AsyncGenerator[Union[LinearAttachmentEntity, None], None]:
        """Extract and process attachments from markdown links in issue descriptions.

        Args:
            client: HTTP client to use for requests
            issue_id: Linear issue ID
            issue_identifier: Human-readable issue identifier
            issue_description: Markdown text of issue description
            breadcrumbs: List of parent breadcrumbs for navigation context

        Yields:
            Processed attachment entities from description links
        """
        if not issue_description:
            return

        # Regular expression to find markdown links [filename](url)
        markdown_link_pattern = r"\[([^\]]+)\]\(([^)]+)\)"
        matches = re.findall(markdown_link_pattern, issue_description)

        logger.info(
            f"Found {len(matches)} potential attachments in description "
            f"for issue {issue_identifier}"
        )

        for file_name, url in matches:
            # Only process Linear upload URLs
            if "uploads.linear.app" in url:
                logger.info(f"Processing attachment from description: {file_name} - URL: {url}")

                # Generate a unique ID for this attachment
                attachment_id = str(uuid4())

                # Create the attachment entity
                attachment_entity = LinearAttachmentEntity(
                    entity_id=attachment_id,
                    file_id=attachment_id,
                    breadcrumbs=breadcrumbs.copy(),
                    # FileEntity required fields
                    name=file_name,
                    download_url=url,
                    # LinearAttachmentEntity specific fields
                    issue_id=issue_id,
                    issue_identifier=issue_identifier,
                    title=file_name,
                    subtitle="Extracted from issue description",
                    source={"type": "description_link"},
                    created_at=None,
                    updated_at=None,
                    metadata={"extracted_from": "description"},
                )

                try:
                    processed_entity = await self.process_file_entity(
                        file_entity=attachment_entity,
                        headers={"Authorization": f"Bearer {self.access_token}"},
                    )
                    yield processed_entity
                except Exception as e:
                    logger.error(
                        f"Error processing attachment {attachment_id} from description: {str(e)}"
                    )
Extract and process attachments from markdown links in issue descriptions.

        Args:
            client: HTTP client to use for requests
            issue_id: Linear issue ID
            issue_identifier: Human-readable issue identifier
            issue_description: Markdown text of issue description
            breadcrumbs: List of parent breadcrumbs for navigation context

        Yields:
            Processed attachment entities from description links
        
backend/airweave/platform/sources/linear.py