Improve backend error handling and logging for async tasks
This PR addresses CodeRabbit review feedback and improves backend reliability:
- Fixed async task tracking in EventBus (prevent garbage collection)
- Improved queue processing (re-raise exceptions after logging)
- Fixed UnboundLocalError by initializing variables before try blocks
- Fixed incorrect success responses in FAQ handler
- Added GitHub webhook HMAC-SHA256 signature verification
- Replaced raw exception messages with safe generic error responses
- Improved structured logging throughout
[!WARNING]
Rate limit exceeded
@muhammadtihamehas exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 21 seconds before requesting another review.⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.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.
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
b54eb2f9-5311-4b3c-b50b-61eb7b9d8638📥 Commits
Reviewing files that changed from the base of the PR and between db81871e0414402dad35fcf9d16cfa78d10d0ff3 and ebb6809c86e582307e688c5702b299b94c418ad0.
⛔ Files ignored due to path filters (1)
.DS_Storeis excluded by!**/.DS_Store📒 Files selected for processing (27)
backend/app/agents/base_agent.pybackend/app/api/v1/integrations.pybackend/app/core/config/settings.pybackend/app/core/events/event_bus.pybackend/app/core/handler/faq_handler.pybackend/app/core/handler/handler_registry.pybackend/app/core/handler/message_handler.pybackend/app/core/orchestration/agent_coordinator.pybackend/app/core/orchestration/queue_manager.pybackend/app/database/core.pybackend/app/models/database/supabase.pybackend/requirements.txtbackend/routes.pydocs/DATABASE_CONNECTION.mdpyproject.tomltests/conftest.pytests/test_agent_state.pytests/test_base_handler.pytests/test_classification_router.pytests/test_db_pool.pytests/test_events.pytests/test_faq_handler.pytests/test_handler_registry.pytests/test_message_handler.pytests/test_supabase.pytests/test_weaviate.pytests/tests_db.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.