[BUG] crewai create flow builds a project that cannot be imported for names like "News v2.0"
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 61.2k
- フォーク
- 9.2k
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 180
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crewAIInc/crewAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[FEATURE] Add Straitly as a native OpenAI-compatible LLM provider対応中かも @HashimSyedUBC が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native OpenAI sync streaming with response_model returns an empty string and emits no completed event when the parse is missing対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native Azure provider ignores the seed setting対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
crewAIInc/crewAI#9787 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] LiteLLM path reports 0 cached and reasoning tokens in the usage summary対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
crewAIInc/crewAI の issue をすべて見る
似ている issue
-
bug harness
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mruangutai/harness#2687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modal-labs/modal-client#4158 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 72/100
The-Swarm-Corporation/swarms-rs#168 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
linuxserver/docker-healthchecks#137 · コメント 1 件 ·