fix(providers): add threading lock to get_provider_registry() singleton #10742

Merged
HAL9000 merged 1 commits from bugfix/mN-registry-thread-safety into master 2026-06-06 12:50:39 +00:00

1 Commits

Author SHA1 Message Date
HAL9000 e1cd306f6f fix(providers): add threading lock to get_provider_registry() singleton
CI / push-validation (pull_request) Successful in 40s
CI / helm (pull_request) Successful in 46s
CI / build (pull_request) Successful in 53s
CI / lint (pull_request) Successful in 1m16s
CI / quality (pull_request) Successful in 1m22s
CI / typecheck (pull_request) Successful in 1m29s
CI / security (pull_request) Successful in 1m28s
CI / unit_tests (pull_request) Successful in 6m30s
CI / docker (pull_request) Successful in 1m47s
CI / integration_tests (pull_request) Successful in 10m48s
CI / coverage (pull_request) Successful in 11m33s
CI / status-check (pull_request) Successful in 3s
Added import threading to src/cleveragents/providers/registry.py to enable a module-level lock.
Defined _registry_lock: threading.Lock = threading.Lock() at module scope.
Wrapped get_provider_registry() body with with _registry_lock: to ensure thread-safety.
Wrapped reset_provider_registry() body with with _registry_lock: to ensure thread-safety.
Added TDD support: features/tdd_registry_thread_safety.feature with @tdd_issue @tdd_issue_10409 @mock_only.
Added step definitions: features/steps/tdd_registry_thread_safety_steps.py.

ISSUES CLOSED: #10478
2026-06-06 08:23:24 -04:00