fix: thread-safe _get_loop_agent singleton #450

Closed
kimi wants to merge 0 commits from kimi/issue-446 into main
Collaborator

Summary

  • Adds threading.Lock with double-checked locking to _get_loop_agent() to prevent race conditions when multiple agentic loops start concurrently
  • Adds thread-safety test using barrier + 4 threads

Fixes #446

## Summary - Adds `threading.Lock` with double-checked locking to `_get_loop_agent()` to prevent race conditions when multiple agentic loops start concurrently - Adds thread-safety test using barrier + 4 threads Fixes #446
kimi added 1 commit 2026-03-19 18:20:03 +00:00
fix: make _get_loop_agent singleton thread-safe with double-checked locking
Some checks failed
Tests / lint (pull_request) Successful in 3s
Tests / test (pull_request) Failing after 59s
57f4f37a9b
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>
Timmy closed this pull request 2026-03-19 18:24:04 +00:00
Owner

Closing — this is a duplicate of PR#449 which was already merged for #446. The branch has conflicts because the work is already on main.

Closing — this is a duplicate of PR#449 which was already merged for #446. The branch has conflicts because the work is already on main.

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#450