pub fn extract_upload_metadata(session: &Session) -> UploadMetadataExpand description
Extract upload metadata from a session, auto-generating title/description from the first user messages when the session’s own metadata is empty.
This consolidates the duplicated logic in server and worker upload handlers.