From a640e2daed28f37199b4874cd97e3f502a2970da Mon Sep 17 00:00:00 2001 From: pr-merge-worker Date: Sat, 9 May 2026 20:22:30 +0000 Subject: [PATCH] fix(actor): move namespace filter inside lock in ActorLoader.list_actors ISSUES CLOSED: #8588 Replace type: ignore suppressions with cast() + getattr() per review feedback. --- features/steps/actor_loading_steps.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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