fix(ci): repair suspension lane lint errors and stale deadcode entry

This commit is contained in:
Peter Steinberger
2026-07-13 04:18:05 -07:00
parent 4b6575636f
commit faef57e138
3 changed files with 19 additions and 18 deletions
-1
View File
@@ -1914,7 +1914,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
"src/config/sessions/transcript.ts: TailAssistantTranscriptText",
"src/config/sessions/types.ts: LaneExecutionState",
"src/config/sessions/types.ts: mergeSessionEntryWithPolicy",
"src/config/sessions/types.ts: QuotaSuspension",
"src/config/sessions/types.ts: SessionAcpIdentitySource",
"src/config/sessions/types.ts: SessionAcpIdentityState",
"src/config/sessions/types.ts: SessionChannelId",
+12 -7
View File
@@ -94,7 +94,7 @@ function getSessionSuspensionState(): SessionSuspensionRuntimeState {
}
>();
}
if (!state.suspensionWriteChain) {
if (state.suspensionWriteChain === undefined) {
state.suspensionWriteChain = Promise.resolve();
}
return state;
@@ -136,12 +136,15 @@ function resolveLaneResumeConcurrency(cfg: OpenClawConfig | undefined, laneId: s
}
function isGatewayManagedLane(laneId: string): boolean {
// Lane ids are open strings (plugins mint their own); narrow once so the
// membership check compares within the enum.
const lane = laneId as CommandLane;
return (
laneId === CommandLane.Main ||
laneId === CommandLane.Subagent ||
laneId === CommandLane.Cron ||
laneId === CommandLane.CronNested ||
laneId === CommandLane.Nested
lane === CommandLane.Main ||
lane === CommandLane.Subagent ||
lane === CommandLane.Cron ||
lane === CommandLane.CronNested ||
lane === CommandLane.Nested
);
}
@@ -324,7 +327,9 @@ async function suspendSessionQueued(params: SessionSuspensionParams, queuedGener
resolveLaneResumeConcurrency(params.cfg, params.laneId),
);
};
let persistedSuspension = false;
// Assigned at the end of the try; the catch path returns, so every read
// below sees the real patch outcome.
let persistedSuspension: boolean;
try {
const patchedEntry = await patchSessionEntry(
+7 -10
View File
@@ -28,11 +28,11 @@ export function applyGatewayLaneConcurrency(
concurrency: GatewayLaneConcurrency,
opts: { gatewayStart?: boolean } = {},
): void {
let suspendedLaneIds: ReadonlySet<string> = new Set<string>();
if (opts.gatewayStart) {
suspendedLaneIds = enableSessionSuspensionTimersForGatewayStart(
(laneId, savedResumeConcurrency) => {
switch (laneId) {
// Lane ids are open strings (plugins mint their own); narrow once so the
// gateway-managed cases compare within the enum.
const suspendedLaneIds: ReadonlySet<string> = opts.gatewayStart
? enableSessionSuspensionTimersForGatewayStart((laneId, savedResumeConcurrency) => {
switch (laneId as CommandLane) {
case CommandLane.Cron:
case CommandLane.CronNested:
return concurrency.cron;
@@ -45,11 +45,8 @@ export function applyGatewayLaneConcurrency(
default:
return savedResumeConcurrency;
}
},
);
} else {
suspendedLaneIds = getCleanupSuspendedLaneIdsForGatewayPublication();
}
})
: getCleanupSuspendedLaneIdsForGatewayPublication();
// Resolution is deliberately separate: this commit-edge applier only updates
// live queue state and cannot reject a config midway through publication.
if (!suspendedLaneIds.has(CommandLane.Cron)) {