Files
openclaw/src/agents/pi-embedded-runner/lanes.ts
Vincent Koc 28b0d8e8bd fix(cron): prevent isolated cron nested lane deadlocks (#45459)
* fix(cron): resolve isolated session deadlock (#44805)

Map cron lane to nested in resolveGlobalLane to prevent deadlock when
isolated cron jobs trigger inner operations (e.g. compaction). Outer
execution holds the cron lane slot; inner work now uses nested lane.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(changelog): add cron isolated deadlock note

---------

Co-authored-by: zhujian <zhujianxyz@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:19:40 -07:00

20 lines
624 B
TypeScript

import { CommandLane } from "../../process/lanes.js";
export function resolveSessionLane(key: string) {
const cleaned = key.trim() || CommandLane.Main;
return cleaned.startsWith("session:") ? cleaned : `session:${cleaned}`;
}
export function resolveGlobalLane(lane?: string) {
const cleaned = lane?.trim();
// Cron jobs hold the cron lane slot; inner operations must use nested to avoid deadlock.
if (cleaned === CommandLane.Cron) {
return CommandLane.Nested;
}
return cleaned ? cleaned : CommandLane.Main;
}
export function resolveEmbeddedSessionLane(key: string) {
return resolveSessionLane(key);
}