[codex] Improve crew run missing script error#6306
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
There was a problem hiding this comment.
Summary: This PR adds validation that expected pyproject.toml scripts exist before invoking uv for crew and flow runs, reducing accidental execution attempts from unrelated directories. No exploitable security vulnerabilities were identified in the added code.
Risk: Low risk. The changes affect local CLI control flow and error handling, do not introduce new network-facing surfaces, authentication changes, sensitive data handling, or unsafe subprocess argument construction.
dac0e16 to
3fabc55
Compare
|
Updated after retesting the generated-project repro. The PR now also scans immediate child directories for a runnable CrewAI project and includes a concrete next step when the user is still in the parent folder, e.g. The generated |
Summary
Closes #6305.
run_crewproject script before invokinguv.kickoffproject script before invokinguv.[tool.crewai]but still define the expectedrun_crewscript.Root Cause
crewai runtreated any non-JSON, non-flow project as a classic crew project and calleduv run run_crewwithout checking whether the currentpyproject.tomlactually exposed that script. Running from a parent repository or unrelated Python project therefore surfaced uv's raw spawn failure instead of actionable CrewAI guidance.Validation
uv run pytest lib/cli/tests/test_run_crew.pyuv run pytest lib/crewai/tests/cli/test_run_crew.pyuv run ruff check lib/cli/src/crewai_cli/run_crew.py lib/cli/tests/test_run_crew.pycrewai runfrom the repo root viaPYTHONPATH=lib/cli/src:lib/crewai-core/src uv run python -m crewai_cli.cli runand confirmed it now reports the missing project script with directory guidance.