feat: Proactive contributor assistance with lightweight pattern detection
Closes #258
π Description
This PR introduces a proactive contributor assistance layer to Devr.AI.
Before calling the LLM for every message, the system now performs lightweight pattern-based detection to identify common contributor intents such as greetings, onboarding questions, and issue discovery queries.
This improves responsiveness, reduces unnecessary LLM API calls, and provides a smoother onboarding experience for new contributors.
The implementation is modular and can be extended later with caching, fuzzy matching, or advanced intent detection.
π§ Changes Made
- Added
_simple_pattern_match()inclassification_router.py - Implemented lightweight intent detection before LLM invocation
- Added proactive response handling in
discord/bot.py - Reduced unnecessary LLM calls for simple messages
- Maintained backward compatibility with existing classification flow
π· Screenshots or Visual Changes (if applicable)
N/A β Backend and bot behavior enhancement (no UI changes)
π€ Collaboration
Collaborated with: N/A
β Checklist
- [x] I have read the contributing guidelines.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [x] I have added necessary documentation (if applicable).
- [x] Any dependent changes have been merged and published in downstream modules.
Summary by CodeRabbit
-
New Features
- Add a public endpoint and in-app command to fetch beginner-friendly "good first issue" suggestions from GitHub.
- Discord bot now processes messages directly and delivers multi-part, faster responses with updated greetings.
-
Improvements
- Introduces lightweight rule-based intent detection for quicker, deterministic triage and clearer fallback handling.
- More consistent error responses and logging for GitHub issue lookups.
Replaces LLM-driven triage with lightweight rule-based and service-backed flows across the devrel stack: adds private pattern/fallback triage helpers, swaps Discord queue/agent execution for direct GitHubToolkit calls, introduces IssueSuggestionService and new GitHub API endpoints/routes, and updates main app and requirements accordingly. π― 4 (Complex) | β±οΈ ~45 minutes π° I hopped through code, my whiskers twitching bright, βοΈ Tip: You can configure your own custom pre-merge checks in the settings.π Walkthrough
Walkthrough
Changes
Cohort / File(s)
Summary
Classification Router
backend/app/classification/classification_router.pyAdds
_simple_pattern_match() and _fallback_triage() helpers; updates should_process_message() to include a disabled pattern-match Step 1 and retains LLM fallback; changes prompt/context formatting and JSON-block parsing with a dedicated LLM fallback path.
Discord bot β direct toolkit execution
backend/integrations/discord/bot.pyRemoves queue/agent integration and AsyncQueueManager usage; constructor signature simplified to
__init__(**kwargs); on_message now directly invokes GitHubToolkit and returns toolkit results to users; removes queue handler registration and related methods.
GitHub toolkit & intent changes
backend/app/agents/devrel/github/github_toolkit.pyReplaces LLM-based classification with rule-based keyword classifier in
classify_intent; integrates IssueSuggestionService for find_good_first_issues; expands execute flow to handle new intent branches and returns structured results.
Issue suggestion service (new)
backend/app/agents/devrel/github/services/issue_suggestion_service.py, backend/services/github/issue_suggestion_service.pyAdds
IssueSuggestionService to query GitHub Search Issues API for "good first issue" results, parse items, and return simplified issue lists; handles auth and non-200 responses.
API additions & routes
backend/app/api/router.py, backend/app/api/v1/github.py, backend/routes.pyRegisters new
/v1/github router and adds /beginner-issues endpoints; initializes IssueSuggestionService with token and exposes beginner-issues handlers with error handling.
Application bootstrap & deps
backend/main.py, backend/requirements.txtRemoves agent/queue/weaviate boot paths, simplifies background task lifecycle to Discord bot only, relaxes CORS to
"*", and substantially trims/updates Python dependencies list.Sequence Diagram(s)
sequenceDiagram
participant User as User (Discord)
participant Bot as Discord Bot
participant Toolkit as GitHubToolkit
participant Service as IssueSuggestionService
participant GitHub as GitHub API
User->>Bot: message (question / request)
Bot->>Toolkit: classify_intent / execute(message)
Toolkit->>Toolkit: rule-based intent classification
alt find_good_first_issues
Toolkit->>Service: fetch_global_beginner_issues(query)
Service->>GitHub: GET /search/issues (Bearer token)
GitHub-->>Service: search results (JSON)
Service-->>Toolkit: list of simplified issues
Toolkit-->>Bot: structured result with issues
else other intents
Toolkit->>Toolkit: dispatch to appropriate handler (web_search, contributor_recommendation, etc.)
Toolkit-->>Bot: structured result or placeholder
end
Bot->>User: send formatted response (issues or handler output)
Estimated code review effort
Possibly related PRs
backend/app/agents/devrel/github/github_toolkit.py; may conflict with intent handling or execution branching.ClassificationRouter and triage flow changes similar to this PRβs additions.Suggested reviewers
Poem
I sniffed out issues that welcome a first-time bite,
With tiny paws I fetch the helpful links you need,
No bulky LLMs β just a nimble rabbit speed,
Hop on, contribute β Iβll point you to the seed π±π₯ Pre-merge checks | β
2 | β 3
β Failed checks (2 warnings, 1 inconclusive)
Check name
Status
Explanation
Resolution
Out of Scope Changes check
β οΈ Warning
Pull request includes in-scope pattern matching and rule-based classification alongside significant out-of-scope changes: complete queue system replacement, APIRouter introduction, dependency restructuring, and Discord bot refactoring unrelated to proactive assistance feature.
Separate queue system removal, API route changes, and dependency updates into distinct pull requests; keep this PR focused on pattern matching and proactive response handling only.
Docstring Coverage
β οΈ Warning
Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check
β Inconclusive
Implementation partially addresses issue
#258 objectives: adds pattern-based intent detection and proactive response handling, but lacks conversation tracking across platforms, maintainer analytics, feedback loops, and structured onboarding guidance.While lightweight pattern detection is implemented, consider a roadmap for platform tracking, analytics dashboard, feedback mechanisms, and structured onboarding flows mentioned in the feature request for future phases.
β
Passed checks (2 passed)
Check name
Status
Explanation
Description Check
β
Passed
Check skipped - CodeRabbitβs high-level summary is enabled.
Title check
β
Passed
The title accurately reflects the main changes: introduces lightweight pattern detection for proactive contributor assistance, which is the primary technical addition across the changeset.
β¨ Finishing Touches
π§ͺ Generate unit tests (beta)
[!TIP] Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.
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.
@coderabbitai Thanks for the review!
- Removed the unreachable acknowledgment branch.
- Replaced the Unicode apostrophe with an ASCII apostrophe for consistency.
All review suggestions have been addressed. Please let me know if anything else needs improvement.
Update: Phase 2 enhancements added.
This PR now includes:
- Global beginner issue search
- GitHub API integration
- Rule-based issue classification
- Real-time issue suggestions via Discord
Ready for review. π