mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
refactor(agents): move busy_mutex middleware into main_agent (owner)
The busy-mutex impl (BusyMutexMiddleware + cancel/turn-lifecycle primitives) lived in shared/middleware/ but no subagent uses it -- consumers are the main_agent builder and the boundary (turn lifecycle). Colocate with its owner using the folder-per-middleware shape; __init__ re-exports the public surface so boundary import sites only change package path: main_agent/middleware/busy_mutex.py -> busy_mutex/builder.py shared/middleware/busy_mutex.py -> busy_mutex/middleware.py
This commit is contained in:
parent
6b1da64182
commit
a7a642fedc
9 changed files with 39 additions and 13 deletions
|
|
@ -0,0 +1,25 @@
|
|||
"""Per-turn cooperative busy-lock middleware + cancel primitives (main-agent)."""
|
||||
|
||||
from .builder import build_busy_mutex_mw
|
||||
from .middleware import (
|
||||
BusyMutexMiddleware,
|
||||
end_turn,
|
||||
get_cancel_event,
|
||||
get_cancel_state,
|
||||
is_cancel_requested,
|
||||
manager,
|
||||
request_cancel,
|
||||
reset_cancel,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"BusyMutexMiddleware",
|
||||
"build_busy_mutex_mw",
|
||||
"end_turn",
|
||||
"get_cancel_event",
|
||||
"get_cancel_state",
|
||||
"is_cancel_requested",
|
||||
"manager",
|
||||
"request_cancel",
|
||||
"reset_cancel",
|
||||
]
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from app.agents.chat.multi_agent_chat.shared.feature_flags import AgentFeatureFlags
|
||||
from app.agents.chat.multi_agent_chat.shared.middleware.busy_mutex import (
|
||||
from app.agents.chat.multi_agent_chat.shared.middleware.flags import enabled
|
||||
|
||||
from .middleware import (
|
||||
BusyMutexMiddleware,
|
||||
)
|
||||
from app.agents.chat.multi_agent_chat.shared.middleware.flags import enabled
|
||||
|
||||
|
||||
def build_busy_mutex_mw(flags: AgentFeatureFlags) -> BusyMutexMiddleware | None:
|
||||
Loading…
Add table
Add a link
Reference in a new issue