Skip to content

Remove unused agent files and clean up test directory by deleting obs…#524

Merged
MervinPraison merged 6 commits intomainfrom
develop
May 28, 2025
Merged

Remove unused agent files and clean up test directory by deleting obs…#524
MervinPraison merged 6 commits intomainfrom
develop

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

@MervinPraison MervinPraison commented May 27, 2025

…olete test scripts and configuration files.

Summary by CodeRabbit

  • Chores

    • Updated automated test workflows to consistently run tests from the correct source directory, improving reliability and consistency across all test jobs.
    • Adjusted file paths and working directory references in workflow scripts for better alignment with the project structure.
    • Updated package metadata for improved packaging and distribution.
  • Tests

    • Added a new unit test to verify sequential data passing between Mini Agents with mocked API calls.
    • Removed end-to-end and integration test files related to CrewAI, including all associated test cases and fixtures.

@netlify
Copy link
Copy Markdown

netlify bot commented May 27, 2025

Deploy Preview for praisonai canceled.

Name Link
🔨 Latest commit 6e3c9b7
🔍 Latest deploy log https://app.netlify.com/projects/praisonai/deploys/68370be44948c600083161c2

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

Hello, this is gemini-code-assist providing a summary of this pull request. The primary goal of this PR, as indicated by the title and description, is to clean up the project by removing unused agent-related files and deleting obsolete test scripts and configuration files from the test directory. This involves removing specific test files and making minor adjustments to pyproject.toml files.

Highlights

  • Test File Removal: Several obsolete test files, specifically related to CrewAI integration and real tests, have been completely removed from the test directory. This helps streamline the test suite and remove outdated code.
  • Build Configuration Updates: Minor changes were made to two pyproject.toml files. One adds a [tool.setuptools] section to explicitly define packages, and the other adjusts the casing of a package name within the [tool.setuptools] configuration.

Changelog

  • (Deleted CrewAI Integration Tests file)
    • Removed the entire file containing CrewAI integration tests (# CrewAI Integration Tests).
  • (Deleted CrewAI Real Tests file)
    • Removed the entire file containing CrewAI real tests (# CrewAI Real Tests).
  • src/praisonai-agents/pyproject.toml
    • Added [tool.setuptools] section with packages = ["praisonaiagents"].
    • Ensured a newline exists at the end of the file.
  • src/praisonai/pyproject.toml
    • Changed the package name casing from "PraisonAI" to "praisonai" in the [tool.setuptools] section.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Old tests now are gone,
Cleanup makes the code base light,
Simpler, cleaner path.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively cleans up obsolete test files and improves packaging configurations in pyproject.toml files. The changes contribute positively to the project's maintainability and adherence to conventions. The renaming of the package in src/praisonai/pyproject.toml to lowercase is a good correction. The addition of setuptools configuration in src/praisonai-agents/pyproject.toml is also appropriate. I have one minor suggestion for improvement.

Summary of Findings

  • Missing Newline at End of File: The file src/praisonai-agents/pyproject.toml has a newly added line (packages = ["praisonaiagents"]) as its last line, but it's missing a terminating newline character. It's recommended to end all text files with a newline.

Merge Readiness

The pull request is in good shape and primarily involves beneficial cleanup and configuration improvements. There is one low severity issue identified concerning a missing newline at the end of src/praisonai-agents/pyproject.toml. I recommend addressing this minor point to ensure adherence to common best practices before merging. As an AI reviewer, I am not authorized to approve pull requests; please ensure further review and approval by authorized team members.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 27, 2025

"""

Walkthrough

This update restructures the testing and packaging setup for the project. It modifies multiple GitHub Actions workflows to run tests from within the src/praisonai directory, adjusts import paths and packaging metadata, and removes all CrewAI-related integration and end-to-end test files. Additionally, it enhances a specific unit test with API call mocking.

Changes

Files/Groups Change Summary
.github/workflows/*.yml Updated all test steps to change working directory to src/praisonai before execution; adjusted import paths and file references accordingly.
src/praisonai-agents/pyproject.toml Added [tool.setuptools] section specifying packages = ["praisonaiagents"].
src/praisonai/pyproject.toml Changed package name in setuptools config from "PraisonAI" to "praisonai".
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py Added new unit test with OpenAI API mocking to verify sequential data passing between Mini Agents.
tests/integration/crewai/init.py, tests/integration/crewai/test_crewai_basic.py Deleted CrewAI integration test suite and its __init__.py.
tests/e2e/crewai/init.py, tests/e2e/crewai/test_crewai_real.py Deleted CrewAI end-to-end test suite and its __init__.py.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant src/praisonai
    participant Test Runner

    GitHub Actions->>src/praisonai: cd src/praisonai
    src/praisonai->>Test Runner: Run pytest / test_runner.py
    Test Runner-->>src/praisonai: Test results
    src/praisonai-->>GitHub Actions: Report status
Loading

Possibly related PRs

  • MervinPraison/PraisonAI#521: Also modifies GitHub Actions workflows to change the working directory to src/praisonai, aligning CI structure with this PR.
  • MervinPraison/PraisonAI#509: Enhances unittest workflow with debugging steps and environment validation, related to testing workflows but not overlapping commands.

Poem

In the warren, tests now hop with glee,
From root to src/praisonai they flee.
CrewAI’s trails have faded away,
Mocked APIs keep the fluffs at play.
Packaging’s neat, the paths are right—
The code hops on, both day and night!
🐇✨
"""

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
.github/workflows/unittest.yml (1)

143-168: ⚠️ Potential issue

Fix hardcoded path duplication for autogen-agents.yaml
After cd src/praisonai, opening src/praisonai/tests/autogen-agents.yaml attempts to load from src/praisonai/src/praisonai/tests/.... It should simply reference the tests folder.

Proposed diff:

-        cd src/praisonai
-        python -c "
-        ...
-            import yaml
-            with open('src/praisonai/tests/autogen-agents.yaml', 'r') as f:
+        cd src/praisonai
+        python -c "
+        ...
+            import yaml
+            with open('tests/autogen-agents.yaml', 'r') as f:
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 148-148: trailing spaces

(trailing-spaces)


[error] 152-152: trailing spaces

(trailing-spaces)


[error] 155-155: trailing spaces

(trailing-spaces)


[error] 158-158: trailing spaces

(trailing-spaces)


[error] 165-165: trailing spaces

(trailing-spaces)

🧹 Nitpick comments (6)
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (1)

9-9: Remove unused import.

The pytest import is not used in this test file and should be removed to clean up the imports.

-import pytest
🧰 Tools
🪛 Ruff (0.11.9)

9-9: pytest imported but unused

Remove unused import: pytest

(F401)

.github/workflows/test-core.yml (2)

48-48: Remove trailing spaces
The line defining - name: Run Integration Tests has extra trailing spaces, which will trigger YAML lint errors. Please remove the trailing spaces.

-    - name: Run Integration Tests  
+    - name: Run Integration Tests
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 48-48: trailing spaces

(trailing-spaces)


58-58: Remove trailing spaces
The line defining - name: Run CrewAI Framework Tests has extra trailing spaces, which will trigger YAML lint errors. Please remove the trailing spaces.

-    - name: Run CrewAI Framework Tests  
+    - name: Run CrewAI Framework Tests
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 58-58: trailing spaces

(trailing-spaces)

.github/workflows/unittest.yml (3)

214-223: Unify directory references in debug step
You cd src/praisonai then glob tests/*.yaml, but the log prints src/praisonai/tests/. This mismatch could confuse diagnostics. Update the print statement to reflect the actual lookup path.

Sample adjustment:

-        print('📁 Available YAML files in src/praisonai/tests/:')
+        print('📁 Available YAML files in tests/:')
         import glob
-        yaml_files = glob.glob('tests/*.yaml')
+        yaml_files = glob.glob('tests/*.yaml')
         for f in yaml_files:
             print(f'  {f}')
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 220-220: trailing spaces

(trailing-spaces)


356-359: Maintain consistency in invocation style
Here you run:

python -m praisonai src/praisonai/tests/autogen-agents.yaml

Consider mirroring other steps by:

cd src/praisonai && python -m praisonai tests/autogen-agents.yaml

This keeps file paths relative to the working directory.


362-388: Consolidate directory context in comprehensive debug
Multiple debug steps invoke cd src/praisonai and then list or reference files under tests/ vs src/praisonai/tests/. Consider grouping these into a single block or parameterizing the test directory path to reduce duplication and potential mismatches.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 370-370: trailing spaces

(trailing-spaces)


[error] 374-374: trailing spaces

(trailing-spaces)


[error] 377-377: trailing spaces

(trailing-spaces)


[error] 382-382: trailing spaces

(trailing-spaces)


[error] 388-388: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8944902 and 483992f.

⛔ Files ignored due to path filters (6)
  • src/praisonai-agents/tests/image.jpg is excluded by !**/*.jpg
  • src/praisonai-agents/tests/kag-research-paper.pdf is excluded by !**/*.pdf
  • src/praisonai-agents/tests/large.pdf is excluded by !**/*.pdf
  • src/praisonai-agents/tests/sample.docx is excluded by !**/*.docx
  • src/praisonai-agents/tests/tasks.csv is excluded by !**/*.csv
  • src/praisonai-agents/tests/tesla-stock-price.csv is excluded by !**/*.csv
📒 Files selected for processing (14)
  • .github/workflows/python-package.yml (1 hunks)
  • .github/workflows/test-comprehensive.yml (1 hunks)
  • .github/workflows/test-core.yml (1 hunks)
  • .github/workflows/test-extended.yml (1 hunks)
  • .github/workflows/test-frameworks.yml (1 hunks)
  • .github/workflows/test-real.yml (1 hunks)
  • .github/workflows/unittest.yml (9 hunks)
  • src/praisonai-agents/pyproject.toml (1 hunks)
  • src/praisonai/pyproject.toml (1 hunks)
  • src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (1 hunks)
  • tests/e2e/crewai/__init__.py (0 hunks)
  • tests/e2e/crewai/test_crewai_real.py (0 hunks)
  • tests/integration/crewai/__init__.py (0 hunks)
  • tests/integration/crewai/test_crewai_basic.py (0 hunks)
💤 Files with no reviewable changes (4)
  • tests/e2e/crewai/init.py
  • tests/integration/crewai/init.py
  • tests/e2e/crewai/test_crewai_real.py
  • tests/integration/crewai/test_crewai_basic.py
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/unittest.yml

[error] 99-99: trailing spaces

(trailing-spaces)


[error] 220-220: trailing spaces

(trailing-spaces)

.github/workflows/test-core.yml

[error] 48-48: trailing spaces

(trailing-spaces)


[error] 58-58: trailing spaces

(trailing-spaces)

🪛 Ruff (0.11.9)
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py

9-9: pytest imported but unused

Remove unused import: pytest

(F401)

🪛 GitHub Actions: Core Tests
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py

[error] 1-1: Test failure: AttributeError - module 'praisonaiagents' has no attribute 'llms' during test_mini_agents_sequential_data_passing.

🪛 GitHub Actions: Quick Validation Tests
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py

[error] 1-1: Test failure: AttributeError: module 'praisonaiagents' has no attribute 'llms' in test_mini_agents_sequential_data_passing.

🪛 GitHub Actions: Python package
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py

[error] 1-1: Test failure: AttributeError: module 'praisonaiagents' has no attribute 'llms' in test_mini_agents_sequential_data_passing.

🔇 Additional comments (13)
src/praisonai/pyproject.toml (1)

103-103:

Details

✅ Verification successful

Good adherence to Python package naming conventions.

The change from "PraisonAI" to "praisonai" follows PEP 8 naming conventions for Python packages (lowercase with underscores). This creates appropriate separation between the project display name ("PraisonAI") and the actual package directory name ("praisonai").

Please verify that the actual directory structure matches this configuration:


🏁 Script executed:

#!/bin/bash
# Description: Verify the package directory structure matches the setuptools configuration

# Check if the praisonai package directory exists in the expected location
fd -t d "praisonai" src/ --max-depth 2

# Verify the package contains __init__.py to confirm it's a valid Python package
fd "__init__.py" src/praisonai/ --max-depth 1

Length of output: 202


I want to confirm how the package discovery is configured in pyproject.toml and that the true package directory contains an __init__.py. Let’s pull in those settings and inspect deeper:


🏁 Script executed:

#!/bin/bash
# Show where setuptools is configured and what packages/package-dir are set
grep -n '\[tool.setuptools' src/praisonai/pyproject.toml
grep -n 'packages' src/praisonai/pyproject.toml
grep -n 'package-dir' src/praisonai/pyproject.toml

# Verify that an __init__.py actually exists in the nested praisonai directory
fd "__init__.py" src/praisonai/ --max-depth 3

Length of output: 609


Let’s inspect the full [tool.setuptools] block to confirm if any package-dir is set (so that praisonai under src/praisonai/ is discovered correctly):


🏁 Script executed:

#!/bin/bash
# Show the [tool.setuptools] section with context
grep -n "\[tool.setuptools\]" -A 20 src/praisonai/pyproject.toml

Length of output: 834


Package directory structure verified

The packages = ["praisonai"] setting in [tool.setuptools] correctly maps to the src/praisonai/praisonai/ directory, which contains an __init__.py. No further changes are needed.

src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (1)

15-27: Well-structured mock implementation.

The mock completion function is well-designed with proper response simulation based on input content. The logic correctly handles different message types and returns appropriate responses for the test scenarios.

src/praisonai-agents/pyproject.toml (1)

58-59: Good addition of explicit package configuration.

Adding the [tool.setuptools] section with explicit package declaration is a good practice. This ensures setuptools correctly identifies and includes the praisonaiagents package during the build process, consistent with the pattern established in the main praisonai package.

.github/workflows/python-package.yml (1)

40-42: Appropriate workflow adjustment for package restructuring.

The change to run tests from the src/praisonai directory aligns well with the package restructuring effort. Using cd src/praisonai && python -m pytest ensures tests execute in the correct context relative to the updated package structure.

.github/workflows/test-extended.yml (1)

103-103: Align performance benchmarks import path
The updated sys.path.insert correctly points to src/praisonai, matching other workflows and ensuring imports resolve from the main package directory.

.github/workflows/test-real.yml (2)

81-82: Standardize working directory before AutoGen tests
The addition of cd src/praisonai && ensures that pytest runs in the correct context for AutoGen end-to-end tests. No changes to test logic.


88-89: Verify removal of CrewAI E2E tests
The workflow still includes the CrewAI real-test step, but the PR summary mentioned cleaning up CrewAI test files. Please confirm that tests/e2e/crewai/ and its tests exist after cleanup, or remove this step if obsolete.

Likely an incorrect or invalid review comment.

.github/workflows/test-frameworks.yml (1)

63-63: Ensure correct execution context for framework tests
Prepending cd src/praisonai && correctly aligns the working directory with other CI workflows, preventing import errors during framework integration tests.

.github/workflows/test-comprehensive.yml (1)

70-92: Run comprehensive tests from src/praisonai
Each test invocation now correctly changes the working directory before running tests/test_runner.py, standardizing the CI context across all test types.

.github/workflows/test-core.yml (1)

46-67: Add cd src/praisonai for all core test steps
The run commands for unit, integration, AutoGen, CrewAI, and legacy tests now uniformly change into src/praisonai, aligning with the project layout and avoiding potential import issues.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 48-48: trailing spaces

(trailing-spaces)


[error] 58-58: trailing spaces

(trailing-spaces)

.github/workflows/unittest.yml (3)

301-304: Consistent working directory for package imports
The added cd src/praisonai ensures the local praisonai package is on the module path when running the API key flow tests. This aligns with other steps and avoids surprises in import resolution.


470-474: Update fast test invocation to new structure
Running the fast tests from src/praisonai ensures the test runner and module imports resolve correctly. This change looks good and aligns with the updated project layout.


476-478: Run legacy tests in the updated context
Invoking pytest from src/praisonai with explicit paths guarantees that legacy example tests still run under the new directory structure. This adjustment is correct.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/test-extended.yml (1)

55-67: Use working-directory to DRY up repeated absolute paths

All five timeout_run python ${{ github.workspace }}/src/praisonai-agents/... invocations can be simplified by setting a working-directory on the step. This eliminates the need for the long path prefix on each line and makes the YAML more maintainable. For example:

- name: Test Key Example Scripts
  working-directory: ${{ github.workspace }}/src/praisonai-agents
  continue-on-error: true
  run: |
    echo "🧪 Testing key example scripts..."
    timeout_run python basic-agents.py
    timeout_run python async_example.py
    timeout_run python knowledge-agents.py
    timeout_run python mcp-basic.py
    timeout_run python ui.py
    echo "✅ Example script testing completed"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 56-56: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)


[error] 59-59: trailing spaces

(trailing-spaces)


[error] 62-62: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 483992f and 12e59a5.

📒 Files selected for processing (1)
  • .github/workflows/test-extended.yml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/test-extended.yml

[error] 56-56: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)


[error] 59-59: trailing spaces

(trailing-spaces)


[error] 62-62: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
.github/workflows/test-extended.yml (1)

103-103: Verify the module path adjustment for performance tests

The inline benchmark now does:

sys.path.insert(0, 'src/praisonai')

instead of the previous 'src/praisonai-agents'. Please confirm that:

  1. The praisonaiagents module now lives under src/praisonai (and not under src/praisonai-agents).
  2. This aligns with your recent cleanup/packaging changes.

If the module was moved or renamed, this is correct; otherwise, update the path or import accordingly.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (2)

9-9: Remove unused import.

The pytest import is not used anywhere in the code and should be removed to avoid clutter.

-import pytest
🧰 Tools
🪛 Ruff (0.11.9)

9-9: pytest imported but unused

Remove unused import: pytest

(F401)


15-87: Consider simplifying the mock function.

While the mock function is comprehensive and functional, it's quite complex with multiple nested classes. The implementation correctly handles both streaming and non-streaming responses, but could be simplified for better maintainability.

Consider using a simpler approach with dataclasses or namedtuples:

+from dataclasses import dataclass
+from typing import List, Optional

+@dataclass
+class MockMessage:
+    content: str
+    def get(self, key, default=None):
+        return getattr(self, key, default) if hasattr(self, key) else default

+@dataclass 
+class MockChoice:
+    message: MockMessage

+@dataclass
+class MockResponse:
+    choices: List[MockChoice]

This would reduce the complexity while maintaining the same functionality.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12e59a5 and 6e3c9b7.

📒 Files selected for processing (1)
  • src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py

9-9: pytest imported but unused

Remove unused import: pytest

(F401)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: quick-test
  • GitHub Check: test-core (3.11)
  • GitHub Check: test-core (3.11)
  • GitHub Check: quick-test
🔇 Additional comments (2)
src/praisonai/tests/unit/agent/test_mini_agents_sequential.py (2)

89-131: Test implementation looks solid.

The test function properly mocks the litellm.completion call, creates appropriate agents, and validates the sequential data passing behavior. The assertions are comprehensive and the expected behavior is clearly defined.


133-134: Standard main execution block.

The main block allows for standalone test execution, which is useful for debugging and development.

import sys
import os
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect path manipulation.

The current path insertion attempts to add a 'src' subdirectory relative to the test file location, but this would point to a non-existent directory (src/praisonai/tests/unit/agent/src/). Since this test file is already within the src/praisonai/ structure, this path manipulation is unnecessary and incorrect.

-sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))

The import on line 12 should work correctly without this path manipulation since the test is being run from the proper directory context according to the updated GitHub Actions workflows.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
🤖 Prompt for AI Agents
In src/praisonai/tests/unit/agent/test_mini_agents_sequential.py at line 10,
remove the line that inserts 'src' into sys.path because it incorrectly
constructs a path that does not exist relative to the test file. Since the test
runs within the correct directory context, this path manipulation is unnecessary
and should be deleted to avoid import errors.

@MervinPraison MervinPraison merged commit 4bba927 into main May 28, 2025
14 of 17 checks passed
shaneholloman pushed a commit to shaneholloman/praisonai that referenced this pull request Feb 4, 2026
Remove unused agent files and clean up test directory by deleting obs…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant