Uses threading.Lock with double-checked locking pattern to prevent race conditions when multiple agentic loops start concurrently. Fixes #446 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Kimi Agent <kimi@timmy.local> Co-committed-by: Kimi Agent <kimi@timmy.local>