refactor(discord): align on gateway-only ingestion#117
Conversation
yordis
commented
Apr 12, 2026
- Keep Discord ingress aligned with the gateway runner instead of maintaining a second webhook transport.
- Remove the extra Discord-specific HTTP surface and config that no longer matches the supported runtime model.
- Reduce Discord source dependencies and docs to the single supported ingestion path.
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 1cfe2cf. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
WalkthroughRemoves Discord webhook mode support throughout trogon-source-discord and trogon-gateway, consolidating to gateway-only operation. Deletes HTTP server code, signature verification, related configuration variables, and dependencies. Simplifies configuration structures and integration logic. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Coverage SummaryDetailsDiff against mainResults for commit: 1cfe2cf Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rsworkspace/crates/trogon-gateway/src/config.rs`:
- Around line 466-507: The code currently returns None immediately when
section.mode is missing which silently disables Discord even if other Discord
fields are set; change the logic in the validation block around section.mode
(and the subsequent checks for section.bot_token and section.gateway_intents) to
detect when mode is None/empty but other Discord fields are present and then
either: 1) treat the missing mode as if it were "gateway" (infer gateway) or 2)
push a ConfigValidationError::required/invalid_value for "discord"/"mode"
specifically when section.bot_token or section.gateway_intents are provided;
keep the subsequent DiscordBotToken::new(...) and
trogon_source_discord::config::parse_gateway_intents(...) flows unchanged so
token parsing and intent parsing still validate and push
ConfigValidationError::invalid on parse errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 76255af0-df61-43db-846a-94092cdedf51
⛔ Files ignored due to path filters (1)
rsworkspace/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (16)
devops/docker/compose/.env.exampledevops/docker/compose/compose.ymldevops/docker/compose/services/trogon-gateway/README.mdrsworkspace/crates/trogon-gateway/README.mdrsworkspace/crates/trogon-gateway/src/config.rsrsworkspace/crates/trogon-gateway/src/http.rsrsworkspace/crates/trogon-gateway/src/main.rsrsworkspace/crates/trogon-gateway/src/streams.rsrsworkspace/crates/trogon-source-discord/Cargo.tomlrsworkspace/crates/trogon-source-discord/src/config.rsrsworkspace/crates/trogon-source-discord/src/constants.rsrsworkspace/crates/trogon-source-discord/src/gateway.rsrsworkspace/crates/trogon-source-discord/src/gateway_runner.rsrsworkspace/crates/trogon-source-discord/src/lib.rsrsworkspace/crates/trogon-source-discord/src/server.rsrsworkspace/crates/trogon-source-discord/src/signature.rs
💤 Files with no reviewable changes (5)
- rsworkspace/crates/trogon-source-discord/Cargo.toml
- devops/docker/compose/compose.yml
- rsworkspace/crates/trogon-source-discord/src/constants.rs
- rsworkspace/crates/trogon-source-discord/src/server.rs
- rsworkspace/crates/trogon-source-discord/src/signature.rs
56e04e5 to
4bca02e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4bca02e. Configure here.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
4bca02e to
1cfe2cf
Compare
