feat: make conversations throw http busy to stop race condition [LET-6842] (#8411)

* feat: make conversations throw http busy to stop race condition

* use redis lock instead

* move acquire lock into redis client, integration tests, move lock release into run manager

* fix tests, bug

* conditional import

* remove else

* better release

* run ci

* final reordering lock

* update tests

* wrong naming of lock holder token
This commit is contained in:
Ari Webb
2026-01-09 17:34:01 -08:00
committed by Caren Thomas
parent 59c2b19812
commit 6d859174c2
8 changed files with 265 additions and 7 deletions

View File

@@ -33,6 +33,7 @@ from letta.errors import (
AgentNotFoundForExportError,
BedrockPermissionError,
ConcurrentUpdateError,
ConversationBusyError,
EmbeddingConfigRequiredError,
HandleNotFoundError,
LettaAgentNotFoundError,
@@ -496,6 +497,7 @@ def create_application() -> "FastAPI":
app.add_exception_handler(UniqueConstraintViolationError, _error_handler_409)
app.add_exception_handler(IntegrityError, _error_handler_409)
app.add_exception_handler(ConcurrentUpdateError, _error_handler_409)
app.add_exception_handler(ConversationBusyError, _error_handler_409)
app.add_exception_handler(PendingApprovalError, _error_handler_409)
app.add_exception_handler(NoActiveRunsToCancelError, _error_handler_409)