diff --git a/features/steps/actor_loading_steps.py b/features/steps/actor_loading_steps.py index aef633234..86756c5bc 100644 --- a/features/steps/actor_loading_steps.py +++ b/features/steps/actor_loading_steps.py @@ -9,6 +9,7 @@ from pathlib import Path from behave import given, then, when from behave.runner import Context +from typing import cast from cleveragents.actor.loader import ActorLoader from cleveragents.actor.schema import ActorConfigSchema @@ -451,8 +452,8 @@ def step_when_concurrent_list_actors_with_clear( @then("all concurrent list_actors calls should return consistent results") def step_then_concurrent_results_consistent(context: Context) -> None: """Verify that all concurrent list_actors calls returned consistent results.""" - results: list[list[ActorConfigSchema]] = context._concurrent_list_results # type: ignore[assignment] - namespace: str = context._concurrent_namespace # type: ignore[assignment] + results = cast(list[list[ActorConfigSchema]], getattr(context, "_concurrent_list_results", [])) + namespace = cast(str, getattr(context, "_concurrent_namespace", "")) # Each result should only contain actors from the requested namespace. # When clear() runs concurrently, some threads may see the full list while