[BUG] crewai create flow builds a project that cannot be imported for names like "News v2.0"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Read create_flow in lib/cli/src/crewai_cli/create_flow.py next to create_folder_structure in lib/cli/src/crewai_cli/create_crew.py, which already does the sanitising and rejection you want to mirror. Then open the templates under lib/cli/src/crewai_cli/templates/flow/ (main.py, pyproject.toml) to confirm the folder name is used as the package. Done means lib/cli/tests/test_create_flow.py no longer pins news_v2.0 and instead covers a stripped name plus a click.BadParameter rejection. Note a pull request (#9765) is already open against this issue, so check it before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
crewai create flow derives the project's folder name with only two replacements:
folder_name = name.replace(" ", "_").replace("-", "_").lower()
(lib/cli/src/crewai_cli/create_flow.py, in create_flow). That folder name is used verbatim as the Python package of the generated project:
lib/cli/src/crewai_cli/templates/flow/main.py:8-from {{folder_name}}.crews.content_crew.content_crew import ContentCrewlib/cli/src/crewai_cli/templates/flow/pyproject.toml-[project].name = "{{folder_name}}"and every[project.scripts]entry point ({{folder_name}}.main:kickoff, ...)
Any character a Python module name cannot hold therefore produces a project that cannot be imported. create_flow still prints Flow <name> created successfully! and exits 0.
create_crew (lib/cli/src/crewai_cli/create_crew.py::create_folder_structure) already handles this: after the same replacements it strips every other character (re.sub(r"[^a-zA-Z0-9_]", "", folder_name)) and rejects names that still cannot be a module name (empty, digit-first, keyword).
Steps to Reproduce
$ crewai create flow "News v2.0" --skip-provider
Creating flow news_v2.0...
Flow News v2.0 created successfully!
...
$ cd news_v2.0
$ python -c "import news_v2.0.main"
File ".../news_v2.0/src/news_v2.0/main.py", line 8
from news_v2.0.crews.content_crew.content_crew import ContentCrew
^^^^^^^^^
SyntaxError: invalid syntax
crewai create flow '!!!' creates a project in a folder literally named !!! whose main.py contains from !!!.crews...; crewai create flow '123bad' creates 123bad/ with an import starting with a digit. All three report success with exit status 0.
The same behavior is currently pinned by lib/cli/tests/test_create_flow.py::test_create_flow_returns_the_folder_it_created, which asserts the folder is news_v2.0.
Expected Behavior
crewai create flow should derive the folder/package name the same way crewai create crew does - dropping characters a Python module name cannot contain - and reject a name that cannot become a module name (with click.BadParameter, like the existing --provider validation) instead of writing a project that fails on its first import and reporting success.
AI assistance
I used an AI coding agent to investigate, reproduce, and prepare this report, and reviewed its results. Per CONTRIBUTING.md, please apply the llm-generated label; external contributors cannot add it with my current permissions.
- Ngôn ngữ chính
- Python
- Star
- 61.2k
- Fork
- 9.2k
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 180
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của crewAIInc/crewAI
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[FEATURE] Add Straitly as a native OpenAI-compatible LLM providerCó thể đã có người làm @HashimSyedUBC đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Native OpenAI sync streaming with response_model returns an empty string and emits no completed event when the parse is missingCó thể đã có người làm @basil-k-aji-dev đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Native Azure provider ignores the seed settingCó thể đã có người làm @basil-k-aji-dev đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
crewAIInc/crewAI#9787 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] LiteLLM path reports 0 cached and reasoning tokens in the usage summaryCó thể đã có người làm @basil-k-aji-dev đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của crewAIInc/crewAI
Issue tương tự
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
linuxserver/docker-healthchecks#137 · 1 bình luận ·
-
RequirementAgent treats list -> add -> list as a tool call cycle and drops the second list call (Python)Có thể đã có người làm @chaitanya0305 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
i-am-bee/beeai-framework#2049 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fedora-infra/anitya#2272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
unitaryfoundation/mitiq#3205 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
[Bug]: Index worker test drops empty Git config values on WindowsCó thể đã có người làm @xiaoyesoso đã nhận hôm nay. Đang mởtriage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
agentscope-ai/agentscope#4377 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày