Routines
RoutineEngineV2 — Two Triggers
LVIS's routine engine is a single implementation at src/routines/v2/routine-engine-v2.ts (v2-only). Only two triggers exist: 'shutdown' and 'schedule.' Each routine fire creates a brand-new dedicated ConversationLoop instance, isolated from the interactive main loop.
schedule
src/routines/cron-evaluator.ts. Examples: every day at 09:00, every Friday at 17:00.shutdown
Registering a Routine (mockup)
Trigger
Conversation seed
- user: "Put together the daily briefing"
- → work_assistant_generate_daily_briefing
- → Result shown as a card in the chat body
Firing stages
- 01
Registration — UI or plugin manifest
The user adds one from the RoutinePanel, or a plugin manifest provides the
routine-providercapability together with a recommended routine. - 02
Scheduler registration
src/main/routines-scheduler.tsbooks the time trigger with an OS timer. The shutdown trigger is registered on the host's lifecycle hook. - 03
Per-fire fresh ConversationLoop
isolationA new ConversationLoop instance is created at fire time. It is isolated from the interactive main loop's memory / permissions / TODOs.
- 04
Session recording
The message stream and tool calls for a single fire are appended as JSONL to
~/.lvis/routine/sessions/<routineId>/<firedAt>.jsonl. - 05
Result surfaced
On completion, a "routine run complete" card appears in the chat body. On failure, it goes to the audit log and the next fire proceeds normally.
routine-engine-v2.ts:5-7). The literal identifier Q9 does not appear anywhere in the source.