SurfSense/surfsense_backend/app/tasks/chat/streaming/flows/shared
CREDO23 a7a642fedc 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
2026-06-05 14:08:45 +02:00
..
__init__.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
assistant_finalize.py chore: linting 2026-05-28 19:21:29 -07:00
finalize_emit.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
finally_cleanup.py chore: linting 2026-05-28 19:21:29 -07:00
first_frames.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
llm_bundle.py refactor(agents): consolidate chat runtime infra under chat/runtime 2026-06-05 13:19:24 +02:00
pre_stream_setup.py refactor(agents): consolidate chat runtime infra under chat/runtime 2026-06-05 13:19:24 +02:00
premium_quota.py refactor(agents): consolidate chat runtime infra under chat/runtime 2026-06-05 13:19:24 +02:00
rate_limit_recovery.py refactor(agents): move busy_mutex middleware into main_agent (owner) 2026-06-05 14:08:45 +02:00
span.py chore: linting 2026-05-28 19:21:29 -07:00
stream_loop.py refactor(agents): introduce chat/ category; dissolve top-level agents/shared 2026-06-05 12:54:02 +02:00
terminal_error.py refactor(agents): consolidate chat runtime infra under chat/runtime 2026-06-05 13:19:24 +02:00