Expand description
Engine setup — boot sequence shared by TUI and headless modes.
Extracts the initialization logic that was previously inlined in chatui/mod.rs so both renderers can use the same boot path.
Structs§
- Background
Tasks - Background tasks spawned during boot. Aborts on drop.
- Continue
Info - Info about how a continued session was resolved.
- Engine
Boot - Result of the boot sequence — everything a renderer needs to start.
- Engine
Opts - Options for engine boot.
Functions§
- boot
- Run the full engine boot sequence: config → system prompt → skills → MCP → session → sockets → extensions
- lock_
session - The session lock for a
boot()host that drivesRuntimeitself (rpc,synaps server). Continuing a session that another process (a TUI, the daemon, another rpc) holds is REFUSED: two writers would fork its history and the older one’s saves would overwrite the newer’s. So is continuing a session already compacted into a successor (its history is closed). A fresh session, or a lock that cannot be taken for another reason (e.g. a read-only sessions dir), proceeds best-effort, as the session actor does. The lock is held for the returned value’s lifetime; a holder that continued a session runs crash recovery (recover_turn_draft). - recover_
turn_ draft - Crash recovery: if
sessions/<id>.turnexists, the process that last ran this session died with a turn open. Fold the draft into the history (engine::interrupt::recover_crashed_turn), persist that, THEN remove the draft.