fix(stabilization): harden attachment lifecycle and agent guard signals (#5420)

* fix: harden stabilization attachment and agent guards

* fix(uploads): preserve durable references during cleanup

* fix(uploads): close cleanup and compaction races
This commit is contained in:
falabellamichael
2026-07-11 15:14:14 +01:00
committed by GitHub
parent a02f8d8600
commit c2d2075833
29 changed files with 2718 additions and 189 deletions
+16
View File
@@ -9,6 +9,7 @@ import json
from src.constants import MAX_OUTPUT_CHARS
_mcp_manager = None
_upload_handler = None
# ---------------------------------------------------------------------------
# MCP Manager singleton
@@ -23,6 +24,21 @@ def get_mcp_manager():
"""Get the global MCP manager instance."""
return _mcp_manager
# ---------------------------------------------------------------------------
# Shared upload lifecycle handler
# ---------------------------------------------------------------------------
def set_upload_handler(handler):
"""Register the process's UploadHandler without importing app modules."""
global _upload_handler
_upload_handler = handler
def get_upload_handler():
"""Return the shared UploadHandler used by route and agent writers."""
return _upload_handler
# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------