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
I'll investigate how isolated cron sessions and stable session keys interact with LCM context in the codebase.
- Assistant
Implementing isolated-cron session rollover: adding a session-key detector and wiring rotation into bootstrap, assemble, and afterTurn.
- Assistant
Fixed isolated cron context leakage when runs reuse a stable session key.
Problem
Isolated cron jobs reuse stable keys like
agent:main:cron:nightly, but each run gets a new runtimesessionId.getOrCreateConversationlooked up bysessionKeyand reattached to the prior active conversation, so summaries and messages from earlier runs leaked into the new run.Solution
Added detection for stable isolated cron session keys (
agent:*:cron:*, excluding per-run keys likeagent:main:cron:nightly:run:run-123) and rotation before bootstrap, assemble, and afterTurn when:- the session key is a stable isolated cron key
- an active conversation exists for that key
- the runtime
sessionIddiffers
That archives the prior conversation and creates a fresh active row for the current run — same pattern as
/resetandsession_end.Behavior preserved
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.