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 trace how isolated cron sessions reuse stable session keys and where LCM context is loaded so we can stop cross-run leakage.
- Assistant
Implementing cron session-key detection and rotation logic, mirroring the existing stale-session rollover pattern.
- Assistant
Fixed isolated cron runs leaking LCM context across successive runtime sessions that share the same stable session key.
Problem
Cron lanes like
agent:main:cron:nightlyreuse a stablesessionKeybut get a newsessionIdeach run. Whensession_endwas missed, LCM kept the prior run’s active conversation and updatedsessionIdin place — so the next run inherited summaries, context items, and messages from the last run.Fix
Added
isStableIsolatedCronSessionKey()insession-patterns.tsto distinguish stable cron job keys from per-run keys likeagent:main:cron:nightly:run:run-123.Added
rotateIsolatedCronSessionKeyConversationOnRuntimeChange()inengine.ts, called frombootstrap,assemble, andafterTurn(same lifecycle points as the existing stale-transcript rollover). When a stable cron key arrives with a newsessionId, it archives the prior conversation and creates a fresh active row.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.