Skip to content

feat(discord): feature-complete webhook provider with embeds, base64 file attachments, edit, rate-limit retry, host restriction, and guardrails - #6646

Open
aries1980 wants to merge 6 commits into
keephq:mainfrom
aries1980:feat/discord-provider-enhancement
Open

feat(discord): feature-complete webhook provider with embeds, base64 file attachments, edit, rate-limit retry, host restriction, and guardrails#6646
aries1980 wants to merge 6 commits into
keephq:mainfrom
aries1980:feat/discord-provider-enhancement

Conversation

@aries1980

Copy link
Copy Markdown
Contributor

Summary

Feature-completes the Discord webhook provider against the Execute Webhook + Edit Message APIs:

  • Generic JSON passthroughembeds, username, avatar_url, allowed_mentions, flags, thread_name, applied_tags, poll, attachments forwarded as-is
  • File attachments via base64files param via multipart/form-data; no filesystem paths supported (security rationale in code/docs); accepts bytes, (filename, content, content_type) tuples, or {"base64": "...", "filename": "..."} dicts
  • Message editingmessage_id param switches to PATCH .../messages/{id}; snowflake-validated
  • Rate-limit retry — bounded 3-attempt retry on 429 with Retry-After (clamped to 30s max)
  • webhook_url host restriction — only discord.com/discordapp.com accepted
  • validate_scopes() — GET on the webhook URL to confirm it is real and reachable
  • Client-side guardrails — content ≤2000 chars, ≤10 embeds, ≤10 files, ≤10 MiB per file
  • tts and delete deliberately dropped — marginal value, not worth surface area

New: 53 tests

Documentation updated

  • Provider MDX page, auto-generated snippet, README, example workflow

Closes #6645

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues labels Jul 25, 2026
@aries1980
aries1980 force-pushed the feat/discord-provider-enhancement branch from b6040df to e92147d Compare July 25, 2026 12:26
@aries1980

Copy link
Copy Markdown
Contributor Author

For the ruff-related errors, I created a mega PR: #6649

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.47%. Comparing base (98dbd7e) to head (3d21358).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6646      +/-   ##
==========================================
- Coverage   30.49%   30.47%   -0.03%     
==========================================
  Files         101      101              
  Lines       11741    11770      +29     
==========================================
+ Hits         3581     3587       +6     
- Misses       8160     8183      +23     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

aries1980 and others added 4 commits July 30, 2026 13:07
MULTI_TENANT is backward-compatibly routed to the Auth0 identity
manager/verifier, but the test_app fixture only mocked the OIDC
discovery HTTP call when AUTH_TYPE was the literal string "AUTH0".
This left MULTI_TENANT-parametrized tests making a real network call
that timed out in CI. Also fixes AUTH0_DOMAIN being set with a
duplicated https:// scheme, which produced an invalid discovery URL.
Run scripts/docs_render_provider_snippets.py to sync the Discord and
base provider snippets with the provider's updated docstring/methods
(new discord_basic.yml example, updated files/message_id/content
descriptions), fixing the failing tests-docs CI check.
@aries1980

Copy link
Copy Markdown
Contributor Author

@shahargl : Hi, after the rebase, the issues went away, I think it is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Feature-complete Discord messaging: embeds, file attachments, full webhook payload support

1 participant