From 2d5e6579316ddf06f126512f52d59401f862b689 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Tue, 10 Mar 2026 10:25:30 +0800 Subject: [PATCH] fix: 2026.3.8 regressions - config crash and cron deadlock Fixes two critical regressions in 2026.3.8: 1. Config Redaction RangeError (#41247, #40818) - Empty strings in sensitive fields caused RangeError - Filter out empty strings before redaction 2. Cron Job Deadlock (#41266, #41128, #41129) - Manual cron runs enqueued but never executed - Use subagent lane to avoid deadlock with cron lane Both fixes are minimal, targeted, and maintain backward compatibility. --- src/config/redact-snapshot.raw.ts | 5 ++++- src/gateway/server-cron.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/redact-snapshot.raw.ts b/src/config/redact-snapshot.raw.ts index 9f6f78a6724..ab063de8105 100644 --- a/src/config/redact-snapshot.raw.ts +++ b/src/config/redact-snapshot.raw.ts @@ -6,7 +6,10 @@ export function replaceSensitiveValuesInRaw(params: { sensitiveValues: string[]; redactedSentinel: string; }): string { - const values = [...params.sensitiveValues].toSorted((a, b) => b.length - a.length); + // FIX #41247: Filter out empty strings to prevent RangeError + const values = [...params.sensitiveValues] + .filter((v) => v && v.length > 0) + .toSorted((a, b) => b.length - a.length); let result = params.raw; for (const value of values) { result = result.replaceAll(value, params.redactedSentinel); diff --git a/src/gateway/server-cron.ts b/src/gateway/server-cron.ts index 1f1cd1f5359..6a76e6043d1 100644 --- a/src/gateway/server-cron.ts +++ b/src/gateway/server-cron.ts @@ -292,7 +292,10 @@ export function buildGatewayCronService(params: { abortSignal, agentId, sessionKey: `cron:${job.id}`, - lane: "cron", + // FIX #41266: Use subagent lane to avoid deadlock with cron lane + // The outer enqueueRun already holds CommandLane.Cron; using "cron" + // here would cause deadlock since cron lane has concurrency=1. + lane: "subagent", }); }, sendCronFailureAlert: async ({ job, text, channel, to, mode, accountId }) => {