fix(gateway): include deliveryContext in update.run restart sentinel (#18239)

This commit is contained in:
yinghaosang
2026-02-17 01:08:12 +08:00
committed by Peter Steinberger
parent d43c11c76d
commit aeec95f870
2 changed files with 138 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import type { GatewayRequestHandlers } from "./types.js";
import { loadConfig } from "../../config/config.js";
import { extractDeliveryInfo } from "../../config/sessions.js";
import { resolveOpenClawPackageRoot } from "../../infra/openclaw-root.js";
import {
formatDoctorNonInteractiveHint,
@@ -19,6 +20,7 @@ export const updateHandlers: GatewayRequestHandlers = {
return;
}
const { sessionKey, note, restartDelayMs } = parseRestartRequestParams(params);
const { deliveryContext, threadId } = extractDeliveryInfo(sessionKey);
const timeoutMsRaw = (params as { timeoutMs?: unknown }).timeoutMs;
const timeoutMs =
typeof timeoutMsRaw === "number" && Number.isFinite(timeoutMsRaw)
@@ -56,6 +58,8 @@ export const updateHandlers: GatewayRequestHandlers = {
status: result.status,
ts: Date.now(),
sessionKey,
deliveryContext,
threadId,
message: note ?? null,
doctorHint: formatDoctorNonInteractiveHint(),
stats: {