fix: remove duplicate BotCapabilities construction across seven bot commands#2116
fix: remove duplicate BotCapabilities construction across seven bot commands#2116praisonai-triage-agent[bot] wants to merge 1 commit into
Conversation
β¦ommands (fixes #2114)
|
@coderabbitai review |
|
/review |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more β On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
β Action performedReview finished.
|
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (1)
π WalkthroughWalkthroughExtracts a new internal helper ChangesBotCapabilities Helper Extraction
Estimated code review effortπ― 2 (Simple) | β±οΈ ~10 minutes Suggested reviewers
Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ Generate docstrings
π§ͺ 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 |
|
@copilot Do a thorough review of this PR. Read ALL existing reviewer comments above from Qodo, Coderabbit, and Gemini first β incorporate their findings. Review areas:
|
Greptile SummaryExtracts repeated
Confidence Score: 5/5Safe to merge β pure refactoring with no behavioural changes. The helper defaults match the BotCapabilities dataclass defaults exactly, and all per-platform parameter differences are preserved. The change is a mechanical extraction: every call site passes the same values as before, tools or [] / skills or [] / knowledge_sources or [] normalisation moves into the helper (not dropped), and the web provider rename (web_search_provider β web_provider at the helper boundary) is applied consistently. Cross-checking BotCapabilities field defaults against _build_capabilities parameter defaults shows full alignment. No new code paths, no conditional logic changes, and the lazy import pattern is consistent with the rest of the file. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI: praisonai bot platform] --> B{Platform command}
B --> C[bot_telegram]
B --> D[bot_discord]
B --> E[bot_slack]
B --> F[bot_whatsapp]
B --> G[bot_linear]
B --> H[bot_email]
B --> I[bot_agentmail]
C --> J[_build_capabilities]
D --> J
E --> J
F --> J
G --> J
H --> J
I --> J
J -->|lazy import| K[BotCapabilities dataclass]
K --> L[BotHandler.start_*]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[CLI: praisonai bot platform] --> B{Platform command}
B --> C[bot_telegram]
B --> D[bot_discord]
B --> E[bot_slack]
B --> F[bot_whatsapp]
B --> G[bot_linear]
B --> H[bot_email]
B --> I[bot_agentmail]
C --> J[_build_capabilities]
D --> J
E --> J
F --> J
G --> J
H --> J
I --> J
J -->|lazy import| K[BotCapabilities dataclass]
K --> L[BotHandler.start_*]
Reviews (1): Last reviewed commit: "fix: remove duplicate BotCapabilities co..." | Re-trigger Greptile |
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on Python packages (praisonaiagents, praisonai). Do NOT modify praisonai-rust or praisonai-ts. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. Phase 1: Review per AGENTS.md
Phase 2: FIX Valid Issues Phase 3: Final Verdict |
|
Claude finished @MervinPraison's task ββ View job Architecture Review Complete βI've reviewed this PR according to AGENTS.md guidelines. Review Checklist:
Review Findings:β Protocol-Driven DesignThe refactoring follows protocol-driven design principles by keeping the abstraction in the wrapper layer ( β Backward CompatibilityAll existing CLI flags, defaults, and behavior are preserved exactly:
β No Performance ImpactThis is a pure refactoring with no runtime changes:
β Code Quality
β Other Reviewers' Feedback
Final Verdict: APPROVED βThis is a well-executed refactoring that improves maintainability without introducing any risks. The extraction is mechanically correct, preserves all existing behavior, and makes future capability additions much easier. No fixes needed - merging as-is. |
Fixes #2114
Summary
Extracted duplicate BotCapabilities construction (~28 fields) that was repeated 7 times across bot platform commands into a single _build_capabilities helper function.
Changes
Benefits
This is a pure refactoring - no runtime or behavioral changes.
Summary by CodeRabbit