[BUG] crewai create flow builds a project that cannot be imported for names like "News v2.0"

オープン
#9,761 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Kiko0301 がすでに取り組んでいます。

2026年11月25日 から。

  • #9765 @Kiko0301 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

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 ContentCrew
  • lib/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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crewAIInc/crewAI のほかの issue

crewAIInc/crewAI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。