Skip to content

Fix JSON crew version pin#6342

Merged
joaomdmoura merged 3 commits into
mainfrom
codex/fix-template-version-1-15-0
Jun 26, 2026
Merged

Fix JSON crew version pin#6342
joaomdmoura merged 3 commits into
mainfrom
codex/fix-template-version-1-15-0

Conversation

@joaomdmoura

@joaomdmoura joaomdmoura commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • update JSON crew project scaffolding to pin crewai[tools] from the CLI package version
  • update the missing-package install hint to reference the stable 1.15.0 package
  • update related CLI/archive tests

Tests

  • uv run ruff check lib/cli/src/crewai_cli/create_json_crew.py lib/cli/src/crewai_cli/run_crew.py lib/cli/tests/test_create_crew.py lib/cli/tests/test_run_crew.py lib/cli/tests/deploy/test_archive.py
  • uv run pytest lib/cli/tests/test_create_crew.py lib/cli/tests/test_run_crew.py lib/cli/tests/deploy/test_archive.py

Note

Low Risk
Scaffolding and user-facing install text only; no runtime crew execution or dependency resolution logic changes beyond what new projects declare in pyproject.toml.

Overview
Generated projects no longer pin a fixed crewai[tools]==… (including old prerelease strings). get_crewai_dependency_range and get_crewai_tools_dependency in version.py build a constraint from the installed CLI version: >=that version,<next major.0.0 (e.g. crewai[tools]>=1.15.0,<2.0.0).

That value is wired through JSON crew creation, flow/crew/tool templates, copy_template, and custom tool scaffolding via the {{crewai_tools_dependency}} placeholder. The “CLI without crewai” install hint in run_crew now uses the same helper and drops prerelease-only wording.

Tests were updated to assert the new range in generated pyproject.toml files and install messages.

Reviewed by Cursor Bugbot for commit 218b48c. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Generated pyproject.toml files now use the correct crewai[tools] dependency range based on the installed CLI/next supported major version, instead of a fixed prerelease pin.
    • Template-based project, flow, and tool scaffolding now consistently inject the computed crewai[tools] constraint.
    • Updated the “missing dependency” install hint to match the new recommended crewai[tools] range.
  • Tests
    • Refreshed and expanded assertions to validate the new crewai[tools]>=...<... dependency behavior in generated artifacts.

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary: This PR updates JSON crew scaffolding and installation guidance to pin crewai[tools] to the CLI package version. No exploitable security vulnerabilities were identified in the added code.

Risk: Low risk. The changes affect dependency version strings and user-facing install guidance, without introducing new authentication, authorization, data handling, or network-exposed functionality.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CLI now computes a bounded crewai[tools] dependency range from its version, injects it into generated pyproject.toml files and install hints, and updates tests to assert the new range.

Changes

Dynamic CrewAI tools dependency

Layer / File(s) Summary
Version helpers
lib/cli/src/crewai_cli/version.py, lib/cli/tests/test_version.py
version.py adds helpers that compute a major-bounded dependency range and a crewai[tools] requirement string, and the version tests verify both outputs.
Template placeholders
lib/cli/src/crewai_cli/templates/.../pyproject.toml
The crew, flow, declarative flow, and tool templates now use {{crewai_tools_dependency}} instead of hardcoded crewai[tools] version pins.
Scaffolding wiring
lib/cli/src/crewai_cli/create_json_crew.py, lib/cli/src/crewai_cli/create_flow.py, lib/cli/src/crewai_cli/utils.py, lib/cli/src/crewai_cli/tools/main.py, lib/cli/src/crewai_cli/run_crew.py, lib/cli/tests/deploy/test_archive.py, lib/cli/tests/test_create_crew.py, lib/cli/tests/test_run_crew.py, lib/cli/tests/tools/test_main.py
Project generation, copied templates, tool creation, and the missing-package install hint now substitute the computed dependency string, and the related tests assert the bounded range in generated files and CLI output.

Suggested reviewers

  • vinibrsl
  • gabemilani
  • greysonlalonde
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the core change: updating the JSON crew scaffold to use a computed dependency version pin.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-template-version-1-15-0

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

Comment @coderabbitai help to get the list of available commands.

@joaomdmoura joaomdmoura merged commit f364a7d into main Jun 26, 2026
55 checks passed
@joaomdmoura joaomdmoura deleted the codex/fix-template-version-1-15-0 branch June 26, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants