@lawpath-tech/openclaw 2026.2.21-11 → 2026.2.21-13
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/{agents-DBULaIPd.js → agents-Acsw6oEr.js} +4 -4
- package/dist/{agents.config-Cd3-RJ-K.js → agents.config-BAILtL0e.js} +1 -1
- package/dist/{agents.config-DANgtZcG.js → agents.config-DA4Kt9C5.js} +1 -1
- package/dist/{audio-preflight-Bqg8wRF0.js → audio-preflight-B45_FIbf.js} +4 -4
- package/dist/{audio-preflight-CSF2zAiB.js → audio-preflight-C56sndLt.js} +3 -3
- package/dist/{audio-preflight-DUN77LMG.js → audio-preflight-DTxmK1ti.js} +3 -3
- package/dist/{audio-preflight-DESlWRvS.js → audio-preflight-UmMU18Rf.js} +3 -3
- package/dist/{auth-choice-Bx0wfZkb.js → auth-choice-B0ExtimG.js} +1 -1
- package/dist/{auth-choice-EsB1VBYk.js → auth-choice-Cc9nPCSG.js} +1 -1
- package/dist/{banner-DSmZ1r91.js → banner-l8hdGVT6.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +6 -6
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-tp4SdwWn.js → channel-options-BOgY_qkz.js} +1 -1
- package/dist/{channel-options-BFQz6sGG.js → channel-options-DU0lH77F.js} +1 -1
- package/dist/{channel-web-BLVzXq0y.js → channel-web-Bn_o0ClJ.js} +2 -2
- package/dist/{channels-cli-BfRfj__G.js → channels-cli-B8iPHVyY.js} +8 -8
- package/dist/{channels-cli-DZWnK7L3.js → channels-cli-HyoLT0X_.js} +8 -8
- package/dist/{chrome-CnYcE5rb.js → chrome-DBIqeaeX.js} +7 -7
- package/dist/{cli-BMvkWAfY.js → cli-BjW27QBR.js} +5 -5
- package/dist/{cli-B5YSj6kb.js → cli-CB8wKUFa.js} +5 -5
- package/dist/{command-registry-DTFv7rlA.js → command-registry-43P-_3eW.js} +9 -9
- package/dist/{completion-cli-CJW4fXUd.js → completion-cli-BrkMcxdh.js} +1 -1
- package/dist/{completion-cli-BkAlGttV.js → completion-cli-CSoJQQhc.js} +2 -2
- package/dist/{config-cli-C0De5m2w.js → config-cli-CV3y1IAq.js} +1 -1
- package/dist/{config-cli-BBaQ2Rhl.js → config-cli-Cuv_T0Jj.js} +1 -1
- package/dist/{configure-DC4J1Gf2.js → configure-80FWz9jT.js} +3 -3
- package/dist/{configure-_wGqIyys.js → configure-BHGABgNw.js} +3 -3
- package/dist/control-ui/assets/{index-Cx1_w3YP.js → index-BfDl8X4O.js} +2 -2
- package/dist/control-ui/assets/index-BfDl8X4O.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/{deliver-D22uPds_.js → deliver-BLkQFTzD.js} +11 -6
- package/dist/{deliver-D3HyJhTX.js → deliver-BTK-PB1e.js} +11 -6
- package/dist/{deliver-Ct_AlJg5.js → deliver-J2cVd3TS.js} +11 -6
- package/dist/{deliver-BAjdrEoI.js → deliver-meQdcFaA.js} +11 -6
- package/dist/{doctor-completion-Cr7pfPFT.js → doctor-completion-CszISgAZ.js} +1 -1
- package/dist/{doctor-completion-C9EazQOq.js → doctor-completion-xnrUSWAw.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +5 -5
- package/dist/{gateway-cli-CUZeW2km.js → gateway-cli-1XLrLurk.js} +15 -14
- package/dist/{gateway-cli-DyK2K5AK.js → gateway-cli-ElJ71Lxb.js} +15 -14
- package/dist/{health-DB9FsqfO.js → health-BfWYn33I.js} +2 -2
- package/dist/{health-C1FEsrl3.js → health-DEibfTDK.js} +2 -2
- package/dist/{hooks-cli-ChPkWEjM.js → hooks-cli-D-nL8J6w.js} +6 -6
- package/dist/{hooks-cli-CrVA4n9U.js → hooks-cli-wQnxbc8T.js} +6 -6
- package/dist/{image-CvBYo9Bu.js → image-C8HOu4vb.js} +2 -2
- package/dist/{image-paXd6zl5.js → image-Cj9tfO74.js} +2 -2
- package/dist/{image-D-DzmVjC.js → image-Dozs-5EW.js} +2 -2
- package/dist/{image-DfOLBle4.js → image-DuT8yGCI.js} +2 -2
- package/dist/index.js +10 -10
- package/dist/llm-slug-generator.js +6 -6
- package/dist/{models-D1lcFJXE.js → models-DFRcZ415.js} +2 -2
- package/dist/{models-cli-B-AmUt5Z.js → models-cli-CwEUrjU_.js} +7 -7
- package/dist/{models-cli-B5hzd5e-.js → models-cli-t1rYl_DG.js} +6 -6
- package/dist/{onboard-BN9SewlV.js → onboard-BgexsYYf.js} +2 -2
- package/dist/{onboard-Bv6hNNhV.js → onboard-CE7hjJi-.js} +2 -2
- package/dist/{onboard-channels-DtiMw5DM.js → onboard-channels-Cb8T_ers.js} +1 -1
- package/dist/{onboard-channels-B9_hnbkl.js → onboard-channels-vQihczqp.js} +1 -1
- package/dist/{onboarding-BIFLJGsw.js → onboarding-BIEWyZPf.js} +3 -3
- package/dist/{onboarding-wkMK4RdO.js → onboarding-CX9LQxj2.js} +3 -3
- package/dist/{onboarding.finalize-C5_35yUD.js → onboarding.finalize-BUNWcC3i.js} +11 -11
- package/dist/{onboarding.finalize-Cq_uG8Il.js → onboarding.finalize-COQ2A83D.js} +10 -10
- package/dist/{pi-embedded-26dX6W8j.js → pi-embedded-BywyyGi2.js} +16 -12
- package/dist/{pi-embedded-Bt3VYQ6Q.js → pi-embedded-KtxTxaXU.js} +21 -17
- package/dist/{pi-embedded-helpers-ISSMvBMe.js → pi-embedded-helpers-B6070OEj.js} +44 -12
- package/dist/{pi-embedded-helpers-Cx3WmubG.js → pi-embedded-helpers-C4Annkh_.js} +40 -8
- package/dist/{pi-embedded-helpers-DOmGm3QX.js → pi-embedded-helpers-C_U_c_EU.js} +40 -8
- package/dist/{pi-embedded-helpers-DcmNfC3F.js → pi-embedded-helpers-Dl_FdUMU.js} +40 -8
- package/dist/{plugin-registry-CktL7kDf.js → plugin-registry-BrN1y1ig.js} +1 -1
- package/dist/{plugin-registry-DmGXbeyU.js → plugin-registry-CtLhKV8N.js} +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +1 -0
- package/dist/plugin-sdk/{audio-preflight-DTmPFRJ7.js → audio-preflight-zFFuY6Bd.js} +3 -3
- package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +1 -0
- package/dist/plugin-sdk/{channel-web-DBdAyFSo.js → channel-web-DfA1sgI9.js} +3 -3
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/{deliver-DvIFVzAj.js → deliver-D4QMj1KQ.js} +11 -6
- package/dist/plugin-sdk/{image-p_nEsuRt.js → image-Bu6pmW6i.js} +2 -2
- package/dist/plugin-sdk/index.js +6 -6
- package/dist/plugin-sdk/{pi-embedded-helpers-jfXMARle.js → pi-embedded-helpers-DBCtPcLq.js} +40 -8
- package/dist/plugin-sdk/{reply-CvZLZLYC.js → reply-Dl9JHnGW.js} +16 -12
- package/dist/plugin-sdk/{runner-B5paaQ1f.js → runner-DvYaPG7_.js} +1 -1
- package/dist/plugin-sdk/{web-xeAk5-Yr.js → web-BFEz8bk-.js} +6 -6
- package/dist/{plugins-cli-BB_bSrdc.js → plugins-cli-ByB9fyeR.js} +6 -6
- package/dist/{plugins-cli-B8LToOz_.js → plugins-cli-CP_m4f99.js} +6 -6
- package/dist/{program-CUQ4Dd4D.js → program-B51CfijA.js} +11 -11
- package/dist/{program-context-BL-eWj4d.js → program-context-DFA11MB9.js} +18 -18
- package/dist/{prompt-select-styled-Dw_5UkIh.js → prompt-select-styled-kNFZiNLD.js} +4 -4
- package/dist/{prompt-select-styled-OmW6kagQ.js → prompt-select-styled-y8kycqep.js} +4 -4
- package/dist/{provider-auth-helpers-CUdqrUdl.js → provider-auth-helpers-AORB3hk9.js} +1 -1
- package/dist/{provider-auth-helpers-Dj1zmS_9.js → provider-auth-helpers-TZ3D-fXq.js} +1 -1
- package/dist/{push-apns-BLl3-YNl.js → push-apns-BTcu7pip.js} +1 -1
- package/dist/{push-apns-DzvwLYLa.js → push-apns-CSSSwhDY.js} +1 -1
- package/dist/{pw-ai-MQ_9Ke4J.js → pw-ai-BW_4y-Af.js} +1 -1
- package/dist/{register.agent-DL4xNjz5.js → register.agent-C4G2zuxZ.js} +9 -9
- package/dist/{register.agent-DdcJgcQB.js → register.agent-xMmK5W-R.js} +10 -10
- package/dist/{register.configure-CahYnp2K.js → register.configure-CeFYJnjt.js} +10 -10
- package/dist/{register.configure-BOUoS25O.js → register.configure-aXmgTNuB.js} +10 -10
- package/dist/{register.maintenance-BBtBnw4T.js → register.maintenance-BD4w3mhl.js} +12 -12
- package/dist/{register.maintenance-CA0hn73s.js → register.maintenance-h74is0GZ.js} +11 -11
- package/dist/{register.message-C38olCA-.js → register.message-42he49is.js} +6 -6
- package/dist/{register.message-Bd2B4_gS.js → register.message-Cx6UTHOb.js} +6 -6
- package/dist/{register.onboard-CBcolfXI.js → register.onboard-CgQM-nZ7.js} +8 -8
- package/dist/{register.onboard-DmsHuosI.js → register.onboard-CnByKpp_.js} +8 -8
- package/dist/{register.setup-sWIbdPfJ.js → register.setup-B4qai0DZ.js} +8 -8
- package/dist/{register.setup-V09teeGQ.js → register.setup-CkW4jPu_.js} +8 -8
- package/dist/{register.status-health-sessions-BrlTrkeO.js → register.status-health-sessions-DHHGaJsX.js} +7 -7
- package/dist/{register.status-health-sessions-BHSA4iZL.js → register.status-health-sessions-DNqvYowR.js} +7 -7
- package/dist/{register.subclis-CNgqotfk.js → register.subclis-CSqyRt2t.js} +10 -10
- package/dist/{reply-BpeNwiEB.js → reply-V8UXM1XU.js} +16 -12
- package/dist/{run-main-ClMNdr5y.js → run-main-B3sc7X8M.js} +18 -18
- package/dist/{runner-Be7-7BcC.js → runner-CbkB3vpb.js} +1 -1
- package/dist/{runner-B9g6ervv.js → runner-D4U7RPrD.js} +1 -1
- package/dist/{runner-BIWQkeih.js → runner-DkWpm1Ly.js} +1 -1
- package/dist/{runner-D_-7GNC1.js → runner-DzmbTP-U.js} +1 -1
- package/dist/{server-node-events-C0ZzfaPA.js → server-node-events-D5Fen-q2.js} +6 -6
- package/dist/{server-node-events-CDra4Gjc.js → server-node-events-Dm6MSKk0.js} +6 -6
- package/dist/{session-dirs-D6iw22_Q.js → session-dirs-BmVdF2KM.js} +1 -1
- package/dist/{session-dirs-Cwn4le95.js → session-dirs-CRnGB63U.js} +1 -1
- package/dist/{status-CCPKZiSX.js → status-2w8d47j-.js} +2 -2
- package/dist/{status-DFs0LUlA.js → status-Bi_g-8aS.js} +1 -1
- package/dist/{status-CGTYQeqD.js → status-BjjDHl4v.js} +1 -1
- package/dist/{status-Rw3st2w_.js → status-DQEnKbht.js} +2 -2
- package/dist/{subagent-registry-C7ua7m8M.js → subagent-registry-DGNGenUN.js} +16 -12
- package/dist/{tui-C8TIc36Z.js → tui-BPSckkGa.js} +1 -1
- package/dist/{tui-dDj0kI9K.js → tui-Dn3NzP7B.js} +1 -1
- package/dist/{tui-cli-B1R2UxjK.js → tui-cli-DYhd0RT6.js} +2 -2
- package/dist/{tui-cli-DXNQuXf_.js → tui-cli-Dscc8usx.js} +2 -2
- package/dist/{update-cli-BxaSmz5G.js → update-cli-CLaJrUF4.js} +11 -11
- package/dist/{update-cli-DEMP1mj0.js → update-cli-DHAT02hj.js} +12 -12
- package/dist/{web-gSQnImv2.js → web-BpYdg2HU.js} +6 -6
- package/dist/{web-jg0rymdq.js → web-Ciz1i7yI.js} +6 -6
- package/dist/{web-D1CVLSCy.js → web-H55ayBNa.js} +5 -5
- package/dist/{web-YTTXENUe.js → web-aUEiU7C4.js} +5 -5
- package/package.json +1 -1
- package/dist/control-ui/assets/index-Cx1_w3YP.js.map +0 -1
|
@@ -211,9 +211,9 @@ function isCompactionFailureError(errorMessage) {
|
|
|
211
211
|
if (isLikelyContextOverflowError(errorMessage)) return true;
|
|
212
212
|
return lower.includes("context overflow");
|
|
213
213
|
}
|
|
214
|
-
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error)[:\s-]+/i;
|
|
214
|
+
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error)[:\s-]+/i;
|
|
215
215
|
const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/gi;
|
|
216
|
-
const ERROR_PREFIX_RE = /^(?:error|api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|request failed|failed|exception)[:\s-]+/i;
|
|
216
|
+
const ERROR_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error|request failed|failed|exception)(?:\s+\d{3})?[:\s-]+/i;
|
|
217
217
|
const CONTEXT_OVERFLOW_ERROR_HEAD_RE = /^(?:context overflow:|request_too_large\b|request size exceeds\b|request exceeds the maximum size\b|context length exceeded\b|maximum context length\b|prompt is too long\b|exceeds model context window\b)/i;
|
|
218
218
|
const BILLING_ERROR_HEAD_RE = /^(?:error[:\s-]+)?billing(?:\s+error)?(?:[:\s-]+|$)|^(?:error[:\s-]+)?(?:credit balance|insufficient credits?|payment required|http\s*402\b)/i;
|
|
219
219
|
const HTTP_STATUS_PREFIX_RE = /^(?:http\s*)?(\d{3})\s+(.+)$/i;
|
|
@@ -356,6 +356,25 @@ function getApiErrorPayloadFingerprint(raw) {
|
|
|
356
356
|
function isRawApiErrorPayload(raw) {
|
|
357
357
|
return getApiErrorPayloadFingerprint(raw) !== null;
|
|
358
358
|
}
|
|
359
|
+
function isLikelyProviderErrorType(type) {
|
|
360
|
+
const normalized = type?.trim().toLowerCase();
|
|
361
|
+
if (!normalized) return false;
|
|
362
|
+
return normalized.endsWith("_error");
|
|
363
|
+
}
|
|
364
|
+
const NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH = 16384;
|
|
365
|
+
const NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE = /^codex\s*error(?:\s+\d{3})?[:\s-]+/i;
|
|
366
|
+
function shouldRewriteRawPayloadWithoutErrorContext(raw) {
|
|
367
|
+
if (raw.length > NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH) return false;
|
|
368
|
+
if (!NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE.test(raw)) return false;
|
|
369
|
+
const info = parseApiErrorInfo(raw);
|
|
370
|
+
if (!info) return false;
|
|
371
|
+
if (isLikelyProviderErrorType(info.type)) return true;
|
|
372
|
+
if (info.httpCode) {
|
|
373
|
+
const parsedCode = Number(info.httpCode);
|
|
374
|
+
if (Number.isFinite(parsedCode) && parsedCode >= 400) return true;
|
|
375
|
+
}
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
359
378
|
function parseApiErrorInfo(raw) {
|
|
360
379
|
if (!raw) return null;
|
|
361
380
|
const trimmed = raw.trim();
|
|
@@ -398,12 +417,7 @@ function formatRawAssistantErrorForUi(raw) {
|
|
|
398
417
|
if (!rest.startsWith("{")) return `HTTP ${httpMatch[1]}: ${rest}`;
|
|
399
418
|
}
|
|
400
419
|
const info = parseApiErrorInfo(trimmed);
|
|
401
|
-
if (info?.message) {
|
|
402
|
-
const prefix = info.httpCode ? `HTTP ${info.httpCode}` : "LLM error";
|
|
403
|
-
const type = info.type ? ` ${info.type}` : "";
|
|
404
|
-
const requestId = info.requestId ? ` (request_id: ${info.requestId})` : "";
|
|
405
|
-
return `${prefix}${type}: ${info.message}${requestId}`;
|
|
406
|
-
}
|
|
420
|
+
if (info?.message) return `${info.httpCode ? `HTTP ${info.httpCode}` : "LLM error"}${info.type ? ` ${info.type}` : ""}: ${info.message}`;
|
|
407
421
|
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}…` : trimmed;
|
|
408
422
|
}
|
|
409
423
|
function formatAssistantErrorText(msg, opts) {
|
|
@@ -438,6 +452,7 @@ function sanitizeUserFacingText(text, opts) {
|
|
|
438
452
|
const stripped = stripFinalTagsFromText(text);
|
|
439
453
|
const trimmed = stripped.trim();
|
|
440
454
|
if (!trimmed) return "";
|
|
455
|
+
if (!errorContext && shouldRewriteRawPayloadWithoutErrorContext(trimmed)) return formatRawAssistantErrorForUi(trimmed);
|
|
441
456
|
if (errorContext) {
|
|
442
457
|
if (/incorrect role information|roles must alternate/i.test(trimmed)) return "Message ordering conflict - please try again. If this persists, use /new to start a fresh session.";
|
|
443
458
|
if (shouldRewriteContextOverflowText(trimmed)) return "Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model.";
|
|
@@ -472,6 +487,19 @@ const ERROR_PATTERNS = {
|
|
|
472
487
|
"service unavailable",
|
|
473
488
|
"high demand"
|
|
474
489
|
],
|
|
490
|
+
serverError: [
|
|
491
|
+
"an error occurred while processing",
|
|
492
|
+
"internal server error",
|
|
493
|
+
"internal_error",
|
|
494
|
+
"server_error",
|
|
495
|
+
"service temporarily unavailable",
|
|
496
|
+
"service_unavailable",
|
|
497
|
+
"bad gateway",
|
|
498
|
+
"gateway timeout",
|
|
499
|
+
"upstream error",
|
|
500
|
+
"upstream connect error",
|
|
501
|
+
"connection reset"
|
|
502
|
+
],
|
|
475
503
|
timeout: [
|
|
476
504
|
"timeout",
|
|
477
505
|
"timed out",
|
|
@@ -552,6 +580,9 @@ function isAuthErrorMessage(raw) {
|
|
|
552
580
|
function isOverloadedErrorMessage(raw) {
|
|
553
581
|
return matchesErrorPatterns(raw, ERROR_PATTERNS.overloaded);
|
|
554
582
|
}
|
|
583
|
+
function isServerErrorMessage(raw) {
|
|
584
|
+
return matchesErrorPatterns(raw, ERROR_PATTERNS.serverError);
|
|
585
|
+
}
|
|
555
586
|
function isJsonApiInternalServerError(raw) {
|
|
556
587
|
if (!raw) return false;
|
|
557
588
|
const value = raw.toLowerCase();
|
|
@@ -613,6 +644,7 @@ function classifyFailoverReason(raw) {
|
|
|
613
644
|
if (isBillingErrorMessage(raw)) return "billing";
|
|
614
645
|
if (isTimeoutErrorMessage(raw)) return "timeout";
|
|
615
646
|
if (isAuthErrorMessage(raw)) return "auth";
|
|
647
|
+
if (isServerErrorMessage(raw)) return "timeout";
|
|
616
648
|
return null;
|
|
617
649
|
}
|
|
618
650
|
function isFailoverErrorMessage(raw) {
|
|
@@ -6908,9 +6908,9 @@ function isCompactionFailureError(errorMessage) {
|
|
|
6908
6908
|
if (isLikelyContextOverflowError(errorMessage)) return true;
|
|
6909
6909
|
return lower.includes("context overflow");
|
|
6910
6910
|
}
|
|
6911
|
-
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error)[:\s-]+/i;
|
|
6911
|
+
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error)[:\s-]+/i;
|
|
6912
6912
|
const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/gi;
|
|
6913
|
-
const ERROR_PREFIX_RE = /^(?:error|api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|request failed|failed|exception)[:\s-]+/i;
|
|
6913
|
+
const ERROR_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error|request failed|failed|exception)(?:\s+\d{3})?[:\s-]+/i;
|
|
6914
6914
|
const CONTEXT_OVERFLOW_ERROR_HEAD_RE = /^(?:context overflow:|request_too_large\b|request size exceeds\b|request exceeds the maximum size\b|context length exceeded\b|maximum context length\b|prompt is too long\b|exceeds model context window\b)/i;
|
|
6915
6915
|
const BILLING_ERROR_HEAD_RE = /^(?:error[:\s-]+)?billing(?:\s+error)?(?:[:\s-]+|$)|^(?:error[:\s-]+)?(?:credit balance|insufficient credits?|payment required|http\s*402\b)/i;
|
|
6916
6916
|
const HTTP_STATUS_PREFIX_RE = /^(?:http\s*)?(\d{3})\s+(.+)$/i;
|
|
@@ -7053,6 +7053,25 @@ function getApiErrorPayloadFingerprint(raw) {
|
|
|
7053
7053
|
function isRawApiErrorPayload(raw) {
|
|
7054
7054
|
return getApiErrorPayloadFingerprint(raw) !== null;
|
|
7055
7055
|
}
|
|
7056
|
+
function isLikelyProviderErrorType(type) {
|
|
7057
|
+
const normalized = type?.trim().toLowerCase();
|
|
7058
|
+
if (!normalized) return false;
|
|
7059
|
+
return normalized.endsWith("_error");
|
|
7060
|
+
}
|
|
7061
|
+
const NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH = 16384;
|
|
7062
|
+
const NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE = /^codex\s*error(?:\s+\d{3})?[:\s-]+/i;
|
|
7063
|
+
function shouldRewriteRawPayloadWithoutErrorContext(raw) {
|
|
7064
|
+
if (raw.length > NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH) return false;
|
|
7065
|
+
if (!NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE.test(raw)) return false;
|
|
7066
|
+
const info = parseApiErrorInfo(raw);
|
|
7067
|
+
if (!info) return false;
|
|
7068
|
+
if (isLikelyProviderErrorType(info.type)) return true;
|
|
7069
|
+
if (info.httpCode) {
|
|
7070
|
+
const parsedCode = Number(info.httpCode);
|
|
7071
|
+
if (Number.isFinite(parsedCode) && parsedCode >= 400) return true;
|
|
7072
|
+
}
|
|
7073
|
+
return false;
|
|
7074
|
+
}
|
|
7056
7075
|
function parseApiErrorInfo(raw) {
|
|
7057
7076
|
if (!raw) return null;
|
|
7058
7077
|
const trimmed = raw.trim();
|
|
@@ -7095,12 +7114,7 @@ function formatRawAssistantErrorForUi(raw) {
|
|
|
7095
7114
|
if (!rest.startsWith("{")) return `HTTP ${httpMatch[1]}: ${rest}`;
|
|
7096
7115
|
}
|
|
7097
7116
|
const info = parseApiErrorInfo(trimmed);
|
|
7098
|
-
if (info?.message) {
|
|
7099
|
-
const prefix = info.httpCode ? `HTTP ${info.httpCode}` : "LLM error";
|
|
7100
|
-
const type = info.type ? ` ${info.type}` : "";
|
|
7101
|
-
const requestId = info.requestId ? ` (request_id: ${info.requestId})` : "";
|
|
7102
|
-
return `${prefix}${type}: ${info.message}${requestId}`;
|
|
7103
|
-
}
|
|
7117
|
+
if (info?.message) return `${info.httpCode ? `HTTP ${info.httpCode}` : "LLM error"}${info.type ? ` ${info.type}` : ""}: ${info.message}`;
|
|
7104
7118
|
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}…` : trimmed;
|
|
7105
7119
|
}
|
|
7106
7120
|
function formatAssistantErrorText(msg, opts) {
|
|
@@ -7135,6 +7149,7 @@ function sanitizeUserFacingText(text, opts) {
|
|
|
7135
7149
|
const stripped = stripFinalTagsFromText(text);
|
|
7136
7150
|
const trimmed = stripped.trim();
|
|
7137
7151
|
if (!trimmed) return "";
|
|
7152
|
+
if (!errorContext && shouldRewriteRawPayloadWithoutErrorContext(trimmed)) return formatRawAssistantErrorForUi(trimmed);
|
|
7138
7153
|
if (errorContext) {
|
|
7139
7154
|
if (/incorrect role information|roles must alternate/i.test(trimmed)) return "Message ordering conflict - please try again. If this persists, use /new to start a fresh session.";
|
|
7140
7155
|
if (shouldRewriteContextOverflowText(trimmed)) return "Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model.";
|
|
@@ -7169,6 +7184,19 @@ const ERROR_PATTERNS = {
|
|
|
7169
7184
|
"service unavailable",
|
|
7170
7185
|
"high demand"
|
|
7171
7186
|
],
|
|
7187
|
+
serverError: [
|
|
7188
|
+
"an error occurred while processing",
|
|
7189
|
+
"internal server error",
|
|
7190
|
+
"internal_error",
|
|
7191
|
+
"server_error",
|
|
7192
|
+
"service temporarily unavailable",
|
|
7193
|
+
"service_unavailable",
|
|
7194
|
+
"bad gateway",
|
|
7195
|
+
"gateway timeout",
|
|
7196
|
+
"upstream error",
|
|
7197
|
+
"upstream connect error",
|
|
7198
|
+
"connection reset"
|
|
7199
|
+
],
|
|
7172
7200
|
timeout: [
|
|
7173
7201
|
"timeout",
|
|
7174
7202
|
"timed out",
|
|
@@ -7249,6 +7277,9 @@ function isAuthErrorMessage(raw) {
|
|
|
7249
7277
|
function isOverloadedErrorMessage(raw) {
|
|
7250
7278
|
return matchesErrorPatterns(raw, ERROR_PATTERNS.overloaded);
|
|
7251
7279
|
}
|
|
7280
|
+
function isServerErrorMessage(raw) {
|
|
7281
|
+
return matchesErrorPatterns(raw, ERROR_PATTERNS.serverError);
|
|
7282
|
+
}
|
|
7252
7283
|
function isJsonApiInternalServerError(raw) {
|
|
7253
7284
|
if (!raw) return false;
|
|
7254
7285
|
const value = raw.toLowerCase();
|
|
@@ -7310,6 +7341,7 @@ function classifyFailoverReason(raw) {
|
|
|
7310
7341
|
if (isBillingErrorMessage(raw)) return "billing";
|
|
7311
7342
|
if (isTimeoutErrorMessage(raw)) return "timeout";
|
|
7312
7343
|
if (isAuthErrorMessage(raw)) return "auth";
|
|
7344
|
+
if (isServerErrorMessage(raw)) return "timeout";
|
|
7313
7345
|
return null;
|
|
7314
7346
|
}
|
|
7315
7347
|
function isFailoverErrorMessage(raw) {
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
|
2
2
|
import { M as getActivePluginRegistry, o as createSubsystemLogger } from "./entry.js";
|
|
3
3
|
import { c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-BhZr1_OI.js";
|
|
4
4
|
import { i as loadConfig } from "./config-26MDXfhB.js";
|
|
5
|
-
import { g as loadOpenClawPlugins } from "./subagent-registry-
|
|
5
|
+
import { g as loadOpenClawPlugins } from "./subagent-registry-DGNGenUN.js";
|
|
6
6
|
|
|
7
7
|
//#region src/cli/plugin-registry.ts
|
|
8
8
|
var plugin_registry_exports = /* @__PURE__ */ __exportAll({ ensurePluginRegistryLoaded: () => ensurePluginRegistryLoaded });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { gt as loadOpenClawPlugins } from "./reply-
|
|
2
|
+
import { gt as loadOpenClawPlugins } from "./reply-V8UXM1XU.js";
|
|
3
3
|
import { d as getActivePluginRegistry } from "./registry-Dygi7Azw.js";
|
|
4
4
|
import { t as createSubsystemLogger } from "./subsystem-8bY95KEB.js";
|
|
5
5
|
import { c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-Dl-vG2QO.js";
|
|
@@ -35,6 +35,7 @@ export declare function isMissingToolCallInputError(raw: string): boolean;
|
|
|
35
35
|
export declare function isBillingAssistantError(msg: AssistantMessage | undefined): boolean;
|
|
36
36
|
export declare function isAuthErrorMessage(raw: string): boolean;
|
|
37
37
|
export declare function isOverloadedErrorMessage(raw: string): boolean;
|
|
38
|
+
export declare function isServerErrorMessage(raw: string): boolean;
|
|
38
39
|
export declare function parseImageDimensionError(raw: string): {
|
|
39
40
|
maxDimensionPx?: number;
|
|
40
41
|
messageIndex?: number;
|
|
@@ -17,16 +17,16 @@ import "./local-roots-CW6TWE2a.js";
|
|
|
17
17
|
import "./message-channel-DY9wVB2A.js";
|
|
18
18
|
import "./bindings-HAeLX6mi.js";
|
|
19
19
|
import "./tool-images-BlYojiWx.js";
|
|
20
|
-
import { a as resolveMediaAttachmentLocalRoots, n as createMediaAttachmentCache, o as runCapability, r as normalizeMediaAttachments, t as buildProviderRegistry, u as isAudioAttachment } from "./runner-
|
|
20
|
+
import { a as resolveMediaAttachmentLocalRoots, n as createMediaAttachmentCache, o as runCapability, r as normalizeMediaAttachments, t as buildProviderRegistry, u as isAudioAttachment } from "./runner-DvYaPG7_.js";
|
|
21
21
|
import "./skills-DBG2n4rQ.js";
|
|
22
22
|
import "./chrome-NvVwZ3Xn.js";
|
|
23
23
|
import "./thinking-BiNjzudU.js";
|
|
24
24
|
import "./accounts-DEsAwvaZ.js";
|
|
25
25
|
import "./accounts-BcQo4OUu.js";
|
|
26
|
-
import "./pi-embedded-helpers-
|
|
26
|
+
import "./pi-embedded-helpers-DBCtPcLq.js";
|
|
27
27
|
import "./paths-BNQjLbn7.js";
|
|
28
28
|
import "./store-CMGBlFGX.js";
|
|
29
|
-
import "./image-
|
|
29
|
+
import "./image-Bu6pmW6i.js";
|
|
30
30
|
import "./pi-model-discovery-LbcEa65a.js";
|
|
31
31
|
import "./api-key-rotation-DRhVpAS4.js";
|
|
32
32
|
|
|
@@ -37,6 +37,7 @@ export type ReplyDispatcherWithTypingOptions = Omit<ReplyDispatcherOptions, "onI
|
|
|
37
37
|
type ReplyDispatcherWithTypingResult = {
|
|
38
38
|
dispatcher: ReplyDispatcher;
|
|
39
39
|
replyOptions: Pick<GetReplyOptions, "onReplyStart" | "onTypingController" | "onTypingCleanup">;
|
|
40
|
+
markRunComplete: () => void;
|
|
40
41
|
markDispatchIdle: () => void;
|
|
41
42
|
};
|
|
42
43
|
export type ReplyDispatcher = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as buildGroupHistoryKey, n as DEFAULT_MAIN_KEY, r as buildAgentMainSessionKey, s as normalizeAgentId } from "./session-key-C_0eELjb.js";
|
|
2
2
|
import { f as readWebSelfId, o as getWebAuthAgeMs, r as resolveWhatsAppAccount } from "./accounts-fnLsjAOi.js";
|
|
3
|
-
import { E as enqueueSystemEvent, G as resolveMentionGating, W as shouldAckReactionForWhatsApp, X as buildHistoryContextFromEntries, Y as DEFAULT_GROUP_HISTORY_LIMIT, _ as resolveEnvelopeFormatOptions, c as computeBackoff, d as formatDurationPrecise, f as dispatchReplyWithBufferedBlockDispatcher, g as formatInboundEnvelope, h as resolveInboundDebounceMs, ht as createDedupeCache, l as sleepWithAbort, m as createInboundDebouncer, n as normalizeGroupActivation, nt as buildMentionRegexes, r as parseActivationCommand, rt as normalizeMentionText, t as getReplyFromConfig, tt as recordPendingHistoryEntryIfEnabled, u as buildPairingReply, v as hasControlCommand, y as shouldComputeCommandAuthorized } from "./reply-
|
|
3
|
+
import { E as enqueueSystemEvent, G as resolveMentionGating, W as shouldAckReactionForWhatsApp, X as buildHistoryContextFromEntries, Y as DEFAULT_GROUP_HISTORY_LIMIT, _ as resolveEnvelopeFormatOptions, c as computeBackoff, d as formatDurationPrecise, f as dispatchReplyWithBufferedBlockDispatcher, g as formatInboundEnvelope, h as resolveInboundDebounceMs, ht as createDedupeCache, l as sleepWithAbort, m as createInboundDebouncer, n as normalizeGroupActivation, nt as buildMentionRegexes, r as parseActivationCommand, rt as normalizeMentionText, t as getReplyFromConfig, tt as recordPendingHistoryEntryIfEnabled, u as buildPairingReply, v as hasControlCommand, y as shouldComputeCommandAuthorized } from "./reply-Dl9JHnGW.js";
|
|
4
4
|
import { A as normalizeE164, B as toWhatsappJid, K as logVerbose, N as resolveJidToE164, O as isSelfChatMode, R as sleep, Y as shouldLogVerbose, k as jidToE164, s as normalizeChatChannelId, tt as getChildLogger, x as clamp } from "./registry-DL-33c9X.js";
|
|
5
5
|
import { n as loadConfig } from "./config-C1a-yGCa.js";
|
|
6
6
|
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-C9WnrKN8.js";
|
|
@@ -12,10 +12,10 @@ import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveText
|
|
|
12
12
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-OYHjLFmr.js";
|
|
13
13
|
import { t as convertMarkdownTables } from "./tables-DzujD35V.js";
|
|
14
14
|
import { G as readChannelAllowFromStore, J as upsertChannelPairingRequest, K as readChannelAllowFromStoreSync, nt as toLocationContext, tt as formatLocationText } from "./send-CNMXFSjB.js";
|
|
15
|
-
import { f as registerUnhandledRejectionHandler } from "./runner-
|
|
15
|
+
import { f as registerUnhandledRejectionHandler } from "./runner-DvYaPG7_.js";
|
|
16
16
|
import { l as resolveIdentityNamePrefix, n as createReplyPrefixOptions, u as resolveMessagePrefix } from "./reply-prefix-DNmkrWtV.js";
|
|
17
17
|
import { F as resolveChannelGroupRequireMention, P as resolveChannelGroupPolicy } from "./thinking-BiNjzudU.js";
|
|
18
|
-
import { Xt as resolveGroupSessionKey, _t as updateLastRoute, gt as recordSessionMetaFromInbound, ht as readSessionUpdatedAt, mt as loadSessionStore } from "./pi-embedded-helpers-
|
|
18
|
+
import { Xt as resolveGroupSessionKey, _t as updateLastRoute, gt as recordSessionMetaFromInbound, ht as readSessionUpdatedAt, mt as loadSessionStore } from "./pi-embedded-helpers-DBCtPcLq.js";
|
|
19
19
|
import { s as resolveStorePath } from "./paths-BNQjLbn7.js";
|
|
20
20
|
import { i as saveMediaBuffer } from "./store-CMGBlFGX.js";
|
|
21
21
|
import { t as finalizeInboundContext } from "./inbound-context-D5EzMeL_.js";
|
|
@@ -11,6 +11,8 @@ export type AgentStreamParams = {
|
|
|
11
11
|
/** Provider stream params override (best-effort). */
|
|
12
12
|
temperature?: number;
|
|
13
13
|
maxTokens?: number;
|
|
14
|
+
/** Anthropic prompt cache retention ("short" = 5 min, "long" = 1 hour, "none" = off). */
|
|
15
|
+
cacheRetention?: "none" | "short" | "long";
|
|
14
16
|
};
|
|
15
17
|
export type AgentRunContext = {
|
|
16
18
|
messageChannel?: string;
|
|
@@ -9,7 +9,7 @@ import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveText
|
|
|
9
9
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-OYHjLFmr.js";
|
|
10
10
|
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-2475WU2Z.js";
|
|
11
11
|
import { d as getChannelDock } from "./thinking-BiNjzudU.js";
|
|
12
|
-
import { dt as appendAssistantMessageToSessionTranscript, ft as resolveMirroredTranscriptText, i as isMessagingToolDuplicate } from "./pi-embedded-helpers-
|
|
12
|
+
import { dt as appendAssistantMessageToSessionTranscript, ft as resolveMirroredTranscriptText, i as isMessagingToolDuplicate } from "./pi-embedded-helpers-DBCtPcLq.js";
|
|
13
13
|
import { a as markdownToSignalTextChunks, t as sendMessageSignal } from "./send-BsKrW0Xh.js";
|
|
14
14
|
import fs from "node:fs";
|
|
15
15
|
import path from "node:path";
|
|
@@ -539,8 +539,13 @@ async function failDelivery(id, error, stateDir) {
|
|
|
539
539
|
//#region src/utils/directive-tags.ts
|
|
540
540
|
const AUDIO_TAG_RE = /\[\[\s*audio_as_voice\s*\]\]/gi;
|
|
541
541
|
const REPLY_TAG_RE = /\[\[\s*(?:reply_to_current|reply_to\s*:\s*([^\]\n]+))\s*\]\]/gi;
|
|
542
|
+
function replacementPreservesWordBoundary(source, offset, length) {
|
|
543
|
+
const before = source[offset - 1];
|
|
544
|
+
const after = source[offset + length];
|
|
545
|
+
return before && after && !/\s/u.test(before) && !/\s/u.test(after) ? " " : "";
|
|
546
|
+
}
|
|
542
547
|
function normalizeDirectiveWhitespace(text) {
|
|
543
|
-
return text.replace(/[ \t]
|
|
548
|
+
return text.replace(/\r\n/g, "\n").replace(/([^\s])[ \t]{2,}([^\s])/g, "$1 $2").replace(/^\n+/, "").replace(/^[ \t](?=\S)/, "").replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trimEnd();
|
|
544
549
|
}
|
|
545
550
|
function parseInlineDirectives(text, options = {}) {
|
|
546
551
|
const { currentMessageId, stripAudioTag = true, stripReplyTags = true } = options;
|
|
@@ -557,19 +562,19 @@ function parseInlineDirectives(text, options = {}) {
|
|
|
557
562
|
let hasReplyTag = false;
|
|
558
563
|
let sawCurrent = false;
|
|
559
564
|
let lastExplicitId;
|
|
560
|
-
cleaned = cleaned.replace(AUDIO_TAG_RE, (match) => {
|
|
565
|
+
cleaned = cleaned.replace(AUDIO_TAG_RE, (match, offset, source) => {
|
|
561
566
|
audioAsVoice = true;
|
|
562
567
|
hasAudioTag = true;
|
|
563
|
-
return stripAudioTag ?
|
|
568
|
+
return stripAudioTag ? replacementPreservesWordBoundary(source, offset, match.length) : match;
|
|
564
569
|
});
|
|
565
|
-
cleaned = cleaned.replace(REPLY_TAG_RE, (match, idRaw) => {
|
|
570
|
+
cleaned = cleaned.replace(REPLY_TAG_RE, (match, idRaw, offset, source) => {
|
|
566
571
|
hasReplyTag = true;
|
|
567
572
|
if (idRaw === void 0) sawCurrent = true;
|
|
568
573
|
else {
|
|
569
574
|
const id = idRaw.trim();
|
|
570
575
|
if (id) lastExplicitId = id;
|
|
571
576
|
}
|
|
572
|
-
return stripReplyTags ?
|
|
577
|
+
return stripReplyTags ? replacementPreservesWordBoundary(source, offset, match.length) : match;
|
|
573
578
|
});
|
|
574
579
|
cleaned = normalizeDirectiveWhitespace(cleaned);
|
|
575
580
|
const replyToId = lastExplicitId ?? (sawCurrent ? currentMessageId?.trim() || void 0 : void 0);
|
|
@@ -3,7 +3,7 @@ import { D as isRecord, I as shortenHomeInString } from "./registry-DL-33c9X.js"
|
|
|
3
3
|
import { n as loadConfig } from "./config-C1a-yGCa.js";
|
|
4
4
|
import { B as resolveOpenClawAgentDir, G as normalizeSecretInput, S as getApiKeyForModel, _ as resolveImplicitBedrockProvider, g as normalizeProviders, v as resolveImplicitCopilotProvider, w as requireApiKey, y as resolveImplicitProviders } from "./model-selection-TMsqRl-p.js";
|
|
5
5
|
import { n as redactToolDetail } from "./redact-DPnDWsnT.js";
|
|
6
|
-
import { N as sanitizeUserFacingText } from "./pi-embedded-helpers-
|
|
6
|
+
import { N as sanitizeUserFacingText } from "./pi-embedded-helpers-DBCtPcLq.js";
|
|
7
7
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-LbcEa65a.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
@@ -215,7 +215,7 @@ const FINAL_TAG_RE = /<\s*\/?\s*final\b[^<>]*>/gi;
|
|
|
215
215
|
const THINKING_TAG_RE = /<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;
|
|
216
216
|
function findCodeRegions(text) {
|
|
217
217
|
const regions = [];
|
|
218
|
-
for (const match of text.matchAll(/(^|\n)(```|~~~)[^\n]*\n[\s\S]*?(?:\n\2
|
|
218
|
+
for (const match of text.matchAll(/(^|\n)(```|~~~)[^\n]*\n[\s\S]*?(?:\n\2|$)/g)) {
|
|
219
219
|
const start = (match.index ?? 0) + match[1].length;
|
|
220
220
|
regions.push({
|
|
221
221
|
start,
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as DEFAULT_ACCOUNT_ID, p as normalizeAccountId } from "./session-key-C_0eELjb.js";
|
|
2
2
|
import { _ as createAccountListHelpers, i as resolveWhatsAppAuthDir, n as resolveDefaultWhatsAppAccountId, r as resolveWhatsAppAccount, t as listWhatsAppAccountIds } from "./accounts-fnLsjAOi.js";
|
|
3
|
-
import { $ as clearHistoryEntriesIfEnabled, A as resolveDiscordUserAllowlist, B as logTypingFailure, C as stripMarkdown, Ct as unbindThreadBindingsBySessionKey, D as resolveSlackUserAllowlist, Dt as BLUEBUBBLES_ACTION_NAMES, Et as BLUEBUBBLES_ACTIONS, F as stringEnum, G as resolveMentionGating, H as removeAckReactionAfterReply, I as recordInboundSession, J as summarizeMapping, K as resolveMentionGatingWithBypass, L as resolveControlCommandGate, M as collectDiscordAuditChannelIds, N as formatDocsLink, O as resolveSlackChannelAllowlist, Ot as BLUEBUBBLES_GROUP_ACTIONS, P as optionalStringEnum, Q as clearHistoryEntries, R as logAckFailure, S as processLineMessage, St as listThreadBindingsBySessionKey, T as attachFooterText, Tt as resolveAllowlistMatchSimple, U as shouldAckReaction, V as createTypingCallbacks, W as shouldAckReactionForWhatsApp, Y as DEFAULT_GROUP_HISTORY_LIMIT, Z as buildPendingHistoryContextFromMap, _t as listDevicePairing, a as normalizeAccountId$1, at as isWSLEnv, bt as registerPluginHttpRoute, ct as DEFAULT_WEBHOOK_MAX_BODY_BYTES, dt as isRequestBodyLimitError, et as recordPendingHistoryEntry, ft as readJsonBodyWithLimit, gt as approveDevicePairing, ht as createDedupeCache, i as listLineAccountIds, it as isWSL2Sync, j as resolveDiscordChannelAllowlist, k as detectBinary, kt as CHANNEL_MESSAGE_ACTION_NAMES, lt as RequestBodyLimitError, mt as requestBodyErrorToText, o as resolveDefaultLineAccountId, ot as isWSLSync, pt as readRequestBodyWithLimit, q as mergeAllowlist, s as resolveLineAccount, st as DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, tt as recordPendingHistoryEntryIfEnabled, ut as installRequestBodyLimitGuard, vt as rejectDevicePairing, w as createReceiptCard, wt as formatAllowlistMatchMeta, x as hasMarkdownToConvert, xt as autoBindSpawnedDiscordSubagent, yt as extractToolSend, z as logInboundDrop } from "./reply-
|
|
3
|
+
import { $ as clearHistoryEntriesIfEnabled, A as resolveDiscordUserAllowlist, B as logTypingFailure, C as stripMarkdown, Ct as unbindThreadBindingsBySessionKey, D as resolveSlackUserAllowlist, Dt as BLUEBUBBLES_ACTION_NAMES, Et as BLUEBUBBLES_ACTIONS, F as stringEnum, G as resolveMentionGating, H as removeAckReactionAfterReply, I as recordInboundSession, J as summarizeMapping, K as resolveMentionGatingWithBypass, L as resolveControlCommandGate, M as collectDiscordAuditChannelIds, N as formatDocsLink, O as resolveSlackChannelAllowlist, Ot as BLUEBUBBLES_GROUP_ACTIONS, P as optionalStringEnum, Q as clearHistoryEntries, R as logAckFailure, S as processLineMessage, St as listThreadBindingsBySessionKey, T as attachFooterText, Tt as resolveAllowlistMatchSimple, U as shouldAckReaction, V as createTypingCallbacks, W as shouldAckReactionForWhatsApp, Y as DEFAULT_GROUP_HISTORY_LIMIT, Z as buildPendingHistoryContextFromMap, _t as listDevicePairing, a as normalizeAccountId$1, at as isWSLEnv, bt as registerPluginHttpRoute, ct as DEFAULT_WEBHOOK_MAX_BODY_BYTES, dt as isRequestBodyLimitError, et as recordPendingHistoryEntry, ft as readJsonBodyWithLimit, gt as approveDevicePairing, ht as createDedupeCache, i as listLineAccountIds, it as isWSL2Sync, j as resolveDiscordChannelAllowlist, k as detectBinary, kt as CHANNEL_MESSAGE_ACTION_NAMES, lt as RequestBodyLimitError, mt as requestBodyErrorToText, o as resolveDefaultLineAccountId, ot as isWSLSync, pt as readRequestBodyWithLimit, q as mergeAllowlist, s as resolveLineAccount, st as DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, tt as recordPendingHistoryEntryIfEnabled, ut as installRequestBodyLimitGuard, vt as rejectDevicePairing, w as createReceiptCard, wt as formatAllowlistMatchMeta, x as hasMarkdownToConvert, xt as autoBindSpawnedDiscordSubagent, yt as extractToolSend, z as logInboundDrop } from "./reply-Dl9JHnGW.js";
|
|
4
4
|
import "./paths-DVWx7USN.js";
|
|
5
5
|
import "./github-copilot-token-Cg0YPPSu.js";
|
|
6
6
|
import { D as resolveSlackAccount, E as resolveDefaultSlackAccountId, F as resolveDiscordAccount, M as listDiscordAccountIds, O as resolveSlackReplyToMode, P as resolveDefaultDiscordAccountId, S as resolveTelegramAccount, T as listSlackAccountIds, _ as normalizeWhatsAppTarget, a as listDiscordDirectoryPeersFromConfig, b as listTelegramAccountIds, c as listTelegramDirectoryGroupsFromConfig, d as listWhatsAppDirectoryPeersFromConfig, f as looksLikeSlackTargetId, g as isWhatsAppGroupJid, i as listDiscordDirectoryGroupsFromConfig, l as listTelegramDirectoryPeersFromConfig, o as listSlackDirectoryGroupsFromConfig, p as normalizeSlackMessagingTarget, s as listSlackDirectoryPeersFromConfig, u as listWhatsAppDirectoryGroupsFromConfig, w as listEnabledSlackAccounts, x as resolveDefaultTelegramAccountId } from "./plugins-BizZYn_y.js";
|
|
@@ -32,7 +32,7 @@ import "./tool-images-BlYojiWx.js";
|
|
|
32
32
|
import { a as createActionGate, c as jsonResult, d as readReactionParams, m as readStringParam, n as missingTargetError, u as readNumberParam } from "./target-errors-KOPdGMxQ.js";
|
|
33
33
|
import { s as parseSlackBlocksInput } from "./send-3DmbiJfM.js";
|
|
34
34
|
import { it as writeJsonFileAtomically, nt as toLocationContext, rt as readJsonFileWithFallback, tt as formatLocationText } from "./send-CNMXFSjB.js";
|
|
35
|
-
import { b as withTempDownloadPath, y as buildRandomTempFilePath } from "./runner-
|
|
35
|
+
import { b as withTempDownloadPath, y as buildRandomTempFilePath } from "./runner-DvYaPG7_.js";
|
|
36
36
|
import { a as resolveAckReaction, n as createReplyPrefixOptions, t as createReplyPrefixContext } from "./reply-prefix-DNmkrWtV.js";
|
|
37
37
|
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-2475WU2Z.js";
|
|
38
38
|
import "./skill-commands-D7degVS7.js";
|
|
@@ -41,14 +41,14 @@ import { N as rawDataToString } from "./chrome-NvVwZ3Xn.js";
|
|
|
41
41
|
import { C as resolveSlackGroupRequireMention, D as resolveWhatsAppGroupRequireMention, E as resolveTelegramGroupToolPolicy, L as resolveToolsBySender, N as buildSlackThreadingToolContext, O as resolveWhatsAppGroupToolPolicy, S as resolveIMessageGroupToolPolicy, T as resolveTelegramGroupRequireMention, _ as resolveDiscordGroupRequireMention, b as resolveGoogleChatGroupToolPolicy, g as resolveBlueBubblesGroupToolPolicy, h as resolveBlueBubblesGroupRequireMention, m as normalizeSignalMessagingTarget, p as looksLikeSignalTargetId, v as resolveDiscordGroupToolPolicy, w as resolveSlackGroupToolPolicy, x as resolveIMessageGroupRequireMention, y as resolveGoogleChatGroupRequireMention } from "./thinking-BiNjzudU.js";
|
|
42
42
|
import { n as resolveDefaultIMessageAccountId, r as resolveIMessageAccount, t as listIMessageAccountIds } from "./accounts-DEsAwvaZ.js";
|
|
43
43
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId } from "./accounts-BcQo4OUu.js";
|
|
44
|
-
import { T as resolveChannelMediaMaxBytes } from "./deliver-
|
|
45
|
-
import "./pi-embedded-helpers-
|
|
44
|
+
import { T as resolveChannelMediaMaxBytes } from "./deliver-D4QMj1KQ.js";
|
|
45
|
+
import "./pi-embedded-helpers-DBCtPcLq.js";
|
|
46
46
|
import "./paths-BNQjLbn7.js";
|
|
47
47
|
import { h as onDiagnosticEvent, m as isDiagnosticsEnabled, p as emitDiagnosticEvent } from "./diagnostic-Up1aMyxZ.js";
|
|
48
48
|
import { n as extractOriginalFilename } from "./store-CMGBlFGX.js";
|
|
49
49
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-DCb1ht31.js";
|
|
50
|
-
import { r as resolveWhatsAppHeartbeatRecipients } from "./channel-web-
|
|
51
|
-
import "./image-
|
|
50
|
+
import { r as resolveWhatsAppHeartbeatRecipients } from "./channel-web-DfA1sgI9.js";
|
|
51
|
+
import "./image-Bu6pmW6i.js";
|
|
52
52
|
import "./pi-model-discovery-LbcEa65a.js";
|
|
53
53
|
import "./api-key-rotation-DRhVpAS4.js";
|
|
54
54
|
import "./sqlite-ulpcowfN.js";
|
|
@@ -6895,9 +6895,9 @@ function isCompactionFailureError(errorMessage) {
|
|
|
6895
6895
|
if (isLikelyContextOverflowError(errorMessage)) return true;
|
|
6896
6896
|
return lower.includes("context overflow");
|
|
6897
6897
|
}
|
|
6898
|
-
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error)[:\s-]+/i;
|
|
6898
|
+
const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error)[:\s-]+/i;
|
|
6899
6899
|
const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/gi;
|
|
6900
|
-
const ERROR_PREFIX_RE = /^(?:error|api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|request failed|failed|exception)[:\s-]+/i;
|
|
6900
|
+
const ERROR_PREFIX_RE = /^(?:error|(?:[a-z][\w-]*\s+)?api\s*error|openai\s*error|anthropic\s*error|gateway\s*error|codex\s*error|request failed|failed|exception)(?:\s+\d{3})?[:\s-]+/i;
|
|
6901
6901
|
const CONTEXT_OVERFLOW_ERROR_HEAD_RE = /^(?:context overflow:|request_too_large\b|request size exceeds\b|request exceeds the maximum size\b|context length exceeded\b|maximum context length\b|prompt is too long\b|exceeds model context window\b)/i;
|
|
6902
6902
|
const BILLING_ERROR_HEAD_RE = /^(?:error[:\s-]+)?billing(?:\s+error)?(?:[:\s-]+|$)|^(?:error[:\s-]+)?(?:credit balance|insufficient credits?|payment required|http\s*402\b)/i;
|
|
6903
6903
|
const HTTP_STATUS_PREFIX_RE = /^(?:http\s*)?(\d{3})\s+(.+)$/i;
|
|
@@ -7040,6 +7040,25 @@ function getApiErrorPayloadFingerprint(raw) {
|
|
|
7040
7040
|
function isRawApiErrorPayload(raw) {
|
|
7041
7041
|
return getApiErrorPayloadFingerprint(raw) !== null;
|
|
7042
7042
|
}
|
|
7043
|
+
function isLikelyProviderErrorType(type) {
|
|
7044
|
+
const normalized = type?.trim().toLowerCase();
|
|
7045
|
+
if (!normalized) return false;
|
|
7046
|
+
return normalized.endsWith("_error");
|
|
7047
|
+
}
|
|
7048
|
+
const NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH = 16384;
|
|
7049
|
+
const NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE = /^codex\s*error(?:\s+\d{3})?[:\s-]+/i;
|
|
7050
|
+
function shouldRewriteRawPayloadWithoutErrorContext(raw) {
|
|
7051
|
+
if (raw.length > NON_ERROR_PROVIDER_PAYLOAD_MAX_LENGTH) return false;
|
|
7052
|
+
if (!NON_ERROR_PROVIDER_PAYLOAD_PREFIX_RE.test(raw)) return false;
|
|
7053
|
+
const info = parseApiErrorInfo(raw);
|
|
7054
|
+
if (!info) return false;
|
|
7055
|
+
if (isLikelyProviderErrorType(info.type)) return true;
|
|
7056
|
+
if (info.httpCode) {
|
|
7057
|
+
const parsedCode = Number(info.httpCode);
|
|
7058
|
+
if (Number.isFinite(parsedCode) && parsedCode >= 400) return true;
|
|
7059
|
+
}
|
|
7060
|
+
return false;
|
|
7061
|
+
}
|
|
7043
7062
|
function parseApiErrorInfo(raw) {
|
|
7044
7063
|
if (!raw) return null;
|
|
7045
7064
|
const trimmed = raw.trim();
|
|
@@ -7082,12 +7101,7 @@ function formatRawAssistantErrorForUi(raw) {
|
|
|
7082
7101
|
if (!rest.startsWith("{")) return `HTTP ${httpMatch[1]}: ${rest}`;
|
|
7083
7102
|
}
|
|
7084
7103
|
const info = parseApiErrorInfo(trimmed);
|
|
7085
|
-
if (info?.message) {
|
|
7086
|
-
const prefix = info.httpCode ? `HTTP ${info.httpCode}` : "LLM error";
|
|
7087
|
-
const type = info.type ? ` ${info.type}` : "";
|
|
7088
|
-
const requestId = info.requestId ? ` (request_id: ${info.requestId})` : "";
|
|
7089
|
-
return `${prefix}${type}: ${info.message}${requestId}`;
|
|
7090
|
-
}
|
|
7104
|
+
if (info?.message) return `${info.httpCode ? `HTTP ${info.httpCode}` : "LLM error"}${info.type ? ` ${info.type}` : ""}: ${info.message}`;
|
|
7091
7105
|
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}…` : trimmed;
|
|
7092
7106
|
}
|
|
7093
7107
|
function formatAssistantErrorText(msg, opts) {
|
|
@@ -7122,6 +7136,7 @@ function sanitizeUserFacingText(text, opts) {
|
|
|
7122
7136
|
const stripped = stripFinalTagsFromText(text);
|
|
7123
7137
|
const trimmed = stripped.trim();
|
|
7124
7138
|
if (!trimmed) return "";
|
|
7139
|
+
if (!errorContext && shouldRewriteRawPayloadWithoutErrorContext(trimmed)) return formatRawAssistantErrorForUi(trimmed);
|
|
7125
7140
|
if (errorContext) {
|
|
7126
7141
|
if (/incorrect role information|roles must alternate/i.test(trimmed)) return "Message ordering conflict - please try again. If this persists, use /new to start a fresh session.";
|
|
7127
7142
|
if (shouldRewriteContextOverflowText(trimmed)) return "Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model.";
|
|
@@ -7156,6 +7171,19 @@ const ERROR_PATTERNS = {
|
|
|
7156
7171
|
"service unavailable",
|
|
7157
7172
|
"high demand"
|
|
7158
7173
|
],
|
|
7174
|
+
serverError: [
|
|
7175
|
+
"an error occurred while processing",
|
|
7176
|
+
"internal server error",
|
|
7177
|
+
"internal_error",
|
|
7178
|
+
"server_error",
|
|
7179
|
+
"service temporarily unavailable",
|
|
7180
|
+
"service_unavailable",
|
|
7181
|
+
"bad gateway",
|
|
7182
|
+
"gateway timeout",
|
|
7183
|
+
"upstream error",
|
|
7184
|
+
"upstream connect error",
|
|
7185
|
+
"connection reset"
|
|
7186
|
+
],
|
|
7159
7187
|
timeout: [
|
|
7160
7188
|
"timeout",
|
|
7161
7189
|
"timed out",
|
|
@@ -7236,6 +7264,9 @@ function isAuthErrorMessage(raw) {
|
|
|
7236
7264
|
function isOverloadedErrorMessage(raw) {
|
|
7237
7265
|
return matchesErrorPatterns(raw, ERROR_PATTERNS.overloaded);
|
|
7238
7266
|
}
|
|
7267
|
+
function isServerErrorMessage(raw) {
|
|
7268
|
+
return matchesErrorPatterns(raw, ERROR_PATTERNS.serverError);
|
|
7269
|
+
}
|
|
7239
7270
|
function isJsonApiInternalServerError(raw) {
|
|
7240
7271
|
if (!raw) return false;
|
|
7241
7272
|
const value = raw.toLowerCase();
|
|
@@ -7297,6 +7328,7 @@ function classifyFailoverReason(raw) {
|
|
|
7297
7328
|
if (isBillingErrorMessage(raw)) return "billing";
|
|
7298
7329
|
if (isTimeoutErrorMessage(raw)) return "timeout";
|
|
7299
7330
|
if (isAuthErrorMessage(raw)) return "auth";
|
|
7331
|
+
if (isServerErrorMessage(raw)) return "timeout";
|
|
7300
7332
|
return null;
|
|
7301
7333
|
}
|
|
7302
7334
|
function isFailoverErrorMessage(raw) {
|