@automagik/omni 2.260731.1 → 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,7 +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
- agentErrorMessage: text("agent_error_message"),
163282
+ agentErrorMessages: jsonb("agent_error_messages").$type(),
163283
163283
  agentReplyFilter: jsonb("agent_reply_filter").$type(),
163284
163284
  agentSessionStrategy: varchar("agent_session_strategy", { length: 20 }).notNull().default("per_chat").$type(),
163285
163285
  agentPrefixSenderName: boolean("agent_prefix_sender_name").notNull().default(true),
@@ -241330,7 +241330,7 @@ var init_sentry_scrub = __esm(() => {
241330
241330
  var require_package7 = __commonJS((exports, module) => {
241331
241331
  module.exports = {
241332
241332
  name: "@omni/api",
241333
- version: "2.260731.1",
241333
+ version: "2.260731.2",
241334
241334
  type: "module",
241335
241335
  exports: {
241336
241336
  ".": {
@@ -347763,10 +347763,11 @@ async function sendTextMessage5(channel5, instanceId, chatId, text3, messageForm
347763
347763
  metadata: { messageFormatMode, correlationId, senderAgentId }
347764
347764
  });
347765
347765
  }
347766
- function resolveDispatchErrorMessage(instanceErrorMessage, env2 = process.env) {
347767
- const instanceMsg = instanceErrorMessage?.trim();
347768
- if (instanceMsg)
347769
- 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;
347770
347771
  const envMsg = env2.OMNI_AGENT_DISPATCH_ERROR_MESSAGE?.trim();
347771
347772
  if (envMsg)
347772
347773
  return envMsg;
@@ -347861,7 +347862,7 @@ async function handleDispatchFailure(services, db2, channel5, instance4, chatId,
347861
347862
  const handedOff = await triggerErrorHandoff(services, db2, channel5, instance4, chatId, resolveErrorHandoffMessage(), trustedTenantId);
347862
347863
  if (handedOff)
347863
347864
  return;
347864
- await sendErrorFeedback(channel5, instance4.id, chatId, error3, resolveDispatchErrorMessage(instance4.agentErrorMessage)).catch(() => {});
347865
+ await sendErrorFeedback(channel5, instance4.id, chatId, error3, resolveDispatchErrorMessage(instance4.agentErrorMessages)).catch(() => {});
347865
347866
  }
347866
347867
  function sleep6(ms) {
347867
347868
  return new Promise((resolve4) => setTimeout(resolve4, ms));
@@ -350715,7 +350716,7 @@ async function setupAgentDispatcher(eventBus, services, db2) {
350715
350716
  log104.info("Agent dispatcher shutdown complete");
350716
350717
  };
350717
350718
  }
350718
- 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;
350719
350720
  var init_agent_dispatcher = __esm(() => {
350720
350721
  init_src2();
350721
350722
  init_src();
@@ -357645,7 +357646,9 @@ var init_instances2 = __esm(() => {
357645
357646
  agentId: exports_external.string().uuid().nullable().optional().openapi({ description: "Agent UUID (agents table)" }),
357646
357647
  agentProviderId: exports_external.string().uuid().nullable().optional().openapi({ description: "Provider ID (agent provider)" }),
357647
357648
  agentTimeout: exports_external.number().openapi({ description: "Agent timeout in seconds" }),
357648
- agentErrorMessage: exports_external.string().nullable().optional().openapi({ description: "Customer-facing reply sent when agent dispatch fails (null = env/default fallback)" }),
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
+ }),
357649
357652
  agentStreamMode: exports_external.boolean().openapi({ description: "Whether streaming is enabled" }),
357650
357653
  createdAt: exports_external.string().datetime().openapi({ description: "Creation timestamp" }),
357651
357654
  updatedAt: exports_external.string().datetime().openapi({ description: "Last update timestamp" })
@@ -357655,7 +357658,9 @@ var init_instances2 = __esm(() => {
357655
357658
  channel: ChannelTypeSchema.openapi({ description: "Channel type" }),
357656
357659
  agentId: exports_external.string().uuid().nullable().optional().openapi({ description: "Agent UUID (agents table)" }),
357657
357660
  agentTimeout: exports_external.number().int().positive().default(600).openapi({ description: "Agent timeout in seconds" }),
357658
- agentErrorMessage: exports_external.string().nullable().optional().openapi({ description: "Customer-facing reply sent when agent dispatch fails (null = env/default fallback)" }),
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
+ }),
357659
357664
  agentStreamMode: exports_external.boolean().default(false).openapi({ description: "Enable streaming responses" }),
357660
357665
  isDefault: exports_external.boolean().default(false).openapi({ description: "Set as default instance for channel" }),
357661
357666
  token: exports_external.string().optional().openapi({ description: "Bot token for Discord instances" })
@@ -364428,7 +364433,7 @@ var init_instances3 = __esm(() => {
364428
364433
  channel: ChannelTypeSchema.describe("Channel type (e.g., whatsapp-baileys, discord)"),
364429
364434
  agentId: exports_external.string().uuid().nullable().optional().describe("Agent UUID referencing agents table"),
364430
364435
  agentTimeout: exports_external.number().int().positive().default(600).describe("Agent timeout in seconds"),
364431
- agentErrorMessage: exports_external.string().optional().nullable().describe("Customer-facing reply sent when agent dispatch fails (null = fall through to OMNI_AGENT_DISPATCH_ERROR_MESSAGE env, then built-in default)"),
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)"),
364432
364437
  agentStreamMode: exports_external.boolean().default(false).describe("Enable streaming responses"),
364433
364438
  agentReplyFilter: agentReplyFilterSchema.optional().nullable().describe("When agent should reply"),
364434
364439
  agentSessionStrategy: exports_external.enum(["per_user", "per_chat", "per_thread"]).default("per_chat").describe("Session strategy for agent memory"),
@@ -364486,7 +364491,7 @@ var init_instances3 = __esm(() => {
364486
364491
  });
364487
364492
  updateInstanceSchema = createInstanceSchema.partial().extend({
364488
364493
  agentId: exports_external.string().uuid().nullable().optional(),
364489
- agentErrorMessage: exports_external.string().nullable().optional(),
364494
+ agentErrorMessages: exports_external.array(exports_external.string()).nullable().optional(),
364490
364495
  agentReplyFilter: agentReplyFilterSchema.nullable().optional(),
364491
364496
  triggerEvents: exports_external.array(exports_external.string()).nullable().optional(),
364492
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.260731.1",
3
+ "version": "2.260731.2",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {