Expand description
Async extension loading orchestration.
The chat UI owns the manager behind an async lock; this module keeps startup snappy by running discovery/loading in the background and streaming progress events back to the UI (which can render them as toasts).
Enums§
Functions§
- emit_
session_ end - Session-level: fire
on_session_endfor one session — concurrent dispatch (the hook only allowscontinue, so ordering cannot matter), fail-open underbudget. Clears the session’s keyed injection afterwards. Returnsfalseif the budget elapsed (handlers may not have flushed; the transcript is already saved by the caller, so nothing is lost). Per session, not per process: every session in a daemon gets its own end event. - emit_
session_ start - Session-level: fire
on_session_startfor one session and store anyinjectas that session’s keyed injection (stream.rsreads it when composing the system prompt). Call AFTER discovery is known-finished — in-process hosts get that fromspawn_discover_and_loaditself; the daemon’sSessionActorawaitsEngineHost::extensions_ready()first. Never re-runs discovery. Returnstruewhen something was injected. - spawn_
discover_ and_ load - Discover and load extensions in the background, then fire
on_session_start.