From 44a66eb7d3580875afc53cf919e085511e8f5f43 Mon Sep 17 00:00:00 2001 From: Tiago Freire Date: Thu, 23 Apr 2026 10:51:58 -0300 Subject: [PATCH] test(crew): align flow-context assertions with execution_id (COR-48) Two Crew flow-context tests still asserted that `Crew._flow_id` and `Crew._request_id` equal `flow.flow_id`. After COR-48 switched the `current_flow_id` / `current_flow_request_id` ContextVars to seed from `execution_id`, `FlowTrackable` children now capture the execution tracking key rather than `state.id`, so the old assertions fail whenever the two UUIDs diverge. Updates `test_sets_flow_context_when_using_crewbase_pattern_inside_flow` and `test_sets_flow_context_when_inside_flow` to compare against `flow.execution_id`, matching the new correlation contract. --- lib/crewai/tests/test_crew.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/crewai/tests/test_crew.py b/lib/crewai/tests/test_crew.py index 3d6fe4602..c3b8127a9 100644 --- a/lib/crewai/tests/test_crew.py +++ b/lib/crewai/tests/test_crew.py @@ -4519,8 +4519,8 @@ def test_sets_flow_context_when_using_crewbase_pattern_inside_flow(): flow.kickoff() assert captured_crew is not None - assert captured_crew._flow_id == flow.flow_id # type: ignore[attr-defined] - assert captured_crew._request_id == flow.flow_id # type: ignore[attr-defined] + assert captured_crew._flow_id == flow.execution_id # type: ignore[attr-defined] + assert captured_crew._request_id == flow.execution_id # type: ignore[attr-defined] def test_sets_flow_context_when_outside_flow(researcher, writer): @@ -4554,8 +4554,8 @@ def test_sets_flow_context_when_inside_flow(researcher, writer): flow = MyFlow() result = flow.kickoff() - assert result._flow_id == flow.flow_id # type: ignore[attr-defined] - assert result._request_id == flow.flow_id # type: ignore[attr-defined] + assert result._flow_id == flow.execution_id # type: ignore[attr-defined] + assert result._request_id == flow.execution_id # type: ignore[attr-defined] def test_reset_knowledge_with_no_crew_knowledge(researcher, writer):