mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 20:34:32 +00:00
fix: normalize delivery routing context
Co-authored-by: adam91holt <adam91holt@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from "../infra/restart-sentinel.js";
|
||||
import { enqueueSystemEvent } from "../infra/system-events.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { deliveryContextFromSession, mergeDeliveryContext } from "../utils/delivery-context.js";
|
||||
import { loadSessionEntry } from "./session-utils.js";
|
||||
|
||||
export async function scheduleRestartSentinelWake(params: { deps: CliDeps }) {
|
||||
@@ -28,12 +29,11 @@ export async function scheduleRestartSentinelWake(params: { deps: CliDeps }) {
|
||||
}
|
||||
|
||||
const { cfg, entry } = loadSessionEntry(sessionKey);
|
||||
const lastChannel = entry?.lastChannel;
|
||||
const lastTo = entry?.lastTo?.trim();
|
||||
const parsedTarget = resolveAnnounceTargetFromKey(sessionKey);
|
||||
const channelRaw = lastChannel ?? parsedTarget?.channel;
|
||||
const origin = mergeDeliveryContext(deliveryContextFromSession(entry), parsedTarget ?? undefined);
|
||||
const channelRaw = origin?.channel;
|
||||
const channel = channelRaw ? normalizeChannelId(channelRaw) : null;
|
||||
const to = lastTo || parsedTarget?.to;
|
||||
const to = origin?.to;
|
||||
if (!channel || !to) {
|
||||
enqueueSystemEvent(message, { sessionKey });
|
||||
return;
|
||||
@@ -43,7 +43,7 @@ export async function scheduleRestartSentinelWake(params: { deps: CliDeps }) {
|
||||
channel,
|
||||
to,
|
||||
cfg,
|
||||
accountId: parsedTarget?.accountId ?? entry?.lastAccountId,
|
||||
accountId: origin?.accountId,
|
||||
mode: "implicit",
|
||||
});
|
||||
if (!resolved.ok) {
|
||||
|
||||
Reference in New Issue
Block a user