Skip to content

refactor(tools): migrate stagehand example off deprecated crewai.utilities.printer#6523

Open
AnandSundar wants to merge 1 commit into
crewAIInc:mainfrom
AnandSundar:refactor/printer-deprecation-migration
Open

refactor(tools): migrate stagehand example off deprecated crewai.utilities.printer#6523
AnandSundar wants to merge 1 commit into
crewAIInc:mainfrom
AnandSundar:refactor/printer-deprecation-migration

Conversation

@AnandSundar

Copy link
Copy Markdown

Summary

The crewai.utilities.printer module is a deprecated wrapper that re-exports Printer from crewai_core.printer and emits a DeprecationWarning on every import. The stagehand example script was the only remaining internal caller of the deprecated wrapper.

This PR migrates the single internal import to the supported path, eliminating the spurious DeprecationWarning without any behavioral change.

Deprecation source

lib/crewai/src/crewai/utilities/printer.py docstring:

"Deprecated: use crewai_core.printer instead."

The same wrapper also emits a DeprecationWarning at import time:

"crewai.utilities.printer is deprecated; import from crewai_core.printer."

Impact

  • No external behavior change. Printer is the same class at both import paths (the deprecated wrapper re-exports it unchanged).
  • Removes a spurious DeprecationWarning that fired on every import of the stagehand example script.
  • No public API change. External code that imports from crewai.utilities.printer is unaffected; the deprecated wrapper itself is unchanged.

Files changed

  • lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/example.py (1 line)

Verification

  • uv run ruff check and uv run ruff format --check clean on the changed file.
  • uv run mypy clean on the changed file.
  • uv run pytest lib/crewai-tools/tests -- no new failures introduced by the change.

…ities.printer

The crewai.utilities.printer module is a deprecated wrapper that re-exports Printer from crewai_core.printer and emits a DeprecationWarning on every import (see lib/crewai/src/crewai/utilities/printer.py).

The stagehand example was the only remaining internal caller of the deprecated wrapper. Importing it triggered the warning even though no deprecated behavior was actually being used, since the same Printer class is exposed at both paths.

Migrating the import to crewai_core.printer removes the spurious DeprecationWarning without any behavioral change.
@coderabbitai

coderabbitai Bot commented Jul 12, 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: 1b3c7dee-b868-4a03-876b-1d5386e75707

📥 Commits

Reviewing files that changed from the base of the PR and between fb8e93b and 0c498eb.

📒 Files selected for processing (1)
  • lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/example.py

📝 Walkthrough

Walkthrough

The Stagehand example updates its Printer import from crewai.utilities.printer to crewai_core.printer without changing other logic or wiring.

Changes

Stagehand Example

Layer / File(s) Summary
Update Printer import
lib/crewai-tools/src/crewai_tools/tools/stagehand_tool/example.py
The example imports Printer from crewai_core.printer instead of crewai.utilities.printer.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change: migrating the stagehand example off the deprecated printer import.
Description check ✅ Passed The description accurately explains the import migration and its effect on the DeprecationWarning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

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