Skip to content

test(parser): cover action markdown cleanup#6252

Open
hiSandog wants to merge 1 commit into
crewAIInc:mainfrom
hiSandog:fix/small-cleanup-20260620
Open

test(parser): cover action markdown cleanup#6252
hiSandog wants to merge 1 commit into
crewAIInc:mainfrom
hiSandog:fix/small-cleanup-20260620

Conversation

@hiSandog

@hiSandog hiSandog commented Jun 20, 2026

Copy link
Copy Markdown

Summary:

  • Add parser coverage for Markdown-formatted action names such as ** search **.
  • Assert that asterisks in the action input are preserved while only action-name formatting is stripped.
  • Remove the stale TODO now covered by the regression test.

Validation:

  • python3 -m py_compile lib/crewai/tests/agents/test_crew_agent_parser.py lib/crewai/src/crewai/agents/parser.py
  • git diff --check
  • Not run: pytest. uv dependency sync did not complete in this environment; direct parser execution also failed because pydantic is not installed.

Summary by CodeRabbit

  • Tests
    • Added test case to verify parser correctly strips Markdown formatting from the Action field while preserving special characters within the Action Input field.
    • Removed obsolete placeholder comment.

@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 adds test coverage for Markdown-formatted action names in the agent parser and does not change production parsing logic.

Risk: Low risk. The changes are limited to tests and no exploitable security vulnerabilities were identified.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

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: 2e6d8a26-2408-4cbf-acce-5f60c7b5d86f

📥 Commits

Reviewing files that changed from the base of the PR and between 9db2d44 and 6791001.

📒 Files selected for processing (1)
  • lib/crewai/tests/agents/test_crew_agent_parser.py

📝 Walkthrough

Walkthrough

A new test test_parse_strips_action_markdown_without_touching_input_asterisks is added to test_crew_agent_parser.py to verify that parser.parse() strips Markdown asterisks wrapping the Action: field while leaving asterisks inside the Action Input: content untouched. A trailing TODO comment placeholder tracking this gap is removed.

Changes

Parser Markdown Stripping Test

Layer / File(s) Summary
New test and TODO removal
lib/crewai/tests/agents/test_crew_agent_parser.py
Adds a unit test asserting that parser.parse() removes ** wrapping from the Action: line (e.g., ** search **) but does not alter ** used within Action Input: content (e.g., 2 ** 3). Removes the now-fulfilled trailing TODO comment.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test(parser): cover action markdown cleanup' directly summarizes the main change: adding test coverage for Markdown cleanup in the parser.
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