mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-09-18 22:22:21 +02:00
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:
@@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user