fix: Address PR review comments

- Change Crew.verbose field type from bool to bool | None to allow env var check
- Remove unused imports (StringIO, pytest) from test file

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2026-01-30 20:14:03 +00:00
parent f24857c56b
commit 22ae9ef78e
2 changed files with 7 additions and 4 deletions

View File

@@ -193,7 +193,13 @@ class Crew(FlowTrackable, BaseModel):
tasks: list[Task] = Field(default_factory=list)
agents: list[BaseAgent] = Field(default_factory=list)
process: Process = Field(default=Process.sequential)
verbose: bool = Field(default=False)
verbose: bool | None = Field(
default=None,
description=(
"Whether to enable verbose logging output. True=always enable, "
"False=always disable, None=check CREWAI_VERBOSE env var (defaults to True if not set)."
),
)
memory: bool = Field(
default=False,
description="If crew should use memory to store memories of it's execution",

View File

@@ -1,11 +1,8 @@
"""Test verbose control for Flow and Crew."""
import os
from io import StringIO
from unittest.mock import patch
import pytest
from crewai.events.event_listener import EventListener
from crewai.flow.flow import Flow, start, listen
from crewai.utilities.logger_utils import should_enable_verbose