@automagik/omni 2.260531.4 → 2.260531.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/server/index.js +246 -45
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124967,7 +124967,7 @@ import { fileURLToPath } from "url";
|
|
|
124967
124967
|
// package.json
|
|
124968
124968
|
var package_default = {
|
|
124969
124969
|
name: "@automagik/omni",
|
|
124970
|
-
version: "2.260531.
|
|
124970
|
+
version: "2.260531.6",
|
|
124971
124971
|
description: "LLM-optimized CLI for Omni",
|
|
124972
124972
|
type: "module",
|
|
124973
124973
|
bin: {
|
package/dist/server/index.js
CHANGED
|
@@ -225241,7 +225241,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
225241
225241
|
var require_package7 = __commonJS((exports, module) => {
|
|
225242
225242
|
module.exports = {
|
|
225243
225243
|
name: "@omni/api",
|
|
225244
|
-
version: "2.260531.
|
|
225244
|
+
version: "2.260531.6",
|
|
225245
225245
|
type: "module",
|
|
225246
225246
|
exports: {
|
|
225247
225247
|
".": {
|
|
@@ -337739,9 +337739,125 @@ var init_session_storage = __esm(() => {
|
|
|
337739
337739
|
});
|
|
337740
337740
|
|
|
337741
337741
|
// ../api/src/plugins/agent-dispatcher.ts
|
|
337742
|
+
import { createHash as createHash10 } from "crypto";
|
|
337742
337743
|
import { unlink, writeFile as writeFile5 } from "fs/promises";
|
|
337743
337744
|
import { tmpdir as tmpdir11 } from "os";
|
|
337744
337745
|
import { join as join24, resolve as resolve2 } from "path";
|
|
337746
|
+
function sha256Digest(value) {
|
|
337747
|
+
return `sha256:${createHash10("sha256").update(value).digest("hex")}`;
|
|
337748
|
+
}
|
|
337749
|
+
function redactLifecycleText(value) {
|
|
337750
|
+
return value.replace(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi, "[EMAIL]").replace(/\b\+?\d[\d\s().-]{5,}\d\b/g, "[PHONE]").replace(/\b\d{6,}\b/g, "[NUMBER]").replace(/\b[^\s@]+@(s\.whatsapp\.net|g\.us|lid|newsletter)\b/gi, "[JID]");
|
|
337751
|
+
}
|
|
337752
|
+
function previewLifecycleText(value) {
|
|
337753
|
+
const redacted = redactLifecycleText(value).replace(/\s+/g, " ").trim();
|
|
337754
|
+
if (redacted.length <= LIFECYCLE_PREVIEW_MAX_CHARS)
|
|
337755
|
+
return redacted;
|
|
337756
|
+
return `${redacted.slice(0, LIFECYCLE_PREVIEW_MAX_CHARS - 1)}\u2026`;
|
|
337757
|
+
}
|
|
337758
|
+
function isLifecycleSafeExtraKey(key) {
|
|
337759
|
+
const lowered = key.toLowerCase();
|
|
337760
|
+
return !LIFECYCLE_SENSITIVE_KEY_PARTS.some((part) => lowered.includes(part));
|
|
337761
|
+
}
|
|
337762
|
+
function setTextLifecycleAttributes(attributes, prefix, value) {
|
|
337763
|
+
if (value === undefined)
|
|
337764
|
+
return;
|
|
337765
|
+
attributes[`khal.${prefix}_chars`] = value.length;
|
|
337766
|
+
attributes[`khal.${prefix}_sha256`] = sha256Digest(value);
|
|
337767
|
+
attributes[`khal.${prefix}_preview_redacted`] = previewLifecycleText(value);
|
|
337768
|
+
}
|
|
337769
|
+
function setOptionalLifecycleAttributes(attributes, pairs) {
|
|
337770
|
+
for (const [key, value] of pairs) {
|
|
337771
|
+
if (value)
|
|
337772
|
+
attributes[key] = value;
|
|
337773
|
+
}
|
|
337774
|
+
}
|
|
337775
|
+
function setChatLifecycleAttributes(attributes, chatId) {
|
|
337776
|
+
if (!chatId)
|
|
337777
|
+
return;
|
|
337778
|
+
attributes["omni.chat_id_sha256"] = sha256Digest(chatId);
|
|
337779
|
+
attributes["omni.chat_id_preview_redacted"] = previewLifecycleText(chatId);
|
|
337780
|
+
}
|
|
337781
|
+
function setSessionLifecycleAttributes(attributes, sessionId) {
|
|
337782
|
+
if (!sessionId)
|
|
337783
|
+
return;
|
|
337784
|
+
attributes["khal.session_id"] = sessionId;
|
|
337785
|
+
attributes["langfuse.session.id"] = sessionId;
|
|
337786
|
+
attributes["session.id"] = sessionId;
|
|
337787
|
+
}
|
|
337788
|
+
function setExtraLifecycleAttributes(attributes, extra) {
|
|
337789
|
+
if (!extra)
|
|
337790
|
+
return;
|
|
337791
|
+
for (const [key, value] of Object.entries(extra)) {
|
|
337792
|
+
if (!isLifecycleSafeExtraKey(key) || value === undefined || value === null)
|
|
337793
|
+
continue;
|
|
337794
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
337795
|
+
attributes[`khal.${key}`] = typeof value === "string" ? previewLifecycleText(value) : value;
|
|
337796
|
+
}
|
|
337797
|
+
}
|
|
337798
|
+
}
|
|
337799
|
+
function buildLifecycleSpanAttributes(input) {
|
|
337800
|
+
const attributes = {
|
|
337801
|
+
"khal.lifecycle.stage": input.stage,
|
|
337802
|
+
"khal.event_type": input.eventType,
|
|
337803
|
+
"khal.channel": input.channel
|
|
337804
|
+
};
|
|
337805
|
+
setOptionalLifecycleAttributes(attributes, [
|
|
337806
|
+
["khal.provider", input.provider],
|
|
337807
|
+
["omni.instance_id", input.instanceId],
|
|
337808
|
+
["khal.trace_id", input.traceId],
|
|
337809
|
+
["khal.turn.message_id", input.messageId],
|
|
337810
|
+
["khal.agent_id", input.agentId]
|
|
337811
|
+
]);
|
|
337812
|
+
setChatLifecycleAttributes(attributes, input.chatId);
|
|
337813
|
+
setSessionLifecycleAttributes(attributes, input.sessionId);
|
|
337814
|
+
setTextLifecycleAttributes(attributes, "input", input.inputText);
|
|
337815
|
+
setTextLifecycleAttributes(attributes, "output", input.outputText);
|
|
337816
|
+
setExtraLifecycleAttributes(attributes, input.extra);
|
|
337817
|
+
return attributes;
|
|
337818
|
+
}
|
|
337819
|
+
async function withLifecycleSpan(name, attributes, fn) {
|
|
337820
|
+
let callbackStarted = false;
|
|
337821
|
+
try {
|
|
337822
|
+
const tracer2 = import_api32.trace.getTracer("omni.agent-dispatcher");
|
|
337823
|
+
return await tracer2.startActiveSpan(name, { attributes }, async (span) => {
|
|
337824
|
+
callbackStarted = true;
|
|
337825
|
+
try {
|
|
337826
|
+
const result = await fn();
|
|
337827
|
+
span.setStatus({ code: import_api32.SpanStatusCode.OK });
|
|
337828
|
+
return result;
|
|
337829
|
+
} catch (error3) {
|
|
337830
|
+
span.recordException(error3 instanceof Error ? error3 : new Error(String(error3)));
|
|
337831
|
+
span.setStatus({ code: import_api32.SpanStatusCode.ERROR, message: error3 instanceof Error ? error3.message : String(error3) });
|
|
337832
|
+
throw error3;
|
|
337833
|
+
} finally {
|
|
337834
|
+
span.end();
|
|
337835
|
+
}
|
|
337836
|
+
});
|
|
337837
|
+
} catch (error3) {
|
|
337838
|
+
if (callbackStarted)
|
|
337839
|
+
throw error3;
|
|
337840
|
+
log99.warn("Lifecycle span wrapper failed before dispatch; continuing without span", { spanName: name });
|
|
337841
|
+
return fn();
|
|
337842
|
+
}
|
|
337843
|
+
}
|
|
337844
|
+
function emitLifecycleSpan(name, attributes) {
|
|
337845
|
+
withLifecycleSpan(name, attributes, async () => {
|
|
337846
|
+
return;
|
|
337847
|
+
}).catch(() => {});
|
|
337848
|
+
}
|
|
337849
|
+
function activeProviderTraceContext() {
|
|
337850
|
+
const activeSpan = import_api32.trace.getActiveSpan();
|
|
337851
|
+
const spanContext = activeSpan?.spanContext();
|
|
337852
|
+
if (!spanContext?.traceId || !spanContext?.spanId)
|
|
337853
|
+
return;
|
|
337854
|
+
return {
|
|
337855
|
+
traceId: spanContext.traceId,
|
|
337856
|
+
spanId: spanContext.spanId,
|
|
337857
|
+
traceFlags: spanContext.traceFlags,
|
|
337858
|
+
traceState: spanContext.traceState?.serialize()
|
|
337859
|
+
};
|
|
337860
|
+
}
|
|
337745
337861
|
function createPluginAckProvider(plugin7) {
|
|
337746
337862
|
if (!plugin7?.react || !plugin7?.unreact)
|
|
337747
337863
|
return null;
|
|
@@ -338811,7 +338927,20 @@ async function dispatchViaTurnBasedProvider(services, instance4, provider, trigg
|
|
|
338811
338927
|
OMNI_TURN_ID: turn.id
|
|
338812
338928
|
};
|
|
338813
338929
|
const dispatchStart = Date.now();
|
|
338814
|
-
await
|
|
338930
|
+
await withLifecycleSpan("omni.dispatch_to_agno", buildLifecycleSpanAttributes({
|
|
338931
|
+
stage: "dispatch_to_agno",
|
|
338932
|
+
eventType: "user_message_turn",
|
|
338933
|
+
channel: instance4.channel,
|
|
338934
|
+
provider: provider.schema,
|
|
338935
|
+
instanceId: instance4.id,
|
|
338936
|
+
chatId,
|
|
338937
|
+
sessionId: trigger.sessionId,
|
|
338938
|
+
traceId,
|
|
338939
|
+
messageId,
|
|
338940
|
+
agentId: agentRecord.id,
|
|
338941
|
+
inputText: trigger.content.text,
|
|
338942
|
+
extra: { mode: "turn-based", provider_id: provider.id, provider_schema: provider.schema }
|
|
338943
|
+
}), () => provider.trigger(trigger));
|
|
338815
338944
|
const dispatchDurationMs = Date.now() - dispatchStart;
|
|
338816
338945
|
if (sentryEnabled()) {
|
|
338817
338946
|
exports_public_api2.count("agent.dispatch", 1, { attributes: { provider_type: provider.schema, mode: "turn-based" } });
|
|
@@ -338852,48 +338981,89 @@ async function dispatchViaProvider(services, instance4, messages4, triggerType,
|
|
|
338852
338981
|
await executeBeforeAgentStartHooks(instance4, chatId, senderId, senderName, triggerType, traceId, messages4[0]?.metadata.correlationId, triggerFiles);
|
|
338853
338982
|
const customerContext = await resolveCustomerContext(services, personId, extractA2ACustomerContext(messages4, channel5));
|
|
338854
338983
|
const trigger = buildMessageTrigger(traceId, triggerType, rawEvent, channel5, instance4, chatId, senderId, personId, senderName, messages4, messageTexts, triggerFiles, sessionId, customerContext, allContextMessages, explicitKhalSessionId);
|
|
338855
|
-
|
|
338856
|
-
|
|
338857
|
-
|
|
338858
|
-
|
|
338859
|
-
const dispatchStart = Date.now();
|
|
338860
|
-
const result = await provider.trigger(trigger);
|
|
338861
|
-
const dispatchDurationMs = Date.now() - dispatchStart;
|
|
338862
|
-
if (sentryEnabled()) {
|
|
338863
|
-
exports_public_api2.count("agent.dispatch", 1, { attributes: { provider_type: provider.schema } });
|
|
338864
|
-
exports_public_api2.distribution("agent.dispatch.latency", dispatchDurationMs, {
|
|
338865
|
-
unit: "millisecond",
|
|
338866
|
-
attributes: { provider_type: provider.schema }
|
|
338867
|
-
});
|
|
338868
|
-
}
|
|
338869
|
-
const chatAfterRun = await services.chats.findByExternalIdSmart(instance4.id, chatId);
|
|
338870
|
-
const handoffTriggered = chatAfterRun?.settings?.agentPaused === true;
|
|
338871
|
-
if (result && result.parts.length > 0 && !handoffTriggered) {
|
|
338872
|
-
const selfChat = isSelfChat(chatId, instance4.ownerIdentifier);
|
|
338873
|
-
const rawParts = selfChat ? result.parts.map((p2) => `${BOT_PREFIX}${p2}`) : result.parts;
|
|
338874
|
-
const parts = await Promise.all(rawParts.map((part) => executeBeforeMessageWriteHooks(instance4.id, chatId, part)));
|
|
338875
|
-
const _fmtMode = instance4.messageFormatMode ?? "convert";
|
|
338876
|
-
const replyTo = messages4[0]?.payload.replyToId ?? messages4[0]?.payload.externalId;
|
|
338877
|
-
recordJourneyCheckpoint(correlationId, "T8", JOURNEY_STAGES.T8);
|
|
338878
|
-
await sendResponseParts(channel5, instance4.id, chatId, parts, getSplitDelayConfig(instance4), _fmtMode, replyTo, correlationId, senderAgentId);
|
|
338879
|
-
recordJourneyCheckpoint(correlationId, "T9", JOURNEY_STAGES.T9);
|
|
338880
|
-
await forwardToChainedInstance(instance4, parts, correlationId, messages4);
|
|
338881
|
-
} else if (handoffTriggered) {
|
|
338882
|
-
log99.info("Agent response suppressed \u2014 handoff triggered during run", {
|
|
338883
|
-
instanceId: instance4.id,
|
|
338884
|
-
chatId
|
|
338885
|
-
});
|
|
338886
|
-
}
|
|
338887
|
-
log99.info("Agent response via IAgentProvider", {
|
|
338984
|
+
const lifecycleBase = {
|
|
338985
|
+
eventType: "user_message_turn",
|
|
338986
|
+
channel: channel5,
|
|
338987
|
+
provider: provider.schema,
|
|
338888
338988
|
instanceId: instance4.id,
|
|
338889
338989
|
chatId,
|
|
338890
|
-
|
|
338891
|
-
|
|
338892
|
-
|
|
338893
|
-
|
|
338894
|
-
|
|
338990
|
+
sessionId,
|
|
338991
|
+
traceId,
|
|
338992
|
+
messageId: messages4[0]?.payload.externalId,
|
|
338993
|
+
agentId: instance4.agentInternalId ?? instance4.agentId ?? undefined,
|
|
338994
|
+
inputText: messageTexts.join(`
|
|
338995
|
+
`)
|
|
338996
|
+
};
|
|
338997
|
+
return withLifecycleSpan("omni.turn", buildLifecycleSpanAttributes({
|
|
338998
|
+
...lifecycleBase,
|
|
338999
|
+
stage: "turn",
|
|
339000
|
+
extra: {
|
|
339001
|
+
trigger_type: triggerType,
|
|
339002
|
+
message_count: messages4.length,
|
|
339003
|
+
provider_id: provider.id,
|
|
339004
|
+
provider_schema: provider.schema
|
|
339005
|
+
}
|
|
339006
|
+
}), async () => {
|
|
339007
|
+
await withLifecycleSpan("omni.provider_inbound", buildLifecycleSpanAttributes({
|
|
339008
|
+
...lifecycleBase,
|
|
339009
|
+
stage: "provider_inbound",
|
|
339010
|
+
extra: { trigger_type: triggerType, message_count: messages4.length }
|
|
339011
|
+
}), async () => {
|
|
339012
|
+
return;
|
|
339013
|
+
});
|
|
339014
|
+
if (provider.mode === "turn-based") {
|
|
339015
|
+
return dispatchViaTurnBasedProvider(services, instance4, provider, trigger, messages4, chatId, traceId, db2);
|
|
339016
|
+
}
|
|
339017
|
+
const correlationId = messages4[0]?.metadata.correlationId;
|
|
339018
|
+
const dispatchStart = Date.now();
|
|
339019
|
+
const result = await withLifecycleSpan("omni.dispatch_to_agno", buildLifecycleSpanAttributes({
|
|
339020
|
+
...lifecycleBase,
|
|
339021
|
+
stage: "dispatch_to_agno",
|
|
339022
|
+
extra: { trigger_type: triggerType, provider_id: provider.id, provider_schema: provider.schema }
|
|
339023
|
+
}), () => provider.trigger({ ...trigger, traceContext: activeProviderTraceContext() ?? trigger.traceContext }));
|
|
339024
|
+
const dispatchDurationMs = Date.now() - dispatchStart;
|
|
339025
|
+
if (sentryEnabled()) {
|
|
339026
|
+
exports_public_api2.count("agent.dispatch", 1, { attributes: { provider_type: provider.schema } });
|
|
339027
|
+
exports_public_api2.distribution("agent.dispatch.latency", dispatchDurationMs, {
|
|
339028
|
+
unit: "millisecond",
|
|
339029
|
+
attributes: { provider_type: provider.schema }
|
|
339030
|
+
});
|
|
339031
|
+
}
|
|
339032
|
+
const chatAfterRun = await services.chats.findByExternalIdSmart(instance4.id, chatId);
|
|
339033
|
+
const handoffTriggered = chatAfterRun?.settings?.agentPaused === true;
|
|
339034
|
+
if (result && result.parts.length > 0 && !handoffTriggered) {
|
|
339035
|
+
const selfChat = isSelfChat(chatId, instance4.ownerIdentifier);
|
|
339036
|
+
const rawParts = selfChat ? result.parts.map((p2) => `${BOT_PREFIX}${p2}`) : result.parts;
|
|
339037
|
+
const parts = await Promise.all(rawParts.map((part) => executeBeforeMessageWriteHooks(instance4.id, chatId, part)));
|
|
339038
|
+
const _fmtMode = instance4.messageFormatMode ?? "convert";
|
|
339039
|
+
const replyTo = messages4[0]?.payload.replyToId ?? messages4[0]?.payload.externalId;
|
|
339040
|
+
recordJourneyCheckpoint(correlationId, "T8", JOURNEY_STAGES.T8);
|
|
339041
|
+
await withLifecycleSpan("omni.provider_outbound", buildLifecycleSpanAttributes({
|
|
339042
|
+
...lifecycleBase,
|
|
339043
|
+
stage: "provider_outbound",
|
|
339044
|
+
outputText: parts.join(`
|
|
339045
|
+
`),
|
|
339046
|
+
extra: { parts_count: parts.length, provider_id: provider.id, provider_schema: provider.schema }
|
|
339047
|
+
}), () => sendResponseParts(channel5, instance4.id, chatId, parts, getSplitDelayConfig(instance4), _fmtMode, replyTo, correlationId, senderAgentId));
|
|
339048
|
+
recordJourneyCheckpoint(correlationId, "T9", JOURNEY_STAGES.T9);
|
|
339049
|
+
await forwardToChainedInstance(instance4, parts, correlationId, messages4);
|
|
339050
|
+
} else if (handoffTriggered) {
|
|
339051
|
+
log99.info("Agent response suppressed \u2014 handoff triggered during run", {
|
|
339052
|
+
instanceId: instance4.id,
|
|
339053
|
+
chatId
|
|
339054
|
+
});
|
|
339055
|
+
}
|
|
339056
|
+
log99.info("Agent response via IAgentProvider", {
|
|
339057
|
+
instanceId: instance4.id,
|
|
339058
|
+
chatId,
|
|
339059
|
+
parts: result?.parts.length ?? 0,
|
|
339060
|
+
providerId: result?.metadata.providerId,
|
|
339061
|
+
durationMs: result?.metadata.durationMs,
|
|
339062
|
+
triggerType,
|
|
339063
|
+
traceId
|
|
339064
|
+
});
|
|
339065
|
+
return true;
|
|
338895
339066
|
});
|
|
338896
|
-
return true;
|
|
338897
339067
|
}
|
|
338898
339068
|
async function dispatchViaLegacy(services, instance4, messages4, triggerType, channel5, chatId, senderId, personId, senderName, traceId, perThreadExtraContext, senderAgentId) {
|
|
338899
339069
|
const { messageTexts, mediaFiles } = await prepareAgentContent(services, instance4, messages4);
|
|
@@ -338916,7 +339086,30 @@ async function dispatchViaLegacy(services, instance4, messages4, triggerType, ch
|
|
|
338916
339086
|
const { avatarUrl: senderAvatarUrl, platformUsername: senderPlatformUsername } = await fetchSenderMetadata(services, channel5, instance4.id, senderId);
|
|
338917
339087
|
const { chatName, participantCount } = await fetchChatMetadata(services, instance4.id, chatId, chatType);
|
|
338918
339088
|
await executeBeforeAgentStartHooks(instance4, chatId, senderId, senderName, triggerType, traceId, messages4[0]?.metadata.correlationId, mediaFiles.length > 0 ? mediaFiles : undefined);
|
|
338919
|
-
const
|
|
339089
|
+
const lifecycleSessionId = computeSessionId(instance4.agentSessionStrategy ?? "per_chat", senderId, chatId, rawPl.threadId);
|
|
339090
|
+
const lifecycleBase = {
|
|
339091
|
+
eventType: "user_message_turn",
|
|
339092
|
+
channel: channel5,
|
|
339093
|
+
provider: "legacy-agent-runner",
|
|
339094
|
+
instanceId: instance4.id,
|
|
339095
|
+
chatId,
|
|
339096
|
+
sessionId: lifecycleSessionId,
|
|
339097
|
+
traceId,
|
|
339098
|
+
messageId: messages4[0]?.payload.externalId,
|
|
339099
|
+
agentId: instance4.agentInternalId ?? instance4.agentId ?? undefined,
|
|
339100
|
+
inputText: messageTexts.join(`
|
|
339101
|
+
`)
|
|
339102
|
+
};
|
|
339103
|
+
emitLifecycleSpan("omni.provider_inbound", buildLifecycleSpanAttributes({
|
|
339104
|
+
...lifecycleBase,
|
|
339105
|
+
stage: "provider_inbound",
|
|
339106
|
+
extra: { trigger_type: triggerType, message_count: messages4.length }
|
|
339107
|
+
}));
|
|
339108
|
+
const result = await withLifecycleSpan("omni.dispatch_to_agno", buildLifecycleSpanAttributes({
|
|
339109
|
+
...lifecycleBase,
|
|
339110
|
+
stage: "dispatch_to_agno",
|
|
339111
|
+
extra: { trigger_type: triggerType, provider_schema: "legacy-agent-runner" }
|
|
339112
|
+
}), () => services.agentRunner.run({
|
|
338920
339113
|
instance: instance4,
|
|
338921
339114
|
chatId,
|
|
338922
339115
|
personId,
|
|
@@ -338929,7 +339122,7 @@ async function dispatchViaLegacy(services, instance4, messages4, triggerType, ch
|
|
|
338929
339122
|
participantCount,
|
|
338930
339123
|
messages: messageTexts,
|
|
338931
339124
|
files: mediaFiles.length > 0 ? mediaFiles : undefined
|
|
338932
|
-
});
|
|
339125
|
+
}));
|
|
338933
339126
|
const correlationId = messages4[0]?.metadata.correlationId;
|
|
338934
339127
|
const selfChat = isSelfChat(chatId, instance4.ownerIdentifier);
|
|
338935
339128
|
const rawParts = selfChat ? result.parts.map((p2) => `${BOT_PREFIX}${p2}`) : result.parts;
|
|
@@ -338937,7 +339130,13 @@ async function dispatchViaLegacy(services, instance4, messages4, triggerType, ch
|
|
|
338937
339130
|
const _fmtMode = instance4.messageFormatMode ?? "convert";
|
|
338938
339131
|
const replyTo = messages4[0]?.payload.replyToId ?? messages4[0]?.payload.externalId;
|
|
338939
339132
|
recordJourneyCheckpoint(correlationId, "T8", JOURNEY_STAGES.T8);
|
|
338940
|
-
await
|
|
339133
|
+
await withLifecycleSpan("omni.provider_outbound", buildLifecycleSpanAttributes({
|
|
339134
|
+
...lifecycleBase,
|
|
339135
|
+
stage: "provider_outbound",
|
|
339136
|
+
outputText: parts.join(`
|
|
339137
|
+
`),
|
|
339138
|
+
extra: { parts_count: parts.length, provider_schema: "legacy-agent-runner" }
|
|
339139
|
+
}), () => sendResponseParts(channel5, instance4.id, chatId, parts, getSplitDelayConfig(instance4), _fmtMode, replyTo, correlationId, senderAgentId));
|
|
338941
339140
|
recordJourneyCheckpoint(correlationId, "T9", JOURNEY_STAGES.T9);
|
|
338942
339141
|
log99.info("Agent response via legacy runner", {
|
|
338943
339142
|
instanceId: instance4.id,
|
|
@@ -340449,7 +340648,7 @@ async function setupAgentDispatcher(eventBus, services, db2) {
|
|
|
340449
340648
|
log99.info("Agent dispatcher shutdown complete");
|
|
340450
340649
|
};
|
|
340451
340650
|
}
|
|
340452
|
-
var log99, _natsGenieProviderCtor, QUOTED_MESSAGE_MAX_CHARS = 4000, DM_HISTORY_LIMIT = 20, TRANSIENT_DISPATCH_ERROR_PATTERNS, TRANSIENT_DISPATCH_RETRY_DELAYS_MS, CHANNEL_MESSAGE_LIMITS, DEFAULT_MESSAGE_LIMIT = 4000, MEDIA_BASE_PATH3, MEDIA_ICONS, MEDIA_WAIT_NULL, mediaCompletions, mediaResultCache, MEDIA_WAIT_TIMEOUT_MS = 30000, DEFAULT_SEND_MEDIA_PATH_TYPES, BOT_PREFIX = "\uD83E\uDD16 ", activeStreams, sessionActivityStore, PROC_REACT_START, PROC_REACT_DONE = "\u2705", providerCache, openclawClientPool, nullFilterWarnedInstances, ACTIVE_OWNER_IDENTIFIER_CACHE_TTL_MS = 1e4, cachedActiveOwnerIdentifiers = null, cachedActiveOwnerIdentifiersAt = 0, DEFAULT_GATE_MODEL = "gemini-3-flash-preview", GATE_TIMEOUT_MS = 3000, setupAgentResponder;
|
|
340651
|
+
var import_api32, log99, _natsGenieProviderCtor, QUOTED_MESSAGE_MAX_CHARS = 4000, DM_HISTORY_LIMIT = 20, LIFECYCLE_PREVIEW_MAX_CHARS = 160, LIFECYCLE_SENSITIVE_KEY_PARTS, TRANSIENT_DISPATCH_ERROR_PATTERNS, TRANSIENT_DISPATCH_RETRY_DELAYS_MS, CHANNEL_MESSAGE_LIMITS, DEFAULT_MESSAGE_LIMIT = 4000, MEDIA_BASE_PATH3, MEDIA_ICONS, MEDIA_WAIT_NULL, mediaCompletions, mediaResultCache, MEDIA_WAIT_TIMEOUT_MS = 30000, DEFAULT_SEND_MEDIA_PATH_TYPES, BOT_PREFIX = "\uD83E\uDD16 ", activeStreams, sessionActivityStore, PROC_REACT_START, PROC_REACT_DONE = "\u2705", providerCache, openclawClientPool, nullFilterWarnedInstances, ACTIVE_OWNER_IDENTIFIER_CACHE_TTL_MS = 1e4, cachedActiveOwnerIdentifiers = null, cachedActiveOwnerIdentifiersAt = 0, DEFAULT_GATE_MODEL = "gemini-3-flash-preview", GATE_TIMEOUT_MS = 3000, setupAgentResponder;
|
|
340453
340652
|
var init_agent_dispatcher = __esm(() => {
|
|
340454
340653
|
init_src2();
|
|
340455
340654
|
init_src();
|
|
@@ -340466,8 +340665,10 @@ var init_agent_dispatcher = __esm(() => {
|
|
|
340466
340665
|
init_message_persistence();
|
|
340467
340666
|
init_session_storage();
|
|
340468
340667
|
init_src6();
|
|
340668
|
+
import_api32 = __toESM(require_src(), 1);
|
|
340469
340669
|
log99 = createLogger("agent-dispatcher");
|
|
340470
340670
|
_natsGenieProviderCtor = NatsGenieProvider;
|
|
340671
|
+
LIFECYCLE_SENSITIVE_KEY_PARTS = ["authorization", "bearer", "password", "secret", "token", "api_key", "apikey"];
|
|
340471
340672
|
TRANSIENT_DISPATCH_ERROR_PATTERNS = [
|
|
340472
340673
|
/ECONNREFUSED/i,
|
|
340473
340674
|
/ECONNRESET/i,
|