Skip to content

feat(discord-bot): offload >10MB attachments to Azure Blob - #395

Draft
omegent-app[bot] wants to merge 1 commit into
fork/devfrom
t3-discord/4777d441
Draft

feat(discord-bot): offload >10MB attachments to Azure Blob#395
omegent-app[bot] wants to merge 1 commit into
fork/devfrom
t3-discord/4777d441

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Aug 11, 2026

Copy link
Copy Markdown

Problem

Discord rejects multipart uploads over ~10MB. Oversized agent attachments currently only get a "could not be attached" note with no download path.

Fix

When Azure storage is configured, files over the Discord limit are uploaded to a private, non-listable blob container under hard-to-guess paths (yyyy/mm/dd/{uuid}/{stem}-{random}{ext}), then linked with a read-only HTTPS SAS URL that expires in 3 days.

  • Config (optional): AZURE_STORAGE_CONNECTION_STRING (preferred) or AZURE_STORAGE_ACCOUNT_NAME + AZURE_STORAGE_ACCOUNT_KEY, container AZURE_STORAGE_CONTAINER (default discord-bot-attachments)
  • Markdown local-file refs rewrite to the SAS URL when offload succeeds
  • Fallback note still posts when Azure is unset or upload fails
  • Ops secrets example updated with the new env vars

Azure container setup (operator)

# private container (no public access / not listable)
az storage container create \
  --account-name <account> \
  --name discord-bot-attachments \
  --public-access off

Test plan

  • vp test run for azureBlobUpload, config, ResponseBridge
  • apps/discord-bot typecheck
  • With Azure creds staged: post a >10MB file from an agent turn and confirm SAS link works, then fails after expiry (or with stripped query)
  • Without Azure: oversized still posts the previous failure note

opened by patroza in chat thread Discord · Discord

… SAS

Discord rejects large multipart uploads. When Azure storage is configured,
oversized files go to a private non-listable container under hard-to-guess
blob paths, and the bot posts read-only HTTPS SAS links that expire in 3 days.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants