Skip to content

fix(cli): prevent traceback when reset-memories finds no crews or flows#5998

Open
aryxnn wants to merge 1 commit into
crewAIInc:mainfrom
aryxnn:fix-reset-memories-traceback
Open

fix(cli): prevent traceback when reset-memories finds no crews or flows#5998
aryxnn wants to merge 1 commit into
crewAIInc:mainfrom
aryxnn:fix-reset-memories-traceback

Conversation

@aryxnn
Copy link
Copy Markdown

@aryxnn aryxnn commented Jun 1, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling when resetting memories without an active crew or flow. Users now receive a clear message instead of an exception.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c9af9029-ac50-4699-89c6-e481ddc735d3

📥 Commits

Reviewing files that changed from the base of the PR and between 4dafb05 and e217479.

📒 Files selected for processing (1)
  • lib/crewai/src/crewai/utilities/reset_memories.py

📝 Walkthrough

Walkthrough

The reset_memories_command function in the utilities module changes its error handling for the edge case when no crews or flows exist. Instead of raising a ValueError, it now prints a user-friendly Click error message and exits gracefully.

Changes

Error handling for reset memories command

Layer / File(s) Summary
Error handling for missing crews/flows
lib/crewai/src/crewai/utilities/reset_memories.py
When both get_crews() and get_flows() return empty results, the function emits a Click error message and returns early instead of raising a ValueError.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 When crews and flows both fade away,
A gentle message saves the day—
No exception raised in haste,
Just a click, a graceful taste!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting a ValueError exception into a graceful error message when no crews or flows are found, preventing a traceback.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant