@automagik/omni 2.260730.4 → 2.260731.2

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.
@@ -163279,6 +163279,7 @@ var init_schema2 = __esm(() => {
163279
163279
  agentId: uuid("agent_id").references(() => agents.id, { onDelete: "set null" }),
163280
163280
  agentTimeout: integer("agent_timeout").notNull().default(600),
163281
163281
  agentStreamMode: boolean("agent_stream_mode").notNull().default(false),
163282
+ agentErrorMessages: jsonb("agent_error_messages").$type(),
163282
163283
  agentReplyFilter: jsonb("agent_reply_filter").$type(),
163283
163284
  agentSessionStrategy: varchar("agent_session_strategy", { length: 20 }).notNull().default("per_chat").$type(),
163284
163285
  agentPrefixSenderName: boolean("agent_prefix_sender_name").notNull().default(true),
@@ -241329,7 +241330,7 @@ var init_sentry_scrub = __esm(() => {
241329
241330
  var require_package7 = __commonJS((exports, module) => {
241330
241331
  module.exports = {
241331
241332
  name: "@omni/api",
241332
- version: "2.260730.4",
241333
+ version: "2.260731.2",
241333
241334
  type: "module",
241334
241335
  exports: {
241335
241336
  ".": {
@@ -347762,10 +347763,11 @@ async function sendTextMessage5(channel5, instanceId, chatId, text3, messageForm
347762
347763
  metadata: { messageFormatMode, correlationId, senderAgentId }
347763
347764
  });
347764
347765
  }
347765
- function resolveDispatchErrorMessage(instanceErrorMessage, env2 = process.env) {
347766
- const instanceMsg = instanceErrorMessage?.trim();
347767
- if (instanceMsg)
347768
- return instanceMsg;
347766
+ function resolveDispatchErrorMessage(instanceErrorMessages, env2 = process.env, random = Math.random) {
347767
+ const variants = (instanceErrorMessages ?? []).map((m2) => m2.trim()).filter(Boolean);
347768
+ const picked = variants[Math.floor(random() * variants.length)];
347769
+ if (picked)
347770
+ return picked;
347769
347771
  const envMsg = env2.OMNI_AGENT_DISPATCH_ERROR_MESSAGE?.trim();
347770
347772
  if (envMsg)
347771
347773
  return envMsg;
@@ -347860,7 +347862,7 @@ async function handleDispatchFailure(services, db2, channel5, instance4, chatId,
347860
347862
  const handedOff = await triggerErrorHandoff(services, db2, channel5, instance4, chatId, resolveErrorHandoffMessage(), trustedTenantId);
347861
347863
  if (handedOff)
347862
347864
  return;
347863
- await sendErrorFeedback(channel5, instance4.id, chatId, error3, resolveDispatchErrorMessage(null)).catch(() => {});
347865
+ await sendErrorFeedback(channel5, instance4.id, chatId, error3, resolveDispatchErrorMessage(instance4.agentErrorMessages)).catch(() => {});
347864
347866
  }
347865
347867
  function sleep6(ms) {
347866
347868
  return new Promise((resolve4) => setTimeout(resolve4, ms));
@@ -350714,7 +350716,7 @@ async function setupAgentDispatcher(eventBus, services, db2) {
350714
350716
  log104.info("Agent dispatcher shutdown complete");
350715
350717
  };
350716
350718
  }
350717
- var import_api32, log104, agentDispatchLimiter, _natsGenieProviderCtor, QUOTED_MESSAGE_MAX_CHARS = 4000, DM_HISTORY_LIMIT = 20, LIFECYCLE_PREVIEW_MAX_CHARS = 160, LIFECYCLE_SENSITIVE_KEY_PARTS, PRESENCE_DEFAULT_MIN_MS = 5000, PRESENCE_DEFAULT_MAX_WAIT_MS = 30000, activeMessageDebouncer = null, DEFAULT_DISPATCH_ERROR_MESSAGE = "\u26A0\uFE0F Sorry, I ran into an issue processing your message. Please try again.", DEFAULT_ERROR_HANDOFF_MESSAGE = "T\xF4 com um probleminha t\xE9cnico aqui agora. Logo algu\xE9m do time vai entrar em contato com voc\xEA.", 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, _openClawClientCtor, nullFilterWarnedInstances, ACTIVE_OWNER_IDENTIFIER_CACHE_TTL_MS = 1e4, cachedActiveOwnerIdentifiers = null, cachedActiveOwnerIdentifiersAt = 0, tenantCachedActiveOwnerIdentifiers, DEFAULT_GATE_MODEL = "gemini-3-flash-preview", GATE_TIMEOUT_MS = 3000, setupAgentResponder;
350719
+ var import_api32, log104, agentDispatchLimiter, _natsGenieProviderCtor, QUOTED_MESSAGE_MAX_CHARS = 4000, DM_HISTORY_LIMIT = 20, LIFECYCLE_PREVIEW_MAX_CHARS = 160, LIFECYCLE_SENSITIVE_KEY_PARTS, PRESENCE_DEFAULT_MIN_MS = 5000, PRESENCE_DEFAULT_MAX_WAIT_MS = 30000, activeMessageDebouncer = null, DEFAULT_DISPATCH_ERROR_MESSAGE = "Opa, tive um probleminha aqui \uD83D\uDE05 Pode mandar de novo?", DEFAULT_ERROR_HANDOFF_MESSAGE = "T\xF4 com um probleminha t\xE9cnico aqui agora. Logo algu\xE9m do time vai entrar em contato com voc\xEA.", 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, _openClawClientCtor, nullFilterWarnedInstances, ACTIVE_OWNER_IDENTIFIER_CACHE_TTL_MS = 1e4, cachedActiveOwnerIdentifiers = null, cachedActiveOwnerIdentifiersAt = 0, tenantCachedActiveOwnerIdentifiers, DEFAULT_GATE_MODEL = "gemini-3-flash-preview", GATE_TIMEOUT_MS = 3000, setupAgentResponder;
350718
350720
  var init_agent_dispatcher = __esm(() => {
350719
350721
  init_src2();
350720
350722
  init_src();
@@ -357644,6 +357646,9 @@ var init_instances2 = __esm(() => {
357644
357646
  agentId: exports_external.string().uuid().nullable().optional().openapi({ description: "Agent UUID (agents table)" }),
357645
357647
  agentProviderId: exports_external.string().uuid().nullable().optional().openapi({ description: "Provider ID (agent provider)" }),
357646
357648
  agentTimeout: exports_external.number().openapi({ description: "Agent timeout in seconds" }),
357649
+ agentErrorMessages: exports_external.array(exports_external.string()).nullable().optional().openapi({
357650
+ description: "Customer-facing replies sent when agent dispatch fails; one is picked at random per failure (null/empty = env/default fallback)"
357651
+ }),
357647
357652
  agentStreamMode: exports_external.boolean().openapi({ description: "Whether streaming is enabled" }),
357648
357653
  createdAt: exports_external.string().datetime().openapi({ description: "Creation timestamp" }),
357649
357654
  updatedAt: exports_external.string().datetime().openapi({ description: "Last update timestamp" })
@@ -357653,6 +357658,9 @@ var init_instances2 = __esm(() => {
357653
357658
  channel: ChannelTypeSchema.openapi({ description: "Channel type" }),
357654
357659
  agentId: exports_external.string().uuid().nullable().optional().openapi({ description: "Agent UUID (agents table)" }),
357655
357660
  agentTimeout: exports_external.number().int().positive().default(600).openapi({ description: "Agent timeout in seconds" }),
357661
+ agentErrorMessages: exports_external.array(exports_external.string()).nullable().optional().openapi({
357662
+ description: "Customer-facing replies sent when agent dispatch fails; one is picked at random per failure (null/empty = env/default fallback)"
357663
+ }),
357656
357664
  agentStreamMode: exports_external.boolean().default(false).openapi({ description: "Enable streaming responses" }),
357657
357665
  isDefault: exports_external.boolean().default(false).openapi({ description: "Set as default instance for channel" }),
357658
357666
  token: exports_external.string().optional().openapi({ description: "Bot token for Discord instances" })
@@ -364425,6 +364433,7 @@ var init_instances3 = __esm(() => {
364425
364433
  channel: ChannelTypeSchema.describe("Channel type (e.g., whatsapp-baileys, discord)"),
364426
364434
  agentId: exports_external.string().uuid().nullable().optional().describe("Agent UUID referencing agents table"),
364427
364435
  agentTimeout: exports_external.number().int().positive().default(600).describe("Agent timeout in seconds"),
364436
+ agentErrorMessages: exports_external.array(exports_external.string()).optional().nullable().describe("Customer-facing replies sent when agent dispatch fails; one is picked at random per failure (null/empty = fall through to OMNI_AGENT_DISPATCH_ERROR_MESSAGE env, then built-in default)"),
364428
364437
  agentStreamMode: exports_external.boolean().default(false).describe("Enable streaming responses"),
364429
364438
  agentReplyFilter: agentReplyFilterSchema.optional().nullable().describe("When agent should reply"),
364430
364439
  agentSessionStrategy: exports_external.enum(["per_user", "per_chat", "per_thread"]).default("per_chat").describe("Session strategy for agent memory"),
@@ -364482,6 +364491,7 @@ var init_instances3 = __esm(() => {
364482
364491
  });
364483
364492
  updateInstanceSchema = createInstanceSchema.partial().extend({
364484
364493
  agentId: exports_external.string().uuid().nullable().optional(),
364494
+ agentErrorMessages: exports_external.array(exports_external.string()).nullable().optional(),
364485
364495
  agentReplyFilter: agentReplyFilterSchema.nullable().optional(),
364486
364496
  triggerEvents: exports_external.array(exports_external.string()).nullable().optional(),
364487
364497
  telegramBotToken: exports_external.string().nullable().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260730.4",
3
+ "version": "2.260731.2",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {