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 I'll add the module-level helper next to the related constants:
- Assistant
Now add the cron rotation method and hook it into the existing lifecycle guard:
- Assistant
Now let me refactor so the cron rotation is also enforced on the direct ingest paths (the actual rebinding leak point). First, let me check the engine's
infoand howingestfits the host flow: - Assistant
Now typecheck:
- Assistant
Typecheck passes. Let me look at the idle rollover test for assertion patterns:
- Assistant
Now I'll add regression tests after the assemble ambiguous-rollover test:
- Assistant
All 3 new tests pass. Now the full engine suite:
- Assistant
All 1070 tests pass. Final typecheck and a look at the package scripts for any additional gates:
- Assistant
The fix is complete and verified. Here's a summary:
Problem
Isolated cron runs reuse a stable session key (e.g.
agent:main:cron:daily-digest) while every run is a fresh runtime session with its own transcript. Because the prior run's transcript still exists on disk, the existing missing-transcript rotation never fired and the ambiguous-rollover guard just failed closed. Then the first /afterTurn of the new run hit , which () — after which served the prior run's full LCM context into the new run.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.