Isolated cron runs leak context when they reuse a stable session key Different isolated…
- User
Isolated cron runs leak context when they reuse a stable session key
Different isolated cron runtime sessions that reuse a stable session key must not share active LCM context. Prior runs remain archived, compaction within the current run still works, and ordinary non-cron session continuity is unchanged.
Interface
No new public interfaces are introduced.
- Assistant
Now let me look at the compact entry and
shouldIgnoreSession: - Assistant
Now the engine. Update the import and add the rotation guard method:
- Assistant
Now wire the guard into the four attach points. First, bootstrap:
- Assistant
Next, the afterTurn transcript reconcile transaction:
- Assistant
Next, assemble's lifecycle guard:
- Assistant
Typecheck passes. Now add tests. First look at the session-patterns test:
- Assistant
Now add engine tests after the assemble-ambiguous-rollover test:
- Assistant
All 4 new engine tests pass. Now run the full test suite:
- Assistant
The repo uses changesets for releases — add one to match convention:
- Assistant
Done. The fix is complete and verified.
Root cause
Isolated cron runs get a fresh runtime
sessionIdand transcript per run but reuse a stable session key (). On the next run, resolved the prior run's conversation by session key and rebound it to the new (src/store/conversation-store.ts:497). The existing fail-closed guards () only blocked bootstrap/assemble — the first ingest/afterTurn still rebound the row, after which assemble served the previous run's summaries and messages into the new run's context.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.