@symerian/symi 2.6.0 → 2.6.1
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-Bi50kp6u.js → agents-DQIz-_on.js} +4 -4
- package/dist/{agents.config-Duce7lam.js → agents.config-CIJRaVWl.js} +1 -1
- package/dist/{agents.config-BcTeP94V.js → agents.config-D8WPDf-m.js} +1 -1
- package/dist/{audio-preflight-DHTaS5U1.js → audio-preflight-BVaaZWkg.js} +4 -4
- package/dist/{audio-preflight-C40mKAp7.js → audio-preflight-CPBOQV4I.js} +4 -4
- package/dist/{auth-choice-BFIBR4l9.js → auth-choice-BqFbNDuP.js} +1 -1
- package/dist/{auth-choice-Dyq-0MNq.js → auth-choice-DTDyJL1r.js} +1 -1
- package/dist/{banner-D50f_0qf.js → banner-DYDCxnDL.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-BvBcjqyk.js → channel-options-CvHSm_Kx.js} +1 -1
- package/dist/{channel-options-BFqaanEt.js → channel-options-vBCJhJB7.js} +1 -1
- package/dist/{channel-web-BQtFg4IP.js → channel-web-CM2LyWZW.js} +1 -1
- package/dist/{channels-cli-BYFQdWnL.js → channels-cli-D5H3Wcho.js} +4 -4
- package/dist/{channels-cli-BuTH-iVi.js → channels-cli-DzOjNNFn.js} +4 -4
- package/dist/{chrome-DYZwl5Gv.js → chrome-D2SKJnR7.js} +5 -5
- package/dist/{chrome-CDJYxX5a.js → chrome-DkaXoP36.js} +5 -5
- package/dist/{cli-r2L-UK6y.js → cli-8hqssnRJ.js} +1 -1
- package/dist/{cli-eOBlVLcC.js → cli-DNZwCDRe.js} +1 -1
- package/dist/{command-registry-D-pwcAIW.js → command-registry-CHtN2HeK.js} +9 -9
- package/dist/{completion-cli-DMO2OGTm.js → completion-cli-C8y_J5KC.js} +1 -1
- package/dist/{completion-cli-DIx7KyOG.js → completion-cli-Cov6N3BO.js} +2 -2
- package/dist/{config-cli-BsDxqYDU.js → config-cli-B2REEd2l.js} +1 -1
- package/dist/{config-cli-seaVWVru.js → config-cli-BwO0xAbV.js} +1 -1
- package/dist/{configure-BmPwuHXL.js → configure-BWSYSi2-.js} +3 -3
- package/dist/{configure-CqbKA0_V.js → configure-C6yNe33U.js} +3 -3
- package/dist/{deliver-BH0l3UKW.js → deliver-C-37cZUe.js} +1 -1
- package/dist/{deliver-dODxSv3b.js → deliver-C46-vyqg.js} +1 -1
- package/dist/{doctor-completion-DMjs7-Qa.js → doctor-completion-BKKzstt6.js} +1 -1
- package/dist/{doctor-completion-C2IV3lKi.js → doctor-completion-D7CDLFLg.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{gateway-cli-C-J_s559.js → gateway-cli-BhFM4Bkm.js} +9 -9
- package/dist/{gateway-cli-BanaeKQ_.js → gateway-cli-Datohp3m.js} +9 -9
- package/dist/{glass-ui-ws-DK7x3Tz7.js → glass-ui-ws-BzqfD_wX.js} +7 -7
- package/dist/{glass-ui-ws-DUzp9m0D.js → glass-ui-ws-D9yvYULL.js} +7 -7
- package/dist/{health-DK6rAOhC.js → health-BjwDRAdd.js} +1 -1
- package/dist/{health-BpHgCv-u.js → health-C5XJPwpt.js} +1 -1
- package/dist/{hooks-cli-Cin_3tFg.js → hooks-cli-CafMq9Vr.js} +2 -2
- package/dist/{hooks-cli-D-75G_66.js → hooks-cli-U12oVyLH.js} +2 -2
- package/dist/{image-CXu8W39c.js → image-CuzFLQWC.js} +1 -1
- package/dist/{image-CHzdaNJ4.js → image-DcpMiprB.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/llm-slug-generator.js +6 -6
- package/dist/{models-CeKIXf5B.js → models-Bo4iHJy-.js} +2 -2
- package/dist/{models-cli-2NcPKR9A.js → models-cli-6aNi3eN9.js} +2 -2
- package/dist/{models-cli-DN4AVlpI.js → models-cli-B5vh-XK8.js} +3 -3
- package/dist/{onboard-BcxDiUl_.js → onboard-Bm-pmstf.js} +2 -2
- package/dist/{onboard-channels-HPxu77wp.js → onboard-channels-BRd1cXye.js} +1 -1
- package/dist/{onboard-channels-DS6s341R.js → onboard-channels-CUl5U8kV.js} +1 -1
- package/dist/{onboard-BukRqcRH.js → onboard-f-GJ26Ix.js} +2 -2
- package/dist/{onboarding-B8uz24jt.js → onboarding-CvBDWlBJ.js} +3 -3
- package/dist/{onboarding-DI-o_sax.js → onboarding-DIVKvosg.js} +3 -3
- package/dist/{onboarding.finalize-CfE_AEto.js → onboarding.finalize-DJX6mSLa.js} +6 -6
- package/dist/{onboarding.finalize-Bn2e61yb.js → onboarding.finalize-WSac-JKd.js} +5 -5
- package/dist/{pi-embedded-B5qBa69e.js → pi-embedded-BmbbC1Sb.js} +133 -27
- package/dist/{pi-embedded-helpers-lgx_U5KS.js → pi-embedded-helpers-B8kqLWns.js} +4 -4
- package/dist/{pi-embedded-helpers-pubKo8HQ.js → pi-embedded-helpers-CfqDGQ9J.js} +4 -4
- package/dist/{plugin-registry-NIUxULTk.js → plugin-registry-2zUJMasm.js} +1 -1
- package/dist/{plugin-registry-cj99EI0k.js → plugin-registry-5yf-hu_W.js} +1 -1
- package/dist/plugin-sdk/{accounts-BtaOa4z_.js → accounts-BToL3HlP.js} +1 -1
- package/dist/plugin-sdk/{accounts-Ddm33hQm.js → accounts-D9zGZU5t.js} +3 -3
- package/dist/plugin-sdk/{accounts-s-AdhXVR.js → accounts-Dtszw3Zn.js} +1 -1
- package/dist/plugin-sdk/{active-listener-BXYeALs0.js → active-listener-bEk__wbB.js} +1 -1
- package/dist/plugin-sdk/{agent-scope-CYYpcO9W.js → agent-scope-C3gMMKCU.js} +2 -2
- package/dist/plugin-sdk/agents/model-token-filter.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-tools.validate-wrapper.d.ts +23 -0
- package/dist/plugin-sdk/agents/pi-tools.validate.d.ts +26 -0
- package/dist/plugin-sdk/agents/tool-loop-detection.d.ts +3 -1
- package/dist/plugin-sdk/{api-key-rotation-D_sMvI5W.js → api-key-rotation-CVBMpnPc.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-VpItkiy3.js → audio-preflight-DoQQKlxa.js} +24 -24
- package/dist/plugin-sdk/{bindings-C7hRtgYW.js → bindings-BbwoUGPx.js} +2 -2
- package/dist/plugin-sdk/{channel-activity-DoC1xtDu.js → channel-activity-Ji7f0gqq.js} +1 -1
- package/dist/plugin-sdk/{channel-web-CSd16cDi.js → channel-web-DPyyTvFo.js} +22 -22
- package/dist/plugin-sdk/{chrome-B7RdxmJ0.js → chrome-C7c_0I5M.js} +3 -3
- package/dist/plugin-sdk/{chunk-Dw2XBYXv.js → chunk-jvk9axTQ.js} +1 -1
- package/dist/plugin-sdk/{command-format-GKSevep4.js → command-format-DSdvQ_M5.js} +1 -1
- package/dist/plugin-sdk/{commands-registry-COIaslGl.js → commands-registry-CQFbmUMs.js} +4 -4
- package/dist/plugin-sdk/config/model-profiles.d.ts +2 -0
- package/dist/plugin-sdk/{config-KlTNfkFF.js → config-DDkdiUOR.js} +9 -9
- package/dist/plugin-sdk/{deliver-BZ99UKQq.js → deliver-BZ6iNLl7.js} +10 -10
- package/dist/plugin-sdk/{diagnostic-05pm5Rxi.js → diagnostic-mFf4i4G9.js} +1 -1
- package/dist/plugin-sdk/{image-CLOPx7yW.js → image-BOYy0Ump.js} +4 -4
- package/dist/plugin-sdk/{image-ops-BlQR__MN.js → image-ops-Bnp6LXEx.js} +1 -1
- package/dist/plugin-sdk/index.js +53 -53
- package/dist/plugin-sdk/infra/diagnostic-events.d.ts +1 -1
- package/dist/plugin-sdk/{ir-BJ6BHE5b.js → ir-Fb3qpcis.js} +4 -4
- package/dist/plugin-sdk/{local-roots-BHLNSI8U.js → local-roots-Ckk1QfzI.js} +3 -3
- package/dist/plugin-sdk/logging/diagnostic-session-state.d.ts +2 -0
- package/dist/plugin-sdk/logging/diagnostic.d.ts +1 -1
- package/dist/plugin-sdk/{login-DQMXuxOk.js → login-Bh3DZPam.js} +7 -7
- package/dist/plugin-sdk/{login-qr-BjVZSoCi.js → login-qr-DbR7odSr.js} +9 -9
- package/dist/plugin-sdk/{manager-CBSBFuFz.js → manager-DckktAQ3.js} +8 -8
- package/dist/plugin-sdk/{manifest-registry-CPnHl_K3.js → manifest-registry-B3ugY9-f.js} +1 -1
- package/dist/plugin-sdk/{markdown-tables-BoYFajMu.js → markdown-tables-Dfaqilz6.js} +1 -1
- package/dist/plugin-sdk/{message-channel-COTAJzHd.js → message-channel-BdI5Ra9S.js} +1 -1
- package/dist/plugin-sdk/{model-selection-CsbEfrS0.js → model-selection-OpU8HN50.js} +4 -4
- package/dist/plugin-sdk/{outbound-attachment-CnslKL38.js → outbound-attachment-DnVQfTG2.js} +2 -2
- package/dist/plugin-sdk/{outbound-B0e8KdaR.js → outbound-rF6G8Xpr.js} +7 -7
- package/dist/plugin-sdk/{pi-auth-json-qWi7ZIYV.js → pi-auth-json-CJk8t14T.js} +5 -5
- package/dist/plugin-sdk/{pi-embedded-helpers-CW630epe.js → pi-embedded-helpers-BveUP4hk.js} +17 -17
- package/dist/plugin-sdk/{plugins-BNByVCIH.js → plugins-BbAvhC25.js} +4 -4
- package/dist/plugin-sdk/{pw-ai-CnbPIPY9.js → pw-ai-DjGUsee-.js} +8 -8
- package/dist/plugin-sdk/{qmd-manager-CH0XbIHf.js → qmd-manager-mjKcdwVr.js} +4 -4
- package/dist/plugin-sdk/{registry-D0xTnUWt.js → registry--_pGht6S.js} +2 -2
- package/dist/plugin-sdk/{replies-LLcQL3w6.js → replies-fI39rPGa.js} +3 -3
- package/dist/plugin-sdk/{reply-CkqSfQZN.js → reply-QAcAd9ev.js} +193 -87
- package/dist/plugin-sdk/{reply-prefix-uxfMZW4p.js → reply-prefix-BHuV5t70.js} +1 -1
- package/dist/plugin-sdk/{resolve-outbound-target-BiyAyTWz.js → resolve-outbound-target-BkCUbYGV.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-B3CCBumQ.js → resolve-route-D3JH_D2N.js} +3 -3
- package/dist/plugin-sdk/{retry-CwQ_iIj8.js → retry-ilSJqnz9.js} +1 -1
- package/dist/plugin-sdk/{runner-CGBT7tgF.js → runner-BVqnEfNe.js} +9 -9
- package/dist/plugin-sdk/{send-C5h_YxNb.js → send-BHbXh8Ly.js} +7 -7
- package/dist/plugin-sdk/{send-pYqe432l.js → send-BMfJIhCk.js} +6 -6
- package/dist/plugin-sdk/{send-B2CEnVLL.js → send-BtANzsAo.js} +6 -6
- package/dist/plugin-sdk/{send-CjOBB3Vo.js → send-Bxdu6ZZy.js} +10 -10
- package/dist/plugin-sdk/{send-CRsR8-vO.js → send-D6LMZJ_h.js} +10 -10
- package/dist/plugin-sdk/{session-BsOrxiMj.js → session-kI0tzViQ.js} +4 -4
- package/dist/plugin-sdk/{skill-commands-ff_01_r3.js → skill-commands-DCNXVERE.js} +5 -5
- package/dist/plugin-sdk/{skills-_yTP47Cd.js → skills-B1GeRYlu.js} +7 -7
- package/dist/plugin-sdk/{sqlite-CxAR5ttJ.js → sqlite-Cq_7Cg4E.js} +1 -1
- package/dist/plugin-sdk/{store-BdrNabcU.js → store-Do3t33-c.js} +2 -2
- package/dist/plugin-sdk/{subsystem-B2uDN3TV.js → subsystem-Coz2AgU8.js} +1 -1
- package/dist/plugin-sdk/{tables-DNwXwNFa.js → tables-DR0NmBeH.js} +1 -1
- package/dist/plugin-sdk/{target-errors-Paro1BjP.js → target-errors-B7YyMnIi.js} +2 -2
- package/dist/plugin-sdk/{thinking-CXqf7WTe.js → thinking-DCNUIAHY.js} +5 -5
- package/dist/plugin-sdk/{tokens-bC3UVmVH.js → tokens-CWMflosr.js} +1 -1
- package/dist/plugin-sdk/{tool-images-HJ2sfZDV.js → tool-images-D7Lno-TE.js} +2 -2
- package/dist/plugin-sdk/{tool-loop-detection-BVA6fax-.js → tool-loop-detection-DU5sTIKg.js} +55 -5
- package/dist/plugin-sdk/web-DaTTL9M0.js +65 -0
- package/dist/plugin-sdk/{whatsapp-actions-DfseosPO.js → whatsapp-actions-CcBzDuL-.js} +21 -21
- package/dist/{plugins-cli-CcjxxESJ.js → plugins-cli-D4eRESV2.js} +2 -2
- package/dist/{plugins-cli-D8hhTHZD.js → plugins-cli-DksVl33N.js} +2 -2
- package/dist/{program-D09h71pS.js → program-BjORH7Cc.js} +7 -7
- package/dist/{program-context-CLJSWBZr.js → program-context-DaNGrTOm.js} +17 -17
- package/dist/{prompt-select-styled-zRUqu0c8.js → prompt-select-styled-QaS2zul_.js} +4 -4
- package/dist/{prompt-select-styled-DQqZEGoo.js → prompt-select-styled-YOj4xigd.js} +4 -4
- package/dist/{provider-auth-helpers-16r2WHNe.js → provider-auth-helpers-BAGT_RXV.js} +1 -1
- package/dist/{provider-auth-helpers-LzJ2WQIc.js → provider-auth-helpers-DCEbm2hz.js} +1 -1
- package/dist/{push-apns-B5xZKIxK.js → push-apns-BECodU1i.js} +1 -1
- package/dist/{push-apns-DJddAK3u.js → push-apns-Bek3ANJa.js} +1 -1
- package/dist/{pw-ai-De-KR9_s.js → pw-ai-1htA-NnS.js} +1 -1
- package/dist/{pw-ai-B5asscAD.js → pw-ai-m0mj2KWK.js} +1 -1
- package/dist/{register.agent-D7NKuUkY.js → register.agent-B34lxx7F.js} +5 -5
- package/dist/{register.agent-CP_sigRh.js → register.agent-DJHQo-Iq.js} +6 -6
- package/dist/{register.configure-BEsGd0PR.js → register.configure-BdhhIzb0.js} +6 -6
- package/dist/{register.configure-BjRLNatb.js → register.configure-DC_-t5kj.js} +6 -6
- package/dist/{register.maintenance-DD6TNFtV.js → register.maintenance-CITur3O_.js} +8 -8
- package/dist/{register.maintenance-CN6KUuX7.js → register.maintenance-cs-A4kHF.js} +7 -7
- package/dist/{register.message-DEUcNly1.js → register.message--RhtnEYn.js} +2 -2
- package/dist/{register.message-DMVC_Sqm.js → register.message-PIaHm2pZ.js} +2 -2
- package/dist/{register.onboard-CP6RP90V.js → register.onboard-CTJQoDcK.js} +4 -4
- package/dist/{register.onboard-J1pgV7lz.js → register.onboard-DucZgrF7.js} +4 -4
- package/dist/{register.setup-Dhc3jKpK.js → register.setup-2ZiUN7ui.js} +4 -4
- package/dist/{register.setup-BeHpW3xI.js → register.setup-DD4Rgkt9.js} +4 -4
- package/dist/{register.status-health-sessions-b-lWNsTM.js → register.status-health-sessions-BqD7L8XL.js} +3 -3
- package/dist/{register.status-health-sessions-DDkC0aoW.js → register.status-health-sessions-sLgA92t7.js} +3 -3
- package/dist/{register.subclis-BJqiT8Q2.js → register.subclis-B2dGWFur.js} +9 -9
- package/dist/{reply-D40cmAci.js → reply-DYnTEYoa.js} +119 -13
- package/dist/{run-main-BruREeZ6.js → run-main-DWmu2b6D.js} +14 -14
- package/dist/{runner-DUBExAb5.js → runner-BcQ0sF9T.js} +1 -1
- package/dist/{runner-WAG0M5s9.js → runner-CU9l0uJh.js} +1 -1
- package/dist/{server-methods-K-0MHs8x.js → server-methods-C8EWZt2g.js} +7 -7
- package/dist/{server-methods-Cyw_WS3A.js → server-methods-vDGoM3xL.js} +7 -7
- package/dist/{server-node-events-89R9Ryky.js → server-node-events-CKi12bol.js} +2 -2
- package/dist/{server-node-events-RA8RurtC.js → server-node-events-DFwGbkcO.js} +2 -2
- package/dist/{status-DHJLMwQN.js → status--iNVOTMO.js} +2 -2
- package/dist/{status-CtNKWuzg.js → status-B1_iHrOg.js} +2 -2
- package/dist/{status-BSMEjz4q.js → status-BQcdARV4.js} +1 -1
- package/dist/{status-Kv_hsY8N.js → status-DiX0DAtH.js} +1 -1
- package/dist/{subagent-registry-Cb5e_x99.js → subagent-registry-CXrOOgPW.js} +119 -13
- package/dist/{tool-loop-detection-BgbtzUGc.js → tool-loop-detection-C7TCF2V2.js} +53 -3
- package/dist/{tool-loop-detection-BU3fbtCd.js → tool-loop-detection-D7qjFnRh.js} +53 -3
- package/dist/{tool-loop-detection-B6j1r-Wk.js → tool-loop-detection-DPVtQOfM.js} +53 -3
- package/dist/{tool-loop-detection-D0kUzUGu.js → tool-loop-detection-DR_rrIA1.js} +53 -3
- package/dist/{unified-runner-CkJLTsTK.js → unified-runner-CulJZMxc.js} +133 -27
- package/dist/{update-cli-Bl66LJZ4.js → update-cli-560gprSp.js} +7 -7
- package/dist/{update-cli-CrRBoiVU.js → update-cli-D1pLX3eo.js} +8 -8
- package/dist/{update-runner-DxpSPK-f.js → update-runner-BQxFFCGc.js} +1 -1
- package/dist/{update-runner-FgrqoxvV.js → update-runner-CLKHrONW.js} +1 -1
- package/dist/{web-Czp0JS6-.js → web-Bqrgp43v.js} +1 -1
- package/dist/{web-D99WHLTL.js → web-D4qJ9XKP.js} +6 -6
- package/dist/{web-BYRKX5Ln.js → web-Dr5cOn-1.js} +2 -2
- package/dist/{web-RePh7lRy.js → web-hHX9a9YO.js} +6 -6
- package/package.json +1 -1
- package/dist/plugin-sdk/web-DdTTil50.js +0 -65
|
@@ -9,6 +9,8 @@ const TOOL_CALL_HISTORY_SIZE = 30;
|
|
|
9
9
|
const WARNING_THRESHOLD = 10;
|
|
10
10
|
const CRITICAL_THRESHOLD = 20;
|
|
11
11
|
const GLOBAL_CIRCUIT_BREAKER_THRESHOLD = 30;
|
|
12
|
+
const CONSECUTIVE_FAILURE_WARNING_THRESHOLD = 3;
|
|
13
|
+
const CONSECUTIVE_FAILURE_CRITICAL_THRESHOLD = 5;
|
|
12
14
|
const DEFAULT_LOOP_DETECTION_CONFIG = {
|
|
13
15
|
enabled: false,
|
|
14
16
|
historySize: TOOL_CALL_HISTORY_SIZE,
|
|
@@ -18,8 +20,11 @@ const DEFAULT_LOOP_DETECTION_CONFIG = {
|
|
|
18
20
|
detectors: {
|
|
19
21
|
genericRepeat: true,
|
|
20
22
|
knownPollNoProgress: true,
|
|
21
|
-
pingPong: true
|
|
22
|
-
|
|
23
|
+
pingPong: true,
|
|
24
|
+
consecutiveFailure: true
|
|
25
|
+
},
|
|
26
|
+
consecutiveFailureWarningThreshold: CONSECUTIVE_FAILURE_WARNING_THRESHOLD,
|
|
27
|
+
consecutiveFailureCriticalThreshold: CONSECUTIVE_FAILURE_CRITICAL_THRESHOLD
|
|
23
28
|
};
|
|
24
29
|
function asPositiveInt(value, fallback) {
|
|
25
30
|
if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) return fallback;
|
|
@@ -37,10 +42,13 @@ function resolveLoopDetectionConfig(config) {
|
|
|
37
42
|
warningThreshold,
|
|
38
43
|
criticalThreshold,
|
|
39
44
|
globalCircuitBreakerThreshold,
|
|
45
|
+
consecutiveFailureWarningThreshold: asPositiveInt(config?.consecutiveFailureWarningThreshold, DEFAULT_LOOP_DETECTION_CONFIG.consecutiveFailureWarningThreshold),
|
|
46
|
+
consecutiveFailureCriticalThreshold: asPositiveInt(config?.consecutiveFailureCriticalThreshold, DEFAULT_LOOP_DETECTION_CONFIG.consecutiveFailureCriticalThreshold),
|
|
40
47
|
detectors: {
|
|
41
48
|
genericRepeat: config?.detectors?.genericRepeat ?? DEFAULT_LOOP_DETECTION_CONFIG.detectors.genericRepeat,
|
|
42
49
|
knownPollNoProgress: config?.detectors?.knownPollNoProgress ?? DEFAULT_LOOP_DETECTION_CONFIG.detectors.knownPollNoProgress,
|
|
43
|
-
pingPong: config?.detectors?.pingPong ?? DEFAULT_LOOP_DETECTION_CONFIG.detectors.pingPong
|
|
50
|
+
pingPong: config?.detectors?.pingPong ?? DEFAULT_LOOP_DETECTION_CONFIG.detectors.pingPong,
|
|
51
|
+
consecutiveFailure: (config?.detectors)?.consecutiveFailure ?? DEFAULT_LOOP_DETECTION_CONFIG.detectors.consecutiveFailure
|
|
44
52
|
}
|
|
45
53
|
};
|
|
46
54
|
}
|
|
@@ -218,6 +226,22 @@ function canonicalPairKey(signatureA, signatureB) {
|
|
|
218
226
|
return [signatureA, signatureB].toSorted().join("|");
|
|
219
227
|
}
|
|
220
228
|
/**
|
|
229
|
+
* Count consecutive error results for a specific tool, walking backward from
|
|
230
|
+
* the most recent call. A success or a call to a different tool resets the streak.
|
|
231
|
+
* Only counts entries that have been resolved (have a resultHash or isError flag).
|
|
232
|
+
*/
|
|
233
|
+
function getConsecutiveFailureStreak(history, toolName) {
|
|
234
|
+
let count = 0;
|
|
235
|
+
for (let i = history.length - 1; i >= 0; i--) {
|
|
236
|
+
const entry = history[i];
|
|
237
|
+
if (entry.toolName !== toolName) break;
|
|
238
|
+
if (entry.resultHash === void 0 && entry.isError === void 0) break;
|
|
239
|
+
if (!entry.isError) break;
|
|
240
|
+
count++;
|
|
241
|
+
}
|
|
242
|
+
return count;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
221
245
|
* Detect if an agent is stuck in a repetitive tool call loop.
|
|
222
246
|
* Checks if the same tool+params combination has been called excessively.
|
|
223
247
|
*/
|
|
@@ -230,6 +254,31 @@ function detectToolCallLoop(state, toolName, params, config) {
|
|
|
230
254
|
const noProgressStreak = noProgress.count;
|
|
231
255
|
const knownPollTool = isKnownPollToolCall(toolName, params);
|
|
232
256
|
const pingPong = getPingPongStreak(history, currentHash);
|
|
257
|
+
if (resolvedConfig.detectors.consecutiveFailure) {
|
|
258
|
+
const failureStreak = getConsecutiveFailureStreak(history, toolName);
|
|
259
|
+
if (failureStreak >= resolvedConfig.consecutiveFailureCriticalThreshold) {
|
|
260
|
+
log.error(`Consecutive failure circuit breaker: ${toolName} failed ${failureStreak} times in a row`);
|
|
261
|
+
return {
|
|
262
|
+
stuck: true,
|
|
263
|
+
level: "critical",
|
|
264
|
+
detector: "consecutive_failure",
|
|
265
|
+
count: failureStreak,
|
|
266
|
+
message: `CRITICAL: ${toolName} has failed ${failureStreak} consecutive times. Stop calling this tool. Explain to the user what you were trying to do and why it failed.`,
|
|
267
|
+
warningKey: `consecutive-failure:${toolName}`
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
if (failureStreak >= resolvedConfig.consecutiveFailureWarningThreshold) {
|
|
271
|
+
log.warn(`Consecutive failure warning: ${toolName} failed ${failureStreak} times in a row`);
|
|
272
|
+
return {
|
|
273
|
+
stuck: true,
|
|
274
|
+
level: "warning",
|
|
275
|
+
detector: "consecutive_failure",
|
|
276
|
+
count: failureStreak,
|
|
277
|
+
message: `WARNING: You have failed to call ${toolName} ${failureStreak} times consecutively. Stop retrying and explain to the user what you were trying to do. The tool arguments may contain invalid syntax from model control tokens.`,
|
|
278
|
+
warningKey: `consecutive-failure:${toolName}`
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
233
282
|
if (noProgressStreak >= resolvedConfig.globalCircuitBreakerThreshold) {
|
|
234
283
|
log.error(`Global circuit breaker triggered: ${toolName} repeated ${noProgressStreak} times with no progress`);
|
|
235
284
|
return {
|
|
@@ -334,6 +383,7 @@ function recordToolCallOutcome(state, params) {
|
|
|
334
383
|
if (call.toolName !== params.toolName || call.argsHash !== argsHash) continue;
|
|
335
384
|
if (call.resultHash !== void 0) continue;
|
|
336
385
|
call.resultHash = resultHash;
|
|
386
|
+
call.isError = params.error !== void 0;
|
|
337
387
|
matched = true;
|
|
338
388
|
break;
|
|
339
389
|
}
|
|
@@ -10,10 +10,10 @@ import { $ as resolveSymiAgentDir, B as resolveApiKeyForProvider, C as normalize
|
|
|
10
10
|
import { n as formatCliCommand, r as resolveCliName, t as isTruthyEnvValue } from "./env-BDXYbTKj.js";
|
|
11
11
|
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-cCYzSU9h.js";
|
|
12
12
|
import { t as parseBooleanValue$1 } from "./boolean-CE7i9tBR.js";
|
|
13
|
-
import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-
|
|
13
|
+
import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-CfqDGQ9J.js";
|
|
14
14
|
import { A as VERSION, C as getConfigValueAtPath, D as isSafeExecutableValue, E as unsetConfigValueAtPath, O as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, S as unsetConfigOverride, T as setConfigValueAtPath, _ as parseDurationMs, a as writeConfigFile, b as resetConfigOverrides, c as TELEGRAM_COMMAND_NAME_PATTERN, f as isInboundPathAllowed, g as normalizeScpRemoteHost, h as resolveIMessageRemoteAttachmentRoots, i as resolveConfigSnapshotHash, k as resolveAgentMaxConcurrent, l as normalizeTelegramCommandName, m as resolveIMessageAttachmentRoots, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as resolveTelegramCustomCommands, v as validateJsonSchemaValue, w as parseConfigPath, x as setConfigOverride, y as getConfigOverrides } from "./config-5SdHIcHU.js";
|
|
15
15
|
import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-yb7sAlu4.js";
|
|
16
|
-
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
16
|
+
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-DkaXoP36.js";
|
|
17
17
|
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-Bs0AW1g3.js";
|
|
18
18
|
import { n as formatErrorMessage, r as formatUncaughtError } from "./errors-XIsvXeC-.js";
|
|
19
19
|
import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-C7CauEK8.js";
|
|
@@ -31,10 +31,10 @@ import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i
|
|
|
31
31
|
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-CvhXrdgS.js";
|
|
32
32
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-BBh3Gsrx.js";
|
|
33
33
|
import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-SqqWIT22.js";
|
|
34
|
-
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-
|
|
34
|
+
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-C46-vyqg.js";
|
|
35
35
|
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-rPhsBoZz.js";
|
|
36
36
|
import { r as getDiagnosticSessionState } from "./diagnostic-session-state-Zw87xFym.js";
|
|
37
|
-
import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-
|
|
37
|
+
import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-CuzFLQWC.js";
|
|
38
38
|
import { a as isSilentReplyText, i as isSilentReplyPrefixText, n as SILENT_REPLY_TOKEN, r as SYMIPULSE_TOKEN, t as HEARTBEAT_TOKEN } from "./tokens-Bux9Y_xD.js";
|
|
39
39
|
import { $ as isVoiceCompatibleAudio, A as extractTelegramLocation, B as normalizeAllowFromWithStore$1, C as buildTelegramGroupFrom, D as buildTypingThreadParams, E as buildTelegramThreadParams, F as resolveTelegramMediaPlaceholder, G as formatLocationText, H as firstDefined$1, I as resolveTelegramReplyId, J as readChannelAllowFromStore, K as toLocationContext, L as resolveTelegramStreamMode, M as normalizeForwardedContext, N as resolveTelegramForumThreadId, O as describeReplyTarget, P as resolveTelegramGroupAllowFromContext, Q as listPairingChannels, R as resolveTelegramThreadSpec, S as buildSenderName, T as buildTelegramParentPeer, U as isSenderIdAllowed, V as resolveSenderAllowMatch, W as mergeAllowFromSources, X as upsertChannelPairingRequest, Y as removeChannelAllowFromStoreEntry, Z as getPairingAdapter, _ as resolveTelegramFetch, a as reactMessageTelegram, b as buildGroupLabel, c as sendStickerTelegram, d as wasSentByBot, et as parseTelegramTarget, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, j as hasBotMention, k as expandTextLinks, m as markdownToTelegramHtml, n as createForumTopicTelegram, o as sendMessageTelegram, p as markdownToTelegramChunks, q as addChannelAllowFromStoreEntry, r as deleteMessageTelegram, s as sendPollTelegram, t as buildInlineKeyboard, tt as resolveTelegramTargetChatType, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramGroupPeerId, x as buildSenderLabel, y as withTelegramApiErrorLogging, z as isSenderAllowed$1 } from "./send-DYj_o4_F.js";
|
|
40
40
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-Bv5YDJc8.js";
|
|
@@ -49,7 +49,7 @@ import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-DL3f
|
|
|
49
49
|
import { a as readResponseWithLimit, i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, t as getAgentScopedMediaLocalRoots } from "./local-roots-DhZz0Ybs.js";
|
|
50
50
|
import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-CTiz95Vb.js";
|
|
51
51
|
import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-Bfc7Uz0o.js";
|
|
52
|
-
import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as registerUnhandledRejectionHandler } from "./runner-
|
|
52
|
+
import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as registerUnhandledRejectionHandler } from "./runner-CU9l0uJh.js";
|
|
53
53
|
import { c as getSkillsSnapshotVersion, d as createAsyncLock, f as readJsonFile, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as writeJsonAtomic, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-DcVwOafC.js";
|
|
54
54
|
import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-DSDTl6Kj.js";
|
|
55
55
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-Bso4i15F.js";
|
|
@@ -80,7 +80,7 @@ import AjvPkg from "ajv";
|
|
|
80
80
|
import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
|
|
81
81
|
import { createServer } from "node:http";
|
|
82
82
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
83
|
-
import WebSocket, { WebSocket
|
|
83
|
+
import WebSocket$1, { WebSocket } from "ws";
|
|
84
84
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
85
85
|
import { EdgeTTS } from "node-edge-tts";
|
|
86
86
|
import { createJiti } from "jiti";
|
|
@@ -134,7 +134,8 @@ const BUILTIN_PROFILES = [
|
|
|
134
134
|
"<end_of_turn>"
|
|
135
135
|
],
|
|
136
136
|
suppressMonologue: true,
|
|
137
|
-
hasStructuredThinking: false
|
|
137
|
+
hasStructuredThinking: false,
|
|
138
|
+
validateToolArgs: true
|
|
138
139
|
},
|
|
139
140
|
promptAdditions: [
|
|
140
141
|
"CRITICAL OUTPUT RULES:",
|
|
@@ -144,7 +145,8 @@ const BUILTIN_PROFILES = [
|
|
|
144
145
|
"- Do not write verification checklists, self-assessments, or numbered assessment lists after your answer.",
|
|
145
146
|
"- Do not write 'Verification:', 'Requirements:', 'Status Check:', or 'Everything is correct'.",
|
|
146
147
|
"- If you need to verify your work, do so before writing your response, not after.",
|
|
147
|
-
"- Send brief progress updates on long tasks so the user knows you are active."
|
|
148
|
+
"- Send brief progress updates on long tasks so the user knows you are active.",
|
|
149
|
+
"- When calling tools, provide arguments as clean values only. Never include <|, |>, or XML-like tags in tool argument values. For exec/bash commands, provide only valid shell syntax."
|
|
148
150
|
],
|
|
149
151
|
ui: {
|
|
150
152
|
badge: "Local",
|
|
@@ -168,7 +170,8 @@ const BUILTIN_PROFILES = [
|
|
|
168
170
|
filters: {
|
|
169
171
|
stripPatterns: [],
|
|
170
172
|
suppressMonologue: false,
|
|
171
|
-
hasStructuredThinking: true
|
|
173
|
+
hasStructuredThinking: true,
|
|
174
|
+
validateToolArgs: false
|
|
172
175
|
},
|
|
173
176
|
promptAdditions: [],
|
|
174
177
|
ui: {
|
|
@@ -202,7 +205,8 @@ const BUILTIN_PROFILES = [
|
|
|
202
205
|
"^\\s*<bos>\\s*"
|
|
203
206
|
],
|
|
204
207
|
suppressMonologue: true,
|
|
205
|
-
hasStructuredThinking: false
|
|
208
|
+
hasStructuredThinking: false,
|
|
209
|
+
validateToolArgs: true
|
|
206
210
|
},
|
|
207
211
|
promptAdditions: [
|
|
208
212
|
"CRITICAL OUTPUT RULES:",
|
|
@@ -213,7 +217,8 @@ const BUILTIN_PROFILES = [
|
|
|
213
217
|
"- Do not write 'Verification:', 'Requirements:', 'Status Check:', or 'Everything is correct'.",
|
|
214
218
|
"- If you need to verify your work, do so before writing your response, not after.",
|
|
215
219
|
"- Keep planning and reasoning internal. Only speak when you have a result or need user input.",
|
|
216
|
-
"- When working on multi-step tasks, send a brief one-line status update so the user knows you are active."
|
|
220
|
+
"- When working on multi-step tasks, send a brief one-line status update so the user knows you are active.",
|
|
221
|
+
"- When calling tools, provide arguments as clean values only. Never include <|, |>, or XML-like tags in tool argument values. For exec/bash commands, provide only valid shell syntax."
|
|
217
222
|
],
|
|
218
223
|
ui: {
|
|
219
224
|
badge: "CoreWeave",
|
|
@@ -241,7 +246,8 @@ const FALLBACK_PROFILE = {
|
|
|
241
246
|
filters: {
|
|
242
247
|
stripPatterns: [],
|
|
243
248
|
suppressMonologue: false,
|
|
244
|
-
hasStructuredThinking: false
|
|
249
|
+
hasStructuredThinking: false,
|
|
250
|
+
validateToolArgs: false
|
|
245
251
|
},
|
|
246
252
|
promptAdditions: [],
|
|
247
253
|
ui: {
|
|
@@ -6780,7 +6786,7 @@ async function recordLoopOutcome(args) {
|
|
|
6780
6786
|
if (!args.ctx?.sessionKey) return;
|
|
6781
6787
|
try {
|
|
6782
6788
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Zw87xFym.js").then((n) => n.n);
|
|
6783
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
6789
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-DR_rrIA1.js");
|
|
6784
6790
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
6785
6791
|
sessionKey: args.ctx.sessionKey,
|
|
6786
6792
|
sessionId: args.ctx?.agentId
|
|
@@ -6802,7 +6808,7 @@ async function runBeforeToolCallHook(args) {
|
|
|
6802
6808
|
if (args.ctx?.sessionKey) {
|
|
6803
6809
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Zw87xFym.js").then((n) => n.n);
|
|
6804
6810
|
const { logToolLoopAction } = await import("./diagnostic-rPhsBoZz.js").then((n) => n.n);
|
|
6805
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
6811
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-DR_rrIA1.js");
|
|
6806
6812
|
const sessionState = getDiagnosticSessionState({
|
|
6807
6813
|
sessionKey: args.ctx.sessionKey,
|
|
6808
6814
|
sessionId: args.ctx?.agentId
|
|
@@ -8630,7 +8636,7 @@ var GatewayClient = class {
|
|
|
8630
8636
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
8631
8637
|
});
|
|
8632
8638
|
}
|
|
8633
|
-
this.ws = new WebSocket
|
|
8639
|
+
this.ws = new WebSocket(url, wsOptions);
|
|
8634
8640
|
this.ws.on("open", () => {
|
|
8635
8641
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
8636
8642
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -8849,7 +8855,7 @@ var GatewayClient = class {
|
|
|
8849
8855
|
return null;
|
|
8850
8856
|
}
|
|
8851
8857
|
async request(method, params, opts) {
|
|
8852
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
8858
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
8853
8859
|
const id = randomUUID();
|
|
8854
8860
|
const frame = {
|
|
8855
8861
|
type: "req",
|
|
@@ -10115,7 +10121,7 @@ async function routeReply(params) {
|
|
|
10115
10121
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
10116
10122
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
10117
10123
|
try {
|
|
10118
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
10124
|
+
const { deliverOutboundPayloads } = await import("./deliver-C46-vyqg.js").then((n) => n.n);
|
|
10119
10125
|
return {
|
|
10120
10126
|
ok: true,
|
|
10121
10127
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -43554,7 +43560,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
43554
43560
|
return;
|
|
43555
43561
|
}
|
|
43556
43562
|
try {
|
|
43557
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
43563
|
+
const { deliverOutboundPayloads } = await import("./deliver-C46-vyqg.js").then((n) => n.n);
|
|
43558
43564
|
await deliverOutboundPayloads({
|
|
43559
43565
|
cfg: params.cfg,
|
|
43560
43566
|
channel,
|
|
@@ -47000,7 +47006,7 @@ async function describeStickerImage(params) {
|
|
|
47000
47006
|
logVerbose(`telegram: describing sticker with ${provider}/${model}`);
|
|
47001
47007
|
try {
|
|
47002
47008
|
const buffer = await fs$1.readFile(imagePath);
|
|
47003
|
-
const { describeImageWithModel } = await import("./image-
|
|
47009
|
+
const { describeImageWithModel } = await import("./image-CuzFLQWC.js").then((n) => n.n);
|
|
47004
47010
|
return (await describeImageWithModel({
|
|
47005
47011
|
buffer,
|
|
47006
47012
|
fileName: "sticker.webp",
|
|
@@ -49662,7 +49668,7 @@ async function preflightDiscordMessage(params) {
|
|
|
49662
49668
|
let preflightTranscript;
|
|
49663
49669
|
const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
|
|
49664
49670
|
if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
|
|
49665
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
49671
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-BVaaZWkg.js");
|
|
49666
49672
|
const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
|
|
49667
49673
|
if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
|
|
49668
49674
|
ctx: {
|
|
@@ -53668,7 +53674,7 @@ function isVoiceChannelType(type) {
|
|
|
53668
53674
|
function createDefaultDeps() {
|
|
53669
53675
|
return {
|
|
53670
53676
|
sendMessageWhatsApp: async (...args) => {
|
|
53671
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
53677
|
+
const { sendMessageWhatsApp } = await import("./web-hHX9a9YO.js");
|
|
53672
53678
|
return await sendMessageWhatsApp(...args);
|
|
53673
53679
|
},
|
|
53674
53680
|
sendMessageTelegram: async (...args) => {
|
|
@@ -56573,7 +56579,7 @@ function createDiscordGatewayPlugin(params) {
|
|
|
56573
56579
|
super(options);
|
|
56574
56580
|
}
|
|
56575
56581
|
createWebSocket(url) {
|
|
56576
|
-
return new WebSocket(url, { agent });
|
|
56582
|
+
return new WebSocket$1(url, { agent });
|
|
56577
56583
|
}
|
|
56578
56584
|
}
|
|
56579
56585
|
return new ProxyGatewayPlugin();
|
|
@@ -66791,7 +66797,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, storeAllowFro
|
|
|
66791
66797
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
66792
66798
|
let preflightTranscript;
|
|
66793
66799
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
66794
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
66800
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-BVaaZWkg.js");
|
|
66795
66801
|
preflightTranscript = await transcribeFirstAudio({
|
|
66796
66802
|
ctx: {
|
|
66797
66803
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -68948,7 +68954,7 @@ function loadWebLoginQr() {
|
|
|
68948
68954
|
return webLoginQrPromise;
|
|
68949
68955
|
}
|
|
68950
68956
|
function loadWebChannel() {
|
|
68951
|
-
webChannelPromise ??= import("./web-
|
|
68957
|
+
webChannelPromise ??= import("./web-hHX9a9YO.js");
|
|
68952
68958
|
return webChannelPromise;
|
|
68953
68959
|
}
|
|
68954
68960
|
function loadWhatsAppActions() {
|
|
@@ -73318,6 +73324,19 @@ function stripModelTokensAggressive(text, modelId) {
|
|
|
73318
73324
|
}
|
|
73319
73325
|
return result;
|
|
73320
73326
|
}
|
|
73327
|
+
/**
|
|
73328
|
+
* Clean residual fragments left after aggressive token stripping.
|
|
73329
|
+
* After `<|` and `|>` are removed, orphaned `<`, `"`, `|` can remain
|
|
73330
|
+
* at string boundaries (e.g., `<<|"|uname -a` → `<"uname -a`).
|
|
73331
|
+
*
|
|
73332
|
+
* Conservative: only trims leading junk before what looks like a command,
|
|
73333
|
+
* and trailing junk. Does NOT touch content in the middle of the string.
|
|
73334
|
+
* Preserves heredoc syntax (`<<EOF`, `<<"EOF"`) via negative lookahead.
|
|
73335
|
+
*/
|
|
73336
|
+
function cleanResidualTokenFragments(text) {
|
|
73337
|
+
if (!text) return text;
|
|
73338
|
+
return text.replace(/^[<"|]+(?!<[A-Z_])(?=[a-zA-Z0-9/~$.(])/gm, "").replace(/[<"|]+$/gm, "").trim();
|
|
73339
|
+
}
|
|
73321
73340
|
|
|
73322
73341
|
//#endregion
|
|
73323
73342
|
//#region src/agents/output-normalizer.ts
|
|
@@ -73403,10 +73422,14 @@ function detectRepetition(text, minBlock) {
|
|
|
73403
73422
|
const searchStart = sampleStart + minBlock;
|
|
73404
73423
|
return text.indexOf(sample, searchStart) >= 0;
|
|
73405
73424
|
}
|
|
73425
|
+
function sanitizeStringValue(value, modelId) {
|
|
73426
|
+
const stripped = stripModelTokensAggressive(value, modelId);
|
|
73427
|
+
return isGemmaModel(modelId) ? cleanResidualTokenFragments(stripped) : stripped;
|
|
73428
|
+
}
|
|
73406
73429
|
function sanitizeArgs(args, modelId) {
|
|
73407
73430
|
const result = {};
|
|
73408
|
-
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] =
|
|
73409
|
-
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ?
|
|
73431
|
+
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] = sanitizeStringValue(value, modelId);
|
|
73432
|
+
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ? sanitizeStringValue(item, modelId) : item && typeof item === "object" ? sanitizeArgs(item, modelId) : item);
|
|
73410
73433
|
else if (value && typeof value === "object") result[key] = sanitizeArgs(value, modelId);
|
|
73411
73434
|
else result[key] = value;
|
|
73412
73435
|
return result;
|
|
@@ -75454,6 +75477,88 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
75454
75477
|
};
|
|
75455
75478
|
}
|
|
75456
75479
|
|
|
75480
|
+
//#endregion
|
|
75481
|
+
//#region src/agents/pi-tools.validate.ts
|
|
75482
|
+
/**
|
|
75483
|
+
* Tool argument validation — validates that exec/bash commands contain
|
|
75484
|
+
* valid shell syntax after model token sanitization.
|
|
75485
|
+
*
|
|
75486
|
+
* Gated on ModelProfile.filters.validateToolArgs — only active for
|
|
75487
|
+
* models known to leak control tokens into structured output (Gemma, Ollama).
|
|
75488
|
+
*
|
|
75489
|
+
* @module
|
|
75490
|
+
*/
|
|
75491
|
+
/**
|
|
75492
|
+
* Validate that a command string contains extractable valid shell syntax.
|
|
75493
|
+
* Returns the cleaned command if valid, or an error reason if not.
|
|
75494
|
+
*
|
|
75495
|
+
* Does NOT attempt to parse the full shell grammar — just checks for
|
|
75496
|
+
* obvious corruption (residual control tokens, empty commands).
|
|
75497
|
+
* Preserves heredocs, redirects, pipes, and other legitimate shell syntax.
|
|
75498
|
+
*/
|
|
75499
|
+
function validateShellCommand(command) {
|
|
75500
|
+
if (!command || !command.trim()) return {
|
|
75501
|
+
valid: false,
|
|
75502
|
+
cleaned: "",
|
|
75503
|
+
reason: "empty command"
|
|
75504
|
+
};
|
|
75505
|
+
let cleaned = cleanResidualTokenFragments(command);
|
|
75506
|
+
if (/(?:^|[^<])<\|/.test(cleaned) || /\|>/.test(cleaned)) {
|
|
75507
|
+
cleaned = cleaned.replace(/<\|[^|>]*(?:\|>)?/g, "").trim();
|
|
75508
|
+
cleaned = cleanResidualTokenFragments(cleaned);
|
|
75509
|
+
}
|
|
75510
|
+
if (!cleaned || !cleaned.trim()) return {
|
|
75511
|
+
valid: false,
|
|
75512
|
+
cleaned: "",
|
|
75513
|
+
reason: "command is empty after removing control tokens"
|
|
75514
|
+
};
|
|
75515
|
+
if (!/[a-zA-Z0-9_/.~-]/.test(cleaned)) return {
|
|
75516
|
+
valid: false,
|
|
75517
|
+
cleaned,
|
|
75518
|
+
reason: "no recognizable shell command found"
|
|
75519
|
+
};
|
|
75520
|
+
return {
|
|
75521
|
+
valid: true,
|
|
75522
|
+
cleaned: cleaned.trim()
|
|
75523
|
+
};
|
|
75524
|
+
}
|
|
75525
|
+
|
|
75526
|
+
//#endregion
|
|
75527
|
+
//#region src/agents/pi-tools.validate-wrapper.ts
|
|
75528
|
+
const EXEC_TOOL_NAMES = new Set(["exec", "bash"]);
|
|
75529
|
+
/**
|
|
75530
|
+
* Wrap tools with argument validation. Only exec/bash tools are validated.
|
|
75531
|
+
* Other tools pass through unchanged.
|
|
75532
|
+
*
|
|
75533
|
+
* Call this AFTER tools are created and the model profile is resolved.
|
|
75534
|
+
*/
|
|
75535
|
+
function wrapToolsWithArgValidation(tools, profile) {
|
|
75536
|
+
if (!profile.filters?.validateToolArgs) return tools;
|
|
75537
|
+
return tools.map((tool) => wrapToolWithArgValidation(tool));
|
|
75538
|
+
}
|
|
75539
|
+
/**
|
|
75540
|
+
* Wrap a single tool with argument validation for exec/bash commands.
|
|
75541
|
+
*/
|
|
75542
|
+
function wrapToolWithArgValidation(tool) {
|
|
75543
|
+
const toolName = (tool.name ?? "").toLowerCase().trim();
|
|
75544
|
+
if (!EXEC_TOOL_NAMES.has(toolName)) return tool;
|
|
75545
|
+
const originalExecute = tool.execute;
|
|
75546
|
+
return {
|
|
75547
|
+
...tool,
|
|
75548
|
+
execute(toolCallId, params, ...rest) {
|
|
75549
|
+
const command = params.command ?? params.cmd;
|
|
75550
|
+
if (typeof command !== "string") return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
75551
|
+
const result = validateShellCommand(command);
|
|
75552
|
+
if (!result.valid) return Promise.resolve({ output: `Error: ${result.reason}. The command appears to contain model control tokens. Please provide a clean shell command without any <|, |>, or XML-like tags. Only valid shell syntax is accepted.` });
|
|
75553
|
+
if (result.cleaned !== command) return originalExecute.call(tool, toolCallId, {
|
|
75554
|
+
...params,
|
|
75555
|
+
command: result.cleaned
|
|
75556
|
+
}, ...rest);
|
|
75557
|
+
return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
75558
|
+
}
|
|
75559
|
+
};
|
|
75560
|
+
}
|
|
75561
|
+
|
|
75457
75562
|
//#endregion
|
|
75458
75563
|
//#region src/agents/plan-mode.ts
|
|
75459
75564
|
/**
|
|
@@ -76688,10 +76793,11 @@ async function runEmbeddedAttempt(params) {
|
|
|
76688
76793
|
await resourceLoader.reload();
|
|
76689
76794
|
}
|
|
76690
76795
|
const hookRunner = getGlobalHookRunner();
|
|
76691
|
-
const { builtInTools, customTools } = splitSdkTools({
|
|
76796
|
+
const { builtInTools: rawBuiltInTools, customTools } = splitSdkTools({
|
|
76692
76797
|
tools,
|
|
76693
76798
|
sandboxEnabled: !!sandbox?.enabled
|
|
76694
76799
|
});
|
|
76800
|
+
const builtInTools = wrapToolsWithArgValidation(rawBuiltInTools, modelProfile);
|
|
76695
76801
|
let clientToolCallDetected = null;
|
|
76696
76802
|
const clientToolLoopDetection = resolveToolLoopDetectionConfig({
|
|
76697
76803
|
cfg: params.config,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as resolveStateDir } from "./paths-Cqn-zk3M.js";
|
|
2
2
|
import { B as theme, h as pathExists } from "./utils-B-0b9bGM.js";
|
|
3
3
|
import "./thinking-EAliFiVK.js";
|
|
4
|
-
import { V as trimLogTail } from "./reply-
|
|
4
|
+
import { V as trimLogTail } from "./reply-DYnTEYoa.js";
|
|
5
5
|
import { t as resolveSymiPackageRoot } from "./symi-root-CrGJbkzf.js";
|
|
6
6
|
import "./registry-Cja8eT7G.js";
|
|
7
7
|
import { f as defaultRuntime } from "./subsystem-D9vIQve0.js";
|
|
@@ -106,7 +106,7 @@ import "./stagger-BUClb97_.js";
|
|
|
106
106
|
import { c as resolveGatewayLaunchAgentLabel, d as resolveGatewaySystemdServiceName, f as resolveGatewayWindowsTaskName } from "./constants-C8_BLnaW.js";
|
|
107
107
|
import "./channel-selection-DuWs0Aak.js";
|
|
108
108
|
import { r as parseSemver } from "./runtime-guard-B37eizu-.js";
|
|
109
|
-
import "./program-context-
|
|
109
|
+
import "./program-context-DaNGrTOm.js";
|
|
110
110
|
import "./catalog-RiADx7MA.js";
|
|
111
111
|
import "./skills-status-CURJKnyY.js";
|
|
112
112
|
import { n as inheritOptionFromParent } from "./command-options-BtDai3oC.js";
|
|
@@ -117,7 +117,7 @@ import "./npm-registry-spec-C2JDdSZS.js";
|
|
|
117
117
|
import "./skill-scanner-CLs8u6vQ.js";
|
|
118
118
|
import "./installs-C1Cebk97.js";
|
|
119
119
|
import "./channels-status-issues-B_kBkl_u.js";
|
|
120
|
-
import { r as installCompletion } from "./completion-cli-
|
|
120
|
+
import { r as installCompletion } from "./completion-cli-C8y_J5KC.js";
|
|
121
121
|
import "./daemon-runtime-2mwX-jqj.js";
|
|
122
122
|
import "./systemd-riq8uNJQ.js";
|
|
123
123
|
import { t as resolveGatewayService } from "./service-Cl74hx8J.js";
|
|
@@ -126,19 +126,19 @@ import "./systemd-hints-BR6gChwm.js";
|
|
|
126
126
|
import { i as runDaemonInstall, r as runDaemonRestart } from "./daemon-cli-DscwlsKW.js";
|
|
127
127
|
import "./diagnostics-BAMlsVVX.js";
|
|
128
128
|
import { t as renderTable } from "./table-BTgkRafz.js";
|
|
129
|
-
import "./health-
|
|
129
|
+
import "./health-BjwDRAdd.js";
|
|
130
130
|
import "./control-ui-assets-Z947tKLt.js";
|
|
131
131
|
import { a as resolveNpmChannelTag, c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, m as normalizeUpdateChannel, n as compareSemverStrings, r as fetchNpmTagVersion, s as DEFAULT_GIT_CHANNEL, t as checkUpdateStatus, u as channelToNpmTag } from "./update-check-CtckACbb.js";
|
|
132
132
|
import "./dm-policy-shared-Bh3TbexU.js";
|
|
133
133
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-DtwCUTf-.js";
|
|
134
|
-
import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-
|
|
134
|
+
import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-CLKHrONW.js";
|
|
135
135
|
import "./logging-BzzwiKjv.js";
|
|
136
136
|
import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-rw7wJwHd.js";
|
|
137
137
|
import "./doctor-config-flow-QnaBd8kL.js";
|
|
138
138
|
import "./systemd-linger-aQ75ZlXY.js";
|
|
139
139
|
import "./health-format-DSwnXZPU.js";
|
|
140
|
-
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-
|
|
141
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
140
|
+
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-YOj4xigd.js";
|
|
141
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-D7CDLFLg.js";
|
|
142
142
|
import os from "node:os";
|
|
143
143
|
import path from "node:path";
|
|
144
144
|
import fs from "node:fs/promises";
|
|
@@ -16,7 +16,7 @@ import "./client-DMBZpU6X.js";
|
|
|
16
16
|
import "./call-BcE47FtD.js";
|
|
17
17
|
import "./message-channel-C9dERklz.js";
|
|
18
18
|
import "./pairing-token-Byh6drgn.js";
|
|
19
|
-
import { Ct as trimLogTail } from "./subagent-registry-
|
|
19
|
+
import { Ct as trimLogTail } from "./subagent-registry-CXrOOgPW.js";
|
|
20
20
|
import "./sessions-CJXnZVjR.js";
|
|
21
21
|
import "./tokens-Csntmwwn.js";
|
|
22
22
|
import "./plugins-CwSlLxM8.js";
|
|
@@ -111,10 +111,10 @@ import "./npm-registry-spec-DkaZNHAW.js";
|
|
|
111
111
|
import "./skill-scanner-BGWOBqLY.js";
|
|
112
112
|
import "./installs-CgQpVncj.js";
|
|
113
113
|
import "./channels-status-issues-c7qZbYG5.js";
|
|
114
|
-
import "./register.subclis-
|
|
115
|
-
import "./command-registry-
|
|
114
|
+
import "./register.subclis-B2dGWFur.js";
|
|
115
|
+
import "./command-registry-CHtN2HeK.js";
|
|
116
116
|
import "./program-context-CqzR_m-7.js";
|
|
117
|
-
import { r as installCompletion } from "./completion-cli-
|
|
117
|
+
import { r as installCompletion } from "./completion-cli-Cov6N3BO.js";
|
|
118
118
|
import "./daemon-runtime-CfRwa6qh.js";
|
|
119
119
|
import { r as parseSemver } from "./runtime-guard-D7waq_Ho.js";
|
|
120
120
|
import "./systemd-DlMdyFDY.js";
|
|
@@ -124,19 +124,19 @@ import "./systemd-hints-sQipWGd1.js";
|
|
|
124
124
|
import { i as runDaemonInstall, r as runDaemonRestart } from "./daemon-cli-wWnBIQtk.js";
|
|
125
125
|
import "./diagnostics-CS1ov_hH.js";
|
|
126
126
|
import { t as renderTable } from "./table-D01d2GuY.js";
|
|
127
|
-
import "./health-
|
|
127
|
+
import "./health-C5XJPwpt.js";
|
|
128
128
|
import "./control-ui-assets-BseSWee1.js";
|
|
129
129
|
import { a as resolveNpmChannelTag, c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, m as normalizeUpdateChannel, n as compareSemverStrings, r as fetchNpmTagVersion, s as DEFAULT_GIT_CHANNEL, t as checkUpdateStatus, u as channelToNpmTag } from "./update-check-ZdimP1aU.js";
|
|
130
130
|
import "./dm-policy-shared-DJ-61hCT.js";
|
|
131
131
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-DbmZz0Aq.js";
|
|
132
|
-
import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-
|
|
132
|
+
import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-BQxFFCGc.js";
|
|
133
133
|
import "./logging-BGewRZy0.js";
|
|
134
134
|
import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-DEMKx4eC.js";
|
|
135
135
|
import "./doctor-config-flow-CA3eiKhd.js";
|
|
136
136
|
import "./systemd-linger-DA_LW52P.js";
|
|
137
137
|
import "./health-format-CzgUHmmX.js";
|
|
138
|
-
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-
|
|
139
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
138
|
+
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-QaS2zul_.js";
|
|
139
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-BKKzstt6.js";
|
|
140
140
|
import { spawn, spawnSync } from "node:child_process";
|
|
141
141
|
import os from "node:os";
|
|
142
142
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nt as pathExists } from "./entry.js";
|
|
2
2
|
import { t as runCommandWithTimeout } from "./exec-CBKBIMpA.js";
|
|
3
|
-
import { Ct as trimLogTail } from "./subagent-registry-
|
|
3
|
+
import { Ct as trimLogTail } from "./subagent-registry-CXrOOgPW.js";
|
|
4
4
|
import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-BseSWee1.js";
|
|
5
5
|
import { c as DEFAULT_PACKAGE_CHANNEL, f as isBetaTag, l as DEV_BRANCH, n as compareSemverStrings, o as detectPackageManager$1, p as isStableTag, u as channelToNpmTag } from "./update-check-ZdimP1aU.js";
|
|
6
6
|
import os from "node:os";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as pathExists } from "./utils-B-0b9bGM.js";
|
|
2
|
-
import { V as trimLogTail } from "./reply-
|
|
2
|
+
import { V as trimLogTail } from "./reply-DYnTEYoa.js";
|
|
3
3
|
import { t as runCommandWithTimeout } from "./exec-CWkblSrI.js";
|
|
4
4
|
import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-Z947tKLt.js";
|
|
5
5
|
import { c as DEFAULT_PACKAGE_CHANNEL, f as isBetaTag, l as DEV_BRANCH, n as compareSemverStrings, o as detectPackageManager$1, p as isStableTag, u as channelToNpmTag } from "./update-check-CtckACbb.js";
|
|
@@ -15,7 +15,7 @@ import "./client-DMBZpU6X.js";
|
|
|
15
15
|
import "./call-BcE47FtD.js";
|
|
16
16
|
import "./message-channel-C9dERklz.js";
|
|
17
17
|
import "./pairing-token-Byh6drgn.js";
|
|
18
|
-
import { Bn as resolveEnvelopeFormatOptions, Cn as enqueueSystemEvent, F as buildHistoryContextFromEntries, Hn as hasControlCommand, I as recordPendingHistoryEntryIfEnabled, Kn as buildMentionRegexes, L as shouldAckReactionForWhatsApp, Ln as createInboundDebouncer, M as buildPairingReply, N as resolveMentionGating, P as DEFAULT_GROUP_HISTORY_LIMIT, R as dispatchReplyWithBufferedBlockDispatcher, Rn as resolveInboundDebounceMs, U as createDedupeCache, Un as shouldComputeCommandAuthorized, W as getReplyFromConfig, b as sleepWithAbort, nn as parseActivationCommand, qn as normalizeMentionText, tn as normalizeGroupActivation, y as computeBackoff, zn as formatInboundEnvelope } from "./subagent-registry-
|
|
18
|
+
import { Bn as resolveEnvelopeFormatOptions, Cn as enqueueSystemEvent, F as buildHistoryContextFromEntries, Hn as hasControlCommand, I as recordPendingHistoryEntryIfEnabled, Kn as buildMentionRegexes, L as shouldAckReactionForWhatsApp, Ln as createInboundDebouncer, M as buildPairingReply, N as resolveMentionGating, P as DEFAULT_GROUP_HISTORY_LIMIT, R as dispatchReplyWithBufferedBlockDispatcher, Rn as resolveInboundDebounceMs, U as createDedupeCache, Un as shouldComputeCommandAuthorized, W as getReplyFromConfig, b as sleepWithAbort, nn as parseActivationCommand, qn as normalizeMentionText, tn as normalizeGroupActivation, y as computeBackoff, zn as formatInboundEnvelope } from "./subagent-registry-CXrOOgPW.js";
|
|
19
19
|
import { B as resolveGroupSessionKey, c as recordSessionMetaFromInbound, o as loadSessionStore, s as readSessionUpdatedAt, u as updateLastRoute } from "./sessions-CJXnZVjR.js";
|
|
20
20
|
import "./tokens-Csntmwwn.js";
|
|
21
21
|
import "./plugins-CwSlLxM8.js";
|