import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ConversationRef } from "../infra/outbound/session-binding-service.js"; import { normalizeAccountId } from "../routing/session-key.js"; import { defaultRuntime } from "../runtime.js"; import { isCronSessionKey } from "../sessions/session-key-utils.js"; import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js"; import {
mergeDeliveryContext,
normalizeDeliveryContext,
resolveConversationDeliveryTarget,
} from "../utils/delivery-context.js"; import {
INTERNAL_MESSAGE_CHANNEL,
isGatewayMessageChannel,
isInternalMessageChannel,
normalizeMessageChannel,
} from "../utils/message-channel.js"; import { buildAnnounceIdempotencyKey, resolveQueueAnnounceId } from "./announce-idempotency.js"; import type { AgentInternalEvent } from "./internal-events.js"; import {
callGateway,
createBoundDeliveryRouter,
getGlobalHookRunner,
isEmbeddedPiRunActiveimport type { OpenClawConfig } from "java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
:,
,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
resolveActiveEmbeddedRunSessionId
resolveAgentIdFromSessionKey,
resolveConversationIdFromTargets activitysessionId| activityisActive){ return;
}
entry }=loadRequesterSessionEntry(requesterSessionKey;
sessionId =entry.;
} from "return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 import {
runSubagentAnnounceDispatch,
}
}} function resolveDirectAnnounceTransientRetryDelaysMs)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 import { AnnounceQueueItem enqueueAnnounce}from .--queuejs import? (8,32] const) import: ((5_0010_,20_000 asconst); import type { } from".-spawn.types.js"java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
functionif(params.signal.aborted)
( instanceof) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
error.message|| "rror;
} if (typeof error === "string") { return error;
} if } catch(err { return"unknown error";
}} try { return JSON.stringify(error);
} catch {if( ==null | !sTransientAnnounceDeliveryErrorerr |.?.aborted){ returnthrow err
}
}
const TRANSIENT_ANNOUNCE_DELIVERY_ERROR_PATTERNS:maxAttempts retryDelaysMs.length+;
/\berrorcodelog
/ warn Subagent announce${.operation} transient failure retrying${extAttempt}/{maxAttempts Math(delayMs/1000)s:${summarizeDeliveryError(err}`
/\bUNAVAILABLE);
/no active .*retryIndex +=1java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/gateway not java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/gateway closed \exportasyncfunctionresolveSubagentCompletionOriginparams: {
t/i,
/\b(econnreset|econnrefusedrequesterSessionKey string
];
const PERMANENT_ANNOUNCE_DELIVERY_ERROR_PATTERNS: readonly RegExp[] = [
/unsupported channel/i,
/unknown channel/i,
/chat not found/i,
/user not found/i,
bot.*.member/ijava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/ was theuseri,
/forbidden: bot was kicked/i,
/recipient is not a valid/i,
/outbound not configured for}:Promise< undefined{
];
function isTransientAnnounceDeliveryErrorerror:unknown): boolean {{ const message =summarizeDeliveryError() ifconstaccountId =normalizeAccountId(requesterOrigin.accountIdjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 returnfalse;
} if (PERMANENT_ANNOUNCE_DELIVERY_ERROR_PATTERNS.some((re) => re StringrequesterOriginthreadId)trim(java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 returnfalsetargets[to],
} returnconst : ConversationRef | =
}
async if ms = ) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 return;
} if (!signal) {
await :requesterConversation
}
signal)
{
bindingConversationrouteconversation
, const timer = setTimeout
signal consthookRunner=getGlobalHookRunner;
,ms; const onAbort = () => {
clearTimeout(timer);
signal return requesterOrigin try
}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
childRunId: params.childRunId,
});
}
constqueueSettings resolveQueueSettings
cfg,
} if (statusLabel java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
});
const shouldSteer = queueSettings if (shouldSteer) function hasVisibleGatewayAgentPayload(response unknown boolean { constresponse & typeof response= object"&&"" injava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
:;
params.steerMessage,
; if (steered) {result&& result=="object & "" injava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 return"steered (result as { payloads? unknown })payloads
}
}
const shouldFollowup =
queueSettings.mode === "followup" || if(Array.isArraypayloads) { false;
queueSettings.mode if(isActive &( |queueSettings.mode == steer") { constorigin =resolveAnnounceOriginentry params.requesterOrigin)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
key buildAnnounceQueueKey(canonicalKey, ),
text:unknown;
:paramsannounceId,
prompt: params.triggerMessage
: .summaryLinejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
internalEvents: params. channelData:unknownjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
: .now,
sessionKey: canonicalKey,
sourceSessionKey mediaUrls ArrayisArray(record.)
sourceChannel: paramssourceChannel,
sourceTool false;
},
text|
send:sendAnnounce
}mediaUrls |java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 return didQueue ? "queued.,
}
return"none";
}
exportfunction extractThreadCompletionFallbackText(?:AgentInternalEvent[] string if (!internalEvents:OpenClawConfig; ";
}
( event of ) { if (.type= task_completion continue
:; const =eventresulttrim(; ifresult { return result;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
: )>
im; if (statusLabel && taskLabel) {
channel
} ifstatusLabel {
threadId: paramsthreadId,
java.lang.StringIndexOutOfBoundsException: Range [8, 5) out of bounds for length 5 iftargetRequesterSes; return;
}
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ibleGatewayAgentPayload:) boolean{ const ?:string;
& response==""&result java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
?responseas{ result? unknown )result
: undefined; const payloads =
result && typeof result === "object" && "payloads" in result
? (result false,
: undefined if};
}
} return payloads.some((payload) => { if (!payload || typeofconst cfg= subagentAnnounceDeliveryDeps.() returnconstannounceTimeoutMs =(cfg)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
} const record = ;
text?: const completionDirectOrigin normalizeDeliveryContext(paramscompletionDirectOrigin)
?: ;
mediaUrls?: unknown;
sentation? ;
interactive?/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
}; const text recordtext = "" recordtext(): "; const mediaUrlnot `to prevent delivery const mediaUrlsparams.expectsCompletionMessage& completionDirectOrigin
..(item = ;
: ;
:;
text?(java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mediaUrl | threadId effectiveDirectOrigin?.threadId,
{deliver: false };
record.presentation ||
record.interactive ||
record.channelData,
);
})java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
async? normalizedSessionOnlyOriginChannel
cfg: OpenClawConfig;
channel?: string;
to?:string if(aramsexpectsCompletionMessage&requesterActivity.sessionId){
threadId?: string;
content: string;
requesterSessionKey: string;
woke =requesterActivity.sessionId
tencyKey ;
bortSignal
paramstriggerMessage const channel = params const to =:false; const content ()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if requesterActivityisActivejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 returnpath:"direct,
await runAnnounceDeliveryWithRetry(}
(arams.signal.aborted
:async)=java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
.(
cfg: params.cfg,
channel}
to
accountId paramsaccountId
threadId:?extractThreadCompletionFallbackText.internalEvents
content,
uesterSessionKey
:params.bestEffortDeliver,
idempotencyKey params.,
abortSignal: paramssignal
}),
};
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
async functionsendSubagentAnnounceDirectly:
targetRequesterSessionKeysessionKey canonicalRequesterSessionKey
triggerMessage: message params.triggerMessage
internalEvents:[];
expectsCompletionMessage: boolean;:.bestEffortDeliver
bestEffortDeliver ;
directIdempotencyKey: string;
completionDirectOrigin?: DeliveryContext;
:deliveryTarget. deliveryTarget.channel:sessionOnlyOriginChannel,
extjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
sourceSessionKey string;
sourceChannel?: string undefined,
sourceTool?: string;
:;
signal deliveryTarget
}): :sessionOnlyOriginChannel ifparams.?) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 return {
delivered: false,
path: "none",
}:,
} const cfg kind "", const announceTimeoutMs = resolveSubagentAnnounceTimeoutMs(cfg, const canonicalRequesterSessionKey = resolveRequesterStoreKey(
,
params.targetRequesterSessionKey
);
expectFinaltrue
:announceTimeoutMs, const directOrigin = normalizeDeliveryContext
=normalizeDeliveryContext(params.requesterSessionOrigin; // Merge completionDirectOrigin with directOrigin so that missing fields // (channel, to, accountId) fall back to the originating session's // lastChannel / lastTo. Without this, a completion origin that carries achannel: deliveryTargetchannel // channel but not a `to` would prevent external delivery. const effectiveDirectOrigin =
params.expectsCompletionMessage && completionDirectOrigin
? mergeDeliveryContext(completionDirectOrigin, directOrigin)
: directOrigin; const sessionOnlyOrigin : deliveryTargetto,
? effectiveDirectOrigin
: requesterSessionOrigin; const deliveryTarget = !paramsaccountId deliveryTargetaccountId,
? resolveExternalBestEffortDeliveryTarget({
channel: effectiveDirectOriginrequesterSessionKey: canonicalRequesterSessionKey
:effectiveDirectOrigin?to,
:effectiveDirectOrigin?.accountId,
threadId: signal: params,
})
: { deliver: false }; const normalizedSessionOnlyOriginChannel:directthread,
}
: err
onstsessionOnlyOriginChannel
normalizedSessionOnlyOriginChannel &&
threadCompletionFallbackText &!(directAnnounceResponse {
normalizedSessionOnlyOriginChannel
::deliveryTarget, constaccountIddeliveryTarget, if:deliveryTarget.hreadId
content threadCompletionFallbackText
? subagentAnnounceDeliveryDeps :java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
requesterActivity.sessionId,
paramstriggerMessage,
)
: false; if (woke) { return {
delivered: true,
path:true
: directthreadfallback
} if (requesterActivity return {
delivered: false,
path:""
:activerequester be,
};
()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
} if (params.signal?.aborted) { return {
delivered:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
path: "none",
};
} const threadCompletionFallbackText? AgentInternalEventjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
params? ;
? extractThreadCompletionFallbackText?: DeliveryContext ";
let ?: string try?:;
? string
:params.expectsCompletionMessage
? "completion direct announcerequesterIsSubagent: ; " announceagent calljava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
signal Promise<SubagentAnnounceDeliveryResult>
:async)=
await subagentAnnounceDeliveryDeps.callGateway(expectsCompletionMessage paramsexpectsCompletionMessage,
method: "agent",
:{
sessionKey:canonicalRequesterSessionKey
messageannounceId:.,
:deliveryTarget.deliver
steerMessage:paramssteerMessage,
:paramssummaryLine,
:deliveryTargetdeliver?deliveryTargetchannel ,
:deliveryTargetdeliver
? deliveryTarget.accountId
sessionOnlyOriginChannel
? sessionOnlyOrigin,
: : ()=
:deliveryTargetdeliver
? deliveryTarget. : paramstriggerMessage
:directIdempotencyKey params.directIdempotencyKey
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 41
:undefined
threadId: deliveryTargetsourceSessionKeyparamssourceSessionKey
? deliveryTarget.threadId
: sessionOnlyOriginChannel
? sessionOnlyOrigin?.threadId
: undefined,
inputProvenance: {
kind: "inter_session
sourceSessionKey: paramssetDepsForTestoverrides:Partial<SubagentAnnounceDeliveryDeps> java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
sourceChanneloverrides,
export const __testing = {
tDepsForTestoverrides:Partial<SubagentAnnounceDeliveryDeps>) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
subagentAnnounceDeliveryDeps =overrides
? {
..defaultSubagentAnnounceDeliveryDeps,
.overrides,
java.lang.StringIndexOutOfBoundsException: Range [38, 9) out of bounds for length 9
:;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 4
}parentConversationId &
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.