Files
letta-server/letta/services/tool_manager.py
github-actions[bot] bfb08e77f8 fix: prevent deadlock in bulk tool upsert by sorting tools by name (#8667)
When multiple concurrent transactions try to upsert the same tools,
they can deadlock if they acquire row locks in different orders.

This fix sorts tools by name before the bulk INSERT to ensure all
transactions acquire locks in a consistent order, preventing deadlocks.

Fixes #8666

🤖 Generated with [Letta Code](https://letta.com)

Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com>
Co-authored-by: datadog-official[bot] <datadog-official[bot]@users.noreply.github.com>
Co-authored-by: Letta <noreply@letta.com>
Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com>
2026-01-19 15:54:38 -08:00

63 KiB