chainlesschain 0.166.25 → 0.166.28
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/README.md +16 -10
- package/package.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-RaxL_QQD.js → AIOps-TeJoc3XQ.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DD3ieFO-.js → ActionButton-SZ9klC71.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-CATDJukS.js → Analytics-BvxMGhXs.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-BHGsnRDS.js → AppLayout-5zUWvYnk.js} +4 -4
- package/src/assets/web-panel/assets/{Artifacts-BL6NunjN.js → Artifacts-0BfSQj3N.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-D0nEWfbA.js → Audit-cScBdt3p.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-BAP1MUol.js → BackgroundAgents-022mS_uG.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-R4y2OeSi.js → Backup-CWnqpCpj.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-ByQZ2z6S.js → BaseInput-BCp80_Kc.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-32uV--xF.js → Chat-B2rj5NdZ.js} +3 -3
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-t1enanwz.js → ChatBubbleRenderer-2Lw_8bkr.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-D1CB-7bq.js → Checkbox-BTHrb0x7.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BPx3dQ2q.js → Codegen-Y17WGsCF.js} +1 -1
- package/src/assets/web-panel/assets/{Col-DkPTQ2Gl.js → Col-BBBucqHI.js} +1 -1
- package/src/assets/web-panel/assets/{Community-ZriaxRlr.js → Community-B2qcNGY4.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-C_qJ0P7F.js → Compact-BhDyZd93.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-Bgoy-saS.js → Compliance-BUEgTVrI.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-B5i9y6XK.js → Cowork-_wey4IKY.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-D7vBJ5-J.js → Cron-BSO7RSdx.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-D4kvoGI_.js → Crosschain-DawYCk-u.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BLOeBd-r.js → DID-DvtgImFY.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-mecJaonC.js → Dashboard-DYAyw4yL.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-GPKwaFer.js → Dropdown-CIaenBpM.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-BML9m7Dd.js → EmailListRenderer-jKv7wz64.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-DN5bAtJC.js → FamilyGuardDashboard-BxQggJuN.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DmD6Gecd.js → Federation-CDi_BOHj.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-6wwplN_K.js → FormItemContext-C-7XWf-w.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DUhpLkDL.js → GenericCardRenderer-D8PAhWue.js} +1 -1
- package/src/assets/web-panel/assets/{Git-eJfyXkwf.js → Git-yhajzO5I.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-swAUW59x.js → Governance-DjM6hZK3.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CbdwJPDJ.js → Inference-C-gVn1ci.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-UuYpg1nm.js → KnowledgeGraph-CyG5TgH-.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CS0G057y.js → Logs-CnIbZJc3.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-BDfOgqr1.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-CZRjuvvI.js → Marketplace-BQry6ziq.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BOJ9A_Rf.js → McpTools-7MBu8YsX.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-BnkrR-Ok.js → Memory-BlaZL_vM.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-Do4mPi13.js → MobileBridge-iUYdZA22.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-2JxWa6-p.js → MobileProjects-CUO-OpoO.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-CS_mnpGd.js → Mtc-6sD7414H.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-DZ4J_351.js → MtcAudit-BW8hjlD8.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-Jh74zKXu.js → Multisig-BA7_DWLu.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-_4n2BfnS.js → NLProgramming-7P7H52-B.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CtENcKHv.js → Notes-D2O2aG0R.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-dgDCvpK9.js → NotificationSettings-SD4fdxcr.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-D5VxCrmG.js → OrderTableRenderer-BbXM4Ueq.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-CpIF8Xkd.js → Organization-DNabgtKX.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-aHnBZaez.js → Overflow-B7Bqrhq0.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-8ppzog2V.js → P2P-Dh0Df0zq.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-D3p1BXkp.js → PdhVaultBrowser-DHfJarF9.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-D7vflD5q.js → Permissions-Bz3ddnZ9.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-D2hY-Ek2.js → PersonalDataHub-Dfe0X6p8.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-qK2VqhJC.js → Pipeline-kCnDqnwc.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-DHJr4uu0.js → Privacy-CPveUX9G.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DMBS6trm.js → ProjectInit-ddXd7WTL.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-D3Ng74BT.js → ProjectSettings-DnXcEjyu.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-BfJFZiIW.js → Projects-O2yaPDuU.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-DlNA95G0.js → Providers-hJpcyGxR.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-CMOIYxIm.js → QrScannerModal-CkbMoodn.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-D6MyGp5I.js → QuickAsk-CyFailNZ.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-W6WcShtf.js → Recommend-jpIDoqHs.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-Dm_MjlV_.js → RemoteSession-CieiVXM-.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-Ctvij6eX.js → Reputation-DHtgC0AY.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DivbeDE-.js → Row-CSUyTUkR.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-D4famoAw.js → RssFeed-CkHylSMs.js} +2 -2
- package/src/assets/web-panel/assets/{Search-6gOAh3zG.js → Search-ykyn3OaJ.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DApb9kK8.js → Security-DjM95Eyb.js} +3 -3
- package/src/assets/web-panel/assets/{Services-B8OomyE2.js → Services-Cf4UMvka.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-BTJ2g2E3.js → Skeleton-BnR-ZNiM.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-NIRr4DD1.js → Skills-oC5jYJgK.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-BQHP_6px.js → Sla-CTc_YFxW.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-BVQTDSVS.js → SpeechSettings-31rddoaP.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BOD4Mar6.js → SyncSettings-C-h00U59.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-Ciu7H2-y.js → Tasks-CGn_IiAO.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CtlwavRU.js → Templates-B9Hz_RuF.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-QLWYJdL6.js → Tenant-CJnIeKrI.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-B3q10mjm.js → Terminal-DfGtwDMA.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-CqltBA_8.js → TimelineRenderer-CISmCIFj.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-CJOKrj4y.js → Tokens-DNr-VU6W.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-CPMGgfdM.js → Trigger-CCYolBXm.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-DiJms7Bl.js → Trust-DD75_Hjo.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-rakR8eel.js → UkeySign-BXulgGCu.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-DAWZUM5o.js → VideoEditing-B0DgHQiZ.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-DqUPnl7K.js → Wallet-BV3CEPVS.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-BnVUwvMm.js → WebAuthn-CI9bXloP.js} +2 -2
- package/src/assets/web-panel/assets/{WorkflowEditor-B1CAwxgs.js → WorkflowEditor-B4z18zZp.js} +1 -1
- package/src/assets/web-panel/assets/{chat-k2-0Jzfy.js → chat-BsQ4S4Nh.js} +1 -1
- package/src/assets/web-panel/assets/{colors-BAu8xBmW.js → colors-C0Jsl3u8.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-DMlqcdfI.js → compact-item-CMZ_5Gdj.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-BU9kfiSw.js → createContext-VeTZ9pjJ.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-ChXQhXs6.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-2vacgdcl.js → hasIn-R2ip_4t-.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bpe2CJd-.js → index-02inSVeg.js} +1 -1
- package/src/assets/web-panel/assets/{index-BUX4W-2v.js → index-0LEUdXks.js} +1 -1
- package/src/assets/web-panel/assets/{index-CSvSf9px.js → index-4i3UILe7.js} +1 -1
- package/src/assets/web-panel/assets/{index-BxctzdYQ.js → index-6vvyh4N2.js} +1 -1
- package/src/assets/web-panel/assets/{index-JsyGqKmD.js → index-B53MC1iz.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMq0frKK.js → index-BDl3jun-.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bn8tARil.js → index-BGFKUUsv.js} +1 -1
- package/src/assets/web-panel/assets/{index-TtrpHmYx.js → index-BGKhfuHU.js} +1 -1
- package/src/assets/web-panel/assets/{index-C9WsM29I.js → index-BJvl_XUa.js} +1 -1
- package/src/assets/web-panel/assets/{index-DWLTSIka.js → index-BPTTGRU9.js} +1 -1
- package/src/assets/web-panel/assets/{index-Chybe7Ge.js → index-BX_8_UFn.js} +1 -1
- package/src/assets/web-panel/assets/{index-C5C4kSi8.js → index-BdwYZI-H.js} +1 -1
- package/src/assets/web-panel/assets/{index-oElehY4F.js → index-Bhz0a_oU.js} +1 -1
- package/src/assets/web-panel/assets/{index-DCusBOqR.js → index-BjW7Qlh-.js} +1 -1
- package/src/assets/web-panel/assets/index-BpqhSIKB.js +1 -0
- package/src/assets/web-panel/assets/{index-DHg3LMNP.js → index-BtV-unhh.js} +1 -1
- package/src/assets/web-panel/assets/{index-DH01oIaj.js → index-ByPe74vs.js} +1 -1
- package/src/assets/web-panel/assets/{index-CXmpR6N3.js → index-Bz4O8exa.js} +3 -3
- package/src/assets/web-panel/assets/{index-DmZNnZz7.js → index-C3oYV_lA.js} +1 -1
- package/src/assets/web-panel/assets/{index-CyXmP3PW.js → index-CIanQUmB.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ygh0wmKz.js → index-CNMfIBsh.js} +1 -1
- package/src/assets/web-panel/assets/{index-CONPVaxw.js → index-CsoYgCfM.js} +1 -1
- package/src/assets/web-panel/assets/{index-C6ICn9Y6.js → index-CuIo38St.js} +1 -1
- package/src/assets/web-panel/assets/index-Cv9p7aNY.js +1 -0
- package/src/assets/web-panel/assets/{index-B7wDjYUd.js → index-D4DUCUMd.js} +1 -1
- package/src/assets/web-panel/assets/{index-BZz2eB33.js → index-DF8AVnyq.js} +1 -1
- package/src/assets/web-panel/assets/{index-BblNQlaA.js → index-DUfRaQ2R.js} +1 -1
- package/src/assets/web-panel/assets/{index-BdfKoqsK.js → index-DdXJoar7.js} +1 -1
- package/src/assets/web-panel/assets/{index-hDHHJYno.js → index-DjkLws9g.js} +1 -1
- package/src/assets/web-panel/assets/{index-DfWvcu4p.js → index-Dqf95oif.js} +1 -1
- package/src/assets/web-panel/assets/{index-DaUGdvtU.js → index-Du20UePt.js} +1 -1
- package/src/assets/web-panel/assets/{index-DcA-tEQd.js → index-DvYF07ij.js} +1 -1
- package/src/assets/web-panel/assets/{index-C8ldqZi6.js → index-DwfM7rYW.js} +1 -1
- package/src/assets/web-panel/assets/{index-CPyYXKFB.js → index-WJ_YxlwK.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bf8YofPE.js → index-Zlt4hVX9.js} +1 -1
- package/src/assets/web-panel/assets/{index-z4_YwZDW.js → index-iHgBGK8l.js} +1 -1
- package/src/assets/web-panel/assets/{index-dIYqw3f0.js → index-nM2lMEZ4.js} +1 -1
- package/src/assets/web-panel/assets/{index-B-C-Ruft.js → index-q_5BV7Pj.js} +1 -1
- package/src/assets/web-panel/assets/{index-C24NoPpy.js → index-yIN1stc7.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-B9OXWu2e.js → initDefaultProps-D1uCn3z4.js} +1 -1
- package/src/assets/web-panel/assets/{motion-IQ47MCDQ.js → motion-5TP3EY0Q.js} +1 -1
- package/src/assets/web-panel/assets/{move-CLCU4kjV.js → move-C_bi-KUq.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-CXnVlSPq.js → mtc-parser-CmdzT6ro.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BJjLXB0f.js → omit-Ce0_wQke.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-BHdtvdy6.js → pickAttrs-DG8auaWM.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-oq8X_Bwc.js → placementArrow-CaWVLdLv.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DTD02LAO.js → responsiveObserve-Bot4LFBx.js} +1 -1
- package/src/assets/web-panel/assets/{slide-DbEeq8to.js → slide-HCFYDpKc.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-Do2fy1CJ.js → statusUtils-CWNqwWxQ.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-CFWD63T-.js → styleChecker-BUyR4PCy.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-BeozAWOo.js → useFlexGapSupport-C4XRVB5s.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-0-rIgnBL.js → useFs-D2VOJbk-.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CeiNoI31.js → usePersonalDataHub-dN8G1tq6.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-Dj0ReRNg.js → vnode-DSQKKZnw.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-DD7MC4Dy.js → zoom-Dl0bVMqQ.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/ask.js +84 -5
- package/src/commands/chat.js +67 -1
- package/src/commands/compact.js +81 -2
- package/src/commands/complete.js +64 -5
- package/src/commands/cowork.js +133 -0
- package/src/commands/orchestrate.js +18 -7
- package/src/data/changelog.json +26 -0
- package/src/gateways/ws/action-protocol.js +2 -0
- package/src/lib/agent-router.js +116 -36
- package/src/lib/cowork-task-runner.js +107 -4
- package/src/lib/evolution/agent-evolution-ingress.js +231 -40
- package/src/lib/evolution/agent-evolution-runtime-composition.js +85 -5
- package/src/lib/evolution/evolution-deployment-loader.js +17 -1
- package/src/lib/evolution/evolution-evidence-projector.js +25 -6
- package/src/lib/model-failure-policy.js +10 -0
- package/src/lib/orchestrator.js +97 -27
- package/src/lib/read-file-loop-guard.js +205 -76
- package/src/lib/read-file-page.js +55 -2
- package/src/lib/sub-agent-context.js +34 -2
- package/src/repl/chat-repl.js +60 -10
- package/src/runtime/agent-core.js +243 -64
- package/src/runtime/agent-runtime.js +20 -1
- package/src/runtime/runtime-factory.js +1 -1
- package/src/assets/web-panel/assets/MarkdownRenderer-BxIIB4k3.js +0 -1
- package/src/assets/web-panel/assets/devWarning-DuGrUMAS.js +0 -1
- package/src/assets/web-panel/assets/index-DvFfMAux.js +0 -1
- package/src/assets/web-panel/assets/index-n6p-1A77.js +0 -1
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import fs from "fs";
|
|
18
18
|
import path from "path";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
buildReadFilePage,
|
|
21
|
+
buildReadFileOutline,
|
|
22
|
+
} from "../lib/read-file-page.js";
|
|
20
23
|
import { ReadFileLoopGuard } from "../lib/read-file-loop-guard.js";
|
|
21
24
|
import broker from "../lib/process-execution-broker/index.js";
|
|
22
25
|
import os from "os";
|
|
@@ -24,6 +27,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
24
27
|
import skillInvocationReceipt from "@chainlesschain/session-core/skill-invocation-receipt";
|
|
25
28
|
import { isProxy } from "node:util/types";
|
|
26
29
|
import { captureAgentEvolutionIngress } from "../lib/evolution/agent-evolution-ingress.js";
|
|
30
|
+
import { isEvolutionIngressFailure } from "../lib/model-failure-policy.js";
|
|
27
31
|
|
|
28
32
|
const { startSkillInvocation, settleSkillInvocation } = skillInvocationReceipt;
|
|
29
33
|
import sharedCodingAgentPolicy from "./coding-agent-policy.cjs";
|
|
@@ -1088,6 +1092,8 @@ Key behaviors:
|
|
|
1088
1092
|
- For long-running commands (builds, full test suites, dev servers) set run_shell { run_in_background: true } to get a task_id back immediately, then poll output and completion with check_shell { task_id }. Kill a backgrounded server with check_shell { task_id, kill: true } when finished
|
|
1089
1093
|
- When asked about git status, diff, log, or other repository operations, use the git tool instead of run_shell
|
|
1090
1094
|
- When asked about files or code, use search_files to locate relevant sections, then read_file with offset/limit. Follow nextRead for large files. Reuse unchanged content already in context instead of repeatedly reading the same page; re-read when the file changes or the earlier content is no longer available.
|
|
1095
|
+
- Large task documents include a sampled outline with line numbers. Use it to locate relevant unfinished work and inspect those sections instead of scanning the entire document unless the task requires full coverage. File coverage and excerpts survive compaction; reading to EOF is not completing the user's task.
|
|
1096
|
+
- For task counts or completion status, search the named document for the latest status/summary table first, then read that section. Distinguish historical entries from current status and repository work from external acceptance. Once the relevant entries are verified, answer; do not read every implementation detail just to count tasks.
|
|
1091
1097
|
- Before renaming or changing a symbol, use code_intelligence (action: references/definition) to find every real usage instead of guessing with text search. It degrades to "unavailable" when no language server is installed — fall back to search_files then.
|
|
1092
1098
|
- After an edit, if the tool result includes a "newDiagnostics" array, you just introduced (or exposed) those errors/warnings — read them and fix before moving on. You can also run code_intelligence (action: diagnostics) on any file to check it on demand.
|
|
1093
1099
|
- If a tool result includes a "subtreeInstructions" array, you just entered a subdirectory that carries its own cc.md/CLAUDE.md/AGENTS.md — treat that content as authoritative project rules for work in that subtree (it is injected once, the first time you touch the subtree).
|
|
@@ -1097,6 +1103,7 @@ Key behaviors:
|
|
|
1097
1103
|
|
|
1098
1104
|
When the user's problem involves data processing, calculations, file operations, text parsing, API calls, web scraping, or any task that can be solved programmatically:
|
|
1099
1105
|
- Proactively write and execute code using run_code tool
|
|
1106
|
+
- For long documents, scripts should filter/count locally and print only the relevant rows, totals and source line numbers. Do not print an entire file or repeatedly dump its prefix through run_code/run_shell; use read_file offset/limit for missing sections. Truncated output is not full-file evidence.
|
|
1100
1107
|
- Choose the best language: Python for data/math/scraping, Node.js for JSON/API, Bash for system tasks
|
|
1101
1108
|
- Missing Python packages are NOT auto-installed by default; the tool result tells you (and the user) how to opt in (settings runCode.autoInstall)
|
|
1102
1109
|
- Scripts run from a temp file by default; pass persist:true to keep one in .chainlesschain/agent-scripts/ for reference
|
|
@@ -3633,6 +3640,7 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3633
3640
|
sessionBudget: context.sessionBudget || null,
|
|
3634
3641
|
hostResourceBudget: context.hostResourceBudget || null,
|
|
3635
3642
|
readFileCache: context.readFileCache || null,
|
|
3643
|
+
readFileLoopGuard: context.readFileLoopGuard || null,
|
|
3636
3644
|
// Effective contract of THIS loop (parent ceiling for a nested spawn) +
|
|
3637
3645
|
// the MCP tool definitions this loop exposes (inheritable by a spawn).
|
|
3638
3646
|
subAgentContract: context.subAgentContract || null,
|
|
@@ -5178,6 +5186,7 @@ async function executeToolInner(
|
|
|
5178
5186
|
toolAdmission = null,
|
|
5179
5187
|
hostResourceBudget = null,
|
|
5180
5188
|
readFileCache = null,
|
|
5189
|
+
readFileLoopGuard = null,
|
|
5181
5190
|
unattendedActionPolicy = null,
|
|
5182
5191
|
managedCheckpoint = false,
|
|
5183
5192
|
fileMutationScope = null,
|
|
@@ -5253,61 +5262,79 @@ async function executeToolInner(
|
|
|
5253
5262
|
});
|
|
5254
5263
|
}
|
|
5255
5264
|
const fileVersion = `${fileStat.size}:${fileStat.mtimeMs}:${fileStat.ctimeMs}`;
|
|
5256
|
-
const cacheKey = JSON.stringify([
|
|
5257
|
-
filePath,
|
|
5258
|
-
args.offset ?? null,
|
|
5259
|
-
args.limit ?? null,
|
|
5260
|
-
args.column ?? null,
|
|
5261
|
-
args.hashed === true,
|
|
5262
|
-
args.raw === true,
|
|
5263
|
-
]);
|
|
5264
|
-
const cached = readFileCache?.get(cacheKey);
|
|
5265
|
-
if (cached?.fileVersion === fileVersion) {
|
|
5266
|
-
// All permission checks ran before this point. A fresh stat still
|
|
5267
|
-
// invalidates changed/deleted files; cache only bounded pages per run.
|
|
5268
|
-
_recordFileObservation(filePath);
|
|
5269
|
-
readFileCache.delete(cacheKey);
|
|
5270
|
-
readFileCache.set(cacheKey, cached);
|
|
5271
|
-
return attachDescriptor(
|
|
5272
|
-
await _withSubtreeInstructions(
|
|
5273
|
-
structuredClone(cached.page),
|
|
5274
|
-
filePath,
|
|
5275
|
-
cwd,
|
|
5276
|
-
subtreeInstructionScope,
|
|
5277
|
-
),
|
|
5278
|
-
);
|
|
5279
|
-
}
|
|
5280
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
5281
|
-
// Record the mtime so a later edit can detect an external change that
|
|
5282
|
-
// happened between this read and the edit (read-freshness guard).
|
|
5283
5265
|
_recordFileObservation(filePath);
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5266
|
+
let rendered;
|
|
5267
|
+
let nbView;
|
|
5268
|
+
let outline;
|
|
5269
|
+
const render = () => {
|
|
5270
|
+
if (rendered !== undefined) return rendered;
|
|
5271
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
5272
|
+
nbView =
|
|
5273
|
+
args.raw !== true && /\.ipynb$/i.test(filePath)
|
|
5274
|
+
? renderNotebook(content)
|
|
5275
|
+
: null;
|
|
5276
|
+
rendered =
|
|
5277
|
+
nbView || (args.hashed === true ? annotateLines(content) : content);
|
|
5278
|
+
// Excerpts are data, never subtree instructions. Keep the index
|
|
5279
|
+
// separate from read coverage so it cannot claim the file was read.
|
|
5280
|
+
outline =
|
|
5281
|
+
((args.offset == null && args.limit == null) ||
|
|
5282
|
+
Number(args.limit) >= 2000) &&
|
|
5283
|
+
content.length > MAX_TOOL_RESULT_CHARS &&
|
|
5284
|
+
/\.(?:md|mdx|txt)$/i.test(filePath)
|
|
5285
|
+
? buildReadFileOutline(content)
|
|
5286
|
+
: null;
|
|
5287
|
+
return rendered;
|
|
5288
|
+
};
|
|
5289
|
+
const readPage = (request) => {
|
|
5290
|
+
const cacheKey = JSON.stringify([
|
|
5291
|
+
filePath,
|
|
5292
|
+
request.offset ?? null,
|
|
5293
|
+
request.limit ?? null,
|
|
5294
|
+
request.column ?? null,
|
|
5295
|
+
args.hashed === true,
|
|
5296
|
+
args.raw === true,
|
|
5297
|
+
]);
|
|
5298
|
+
const cached = readFileCache?.get(cacheKey);
|
|
5299
|
+
if (cached?.fileVersion === fileVersion)
|
|
5300
|
+
return structuredClone(cached.page);
|
|
5301
|
+
render();
|
|
5302
|
+
const page = buildReadFilePage(rendered, request, {
|
|
5303
|
+
filePath,
|
|
5305
5304
|
fileVersion,
|
|
5306
|
-
|
|
5305
|
+
// An unbounded large-document request starts with an index and a
|
|
5306
|
+
// small preview. A task-specific search can then avoid a full scan.
|
|
5307
|
+
maxChars:
|
|
5308
|
+
outline && request.offset == null && request.limit == null
|
|
5309
|
+
? Math.min(MAX_TOOL_RESULT_CHARS, 12000)
|
|
5310
|
+
: MAX_TOOL_RESULT_CHARS,
|
|
5311
|
+
outline,
|
|
5307
5312
|
});
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5313
|
+
if (nbView) page.notebook = true;
|
|
5314
|
+
if (readFileCache && !page.error) {
|
|
5315
|
+
readFileCache.delete(cacheKey);
|
|
5316
|
+
readFileCache.set(cacheKey, {
|
|
5317
|
+
fileVersion,
|
|
5318
|
+
page: structuredClone(page),
|
|
5319
|
+
});
|
|
5320
|
+
while (readFileCache.size > 8)
|
|
5321
|
+
readFileCache.delete(readFileCache.keys().next().value);
|
|
5322
|
+
}
|
|
5323
|
+
return page;
|
|
5324
|
+
};
|
|
5325
|
+
const page = readFileLoopGuard
|
|
5326
|
+
? readFileLoopGuard.read(
|
|
5327
|
+
args,
|
|
5328
|
+
{ filePath, fileVersion },
|
|
5329
|
+
readPage,
|
|
5330
|
+
(charOffset) => {
|
|
5331
|
+
const prefix = render().slice(0, charOffset);
|
|
5332
|
+
const offset = (prefix.match(/\n/g) || []).length + 1;
|
|
5333
|
+
const column = charOffset - prefix.lastIndexOf("\n");
|
|
5334
|
+
return readPage({ ...args, offset, column, limit: 2000 });
|
|
5335
|
+
},
|
|
5336
|
+
)
|
|
5337
|
+
: readPage(args);
|
|
5311
5338
|
return attachDescriptor(
|
|
5312
5339
|
await _withSubtreeInstructions(
|
|
5313
5340
|
page,
|
|
@@ -8203,6 +8230,7 @@ async function executeToolInner(
|
|
|
8203
8230
|
});
|
|
8204
8231
|
} catch (err) {
|
|
8205
8232
|
if (
|
|
8233
|
+
isEvolutionIngressFailure(err) ||
|
|
8206
8234
|
err?.runtimeLedgerPersistence === true ||
|
|
8207
8235
|
err?.workflowEffectOutcomeUnknown === true
|
|
8208
8236
|
) {
|
|
@@ -9202,7 +9230,7 @@ async function _executeRunCode(args, cwd) {
|
|
|
9202
9230
|
|
|
9203
9231
|
return {
|
|
9204
9232
|
success: true,
|
|
9205
|
-
|
|
9233
|
+
...boundedCodeOutput(retryOutput),
|
|
9206
9234
|
language: lang,
|
|
9207
9235
|
duration: `${retryDuration}ms`,
|
|
9208
9236
|
autoInstalled: [packageName],
|
|
@@ -9245,7 +9273,7 @@ async function _executeRunCode(args, cwd) {
|
|
|
9245
9273
|
const duration = Date.now() - start;
|
|
9246
9274
|
return {
|
|
9247
9275
|
success: true,
|
|
9248
|
-
output
|
|
9276
|
+
...boundedCodeOutput(output),
|
|
9249
9277
|
language: lang,
|
|
9250
9278
|
duration: `${duration}ms`,
|
|
9251
9279
|
scriptPath: persist ? scriptPath : undefined,
|
|
@@ -9323,9 +9351,66 @@ export function capToolResultString(serialized, max = MAX_TOOL_RESULT_CHARS) {
|
|
|
9323
9351
|
);
|
|
9324
9352
|
}
|
|
9325
9353
|
|
|
9354
|
+
/** Leave room for JSON escaping and execution metadata, including the hint. */
|
|
9355
|
+
export function boundedCodeOutput(value) {
|
|
9356
|
+
const output = String(value ?? "");
|
|
9357
|
+
const budget = Math.max(0, MAX_TOOL_RESULT_CHARS - 4096);
|
|
9358
|
+
let low = 0;
|
|
9359
|
+
let high = Math.min(output.length, 50000);
|
|
9360
|
+
while (low < high) {
|
|
9361
|
+
const mid = Math.ceil((low + high) / 2);
|
|
9362
|
+
if (JSON.stringify(output.slice(0, mid)).length <= budget) low = mid;
|
|
9363
|
+
else high = mid - 1;
|
|
9364
|
+
}
|
|
9365
|
+
if (low === output.length) return { output };
|
|
9366
|
+
if (low > 0 && /[\uD800-\uDBFF]/.test(output[low - 1])) low--;
|
|
9367
|
+
return {
|
|
9368
|
+
truncated: true,
|
|
9369
|
+
outputChars: output.length,
|
|
9370
|
+
returnedChars: low,
|
|
9371
|
+
hint: "Only an output prefix is shown. Do not rerun the same full-file print: filter/count locally and print a bounded summary with source line numbers, or use read_file with offset/limit for a missing section. This prefix is not evidence of the entire file.",
|
|
9372
|
+
output: output.slice(0, low),
|
|
9373
|
+
};
|
|
9374
|
+
}
|
|
9375
|
+
|
|
9326
9376
|
/** Avoid injecting the same file page twice while its original is still visible. */
|
|
9327
9377
|
export function toolResultForModel(tool, result, messages) {
|
|
9328
9378
|
const serialized = capToolResultString(safeStringifyToolResult(result));
|
|
9379
|
+
if (
|
|
9380
|
+
(tool === "run_code" || tool === "run_shell") &&
|
|
9381
|
+
!result?.error &&
|
|
9382
|
+
typeof result?.output === "string" &&
|
|
9383
|
+
result.output.length >= 8000
|
|
9384
|
+
) {
|
|
9385
|
+
const callIds = new Set(
|
|
9386
|
+
messages.flatMap((message) =>
|
|
9387
|
+
(message.tool_calls || [])
|
|
9388
|
+
.filter((call) => call.function?.name === tool)
|
|
9389
|
+
.map((call) => call.id),
|
|
9390
|
+
),
|
|
9391
|
+
);
|
|
9392
|
+
const previous = messages.find((message) => {
|
|
9393
|
+
if (message.role !== "tool" || !callIds.has(message.tool_call_id))
|
|
9394
|
+
return false;
|
|
9395
|
+
try {
|
|
9396
|
+
const prior = JSON.parse(message.content.split("\n\n[Budget ")[0]);
|
|
9397
|
+
return !prior.error && prior.output === result.output;
|
|
9398
|
+
} catch {
|
|
9399
|
+
return false;
|
|
9400
|
+
}
|
|
9401
|
+
});
|
|
9402
|
+
if (previous) {
|
|
9403
|
+
return capToolResultString(
|
|
9404
|
+
safeStringifyToolResult({
|
|
9405
|
+
...result,
|
|
9406
|
+
output: undefined,
|
|
9407
|
+
outputOmitted: true,
|
|
9408
|
+
previousToolCallId: previous.tool_call_id,
|
|
9409
|
+
hint: "This command executed again and returned the same large output already visible in the referenced tool result. Reuse that output; filter/count locally or read a specific missing section instead of dumping it again. This does not establish that files or other command side effects are unchanged.",
|
|
9410
|
+
}),
|
|
9411
|
+
);
|
|
9412
|
+
}
|
|
9413
|
+
}
|
|
9329
9414
|
if (
|
|
9330
9415
|
tool !== "read_file" ||
|
|
9331
9416
|
result?.error ||
|
|
@@ -9523,6 +9608,7 @@ function _backgroundSubAgentResultText(entry) {
|
|
|
9523
9608
|
function _throwBackgroundSubAgentUsageFailure(entry) {
|
|
9524
9609
|
const error = entry?.outcome?.fatalError;
|
|
9525
9610
|
if (
|
|
9611
|
+
isEvolutionIngressFailure(error) ||
|
|
9526
9612
|
error?.runtimeLedgerPersistence === true ||
|
|
9527
9613
|
error?.workflowEffectOutcomeUnknown === true
|
|
9528
9614
|
) {
|
|
@@ -10473,7 +10559,8 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10473
10559
|
return {
|
|
10474
10560
|
result: subCtx.result,
|
|
10475
10561
|
error: err.message,
|
|
10476
|
-
...(err
|
|
10562
|
+
...(isEvolutionIngressFailure(err) ||
|
|
10563
|
+
err?.runtimeLedgerPersistence === true ||
|
|
10477
10564
|
err?.workflowEffectOutcomeUnknown === true
|
|
10478
10565
|
? { fatalError: err }
|
|
10479
10566
|
: {}),
|
|
@@ -10608,6 +10695,7 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10608
10695
|
});
|
|
10609
10696
|
|
|
10610
10697
|
if (
|
|
10698
|
+
isEvolutionIngressFailure(err) ||
|
|
10611
10699
|
err?.runtimeLedgerPersistence === true ||
|
|
10612
10700
|
err?.workflowEffectOutcomeUnknown === true
|
|
10613
10701
|
) {
|
|
@@ -13708,6 +13796,7 @@ export async function* agentLoop(messages, options) {
|
|
|
13708
13796
|
// rather than looping forever (the iteration budget is the hard backstop).
|
|
13709
13797
|
let emptyThinkingReprompted = false;
|
|
13710
13798
|
const readFileLoopGuard = new ReadFileLoopGuard();
|
|
13799
|
+
toolContext.readFileLoopGuard = readFileLoopGuard;
|
|
13711
13800
|
|
|
13712
13801
|
while (budget.hasRemaining()) {
|
|
13713
13802
|
readFileLoopGuard.finishBatch();
|
|
@@ -13718,7 +13807,7 @@ export async function* agentLoop(messages, options) {
|
|
|
13718
13807
|
);
|
|
13719
13808
|
yield* _drainSubAgentUsage(subAgentUsageSink);
|
|
13720
13809
|
const error = new Error(
|
|
13721
|
-
"Repeated
|
|
13810
|
+
"Repeated file reads or identical large command outputs: the model did not resume the task after six no-progress batches and recovery guidance. The task is not complete. Use a targeted section or compute a bounded summary before retrying.",
|
|
13722
13811
|
);
|
|
13723
13812
|
error.code = "CC_AGENT_REPEATED_FILE_READ";
|
|
13724
13813
|
throw error;
|
|
@@ -14275,11 +14364,74 @@ export async function* agentLoop(messages, options) {
|
|
|
14275
14364
|
// prepareCall runs fresh each iteration and returns an ephemeral
|
|
14276
14365
|
// system-message supplement that is NOT persisted to messages history.
|
|
14277
14366
|
let callMessages = messages;
|
|
14367
|
+
// Give a looping model a turn focused on search/action rather than another
|
|
14368
|
+
// whole-file request. This changes discovery for one request only; runtime
|
|
14369
|
+
// permissions are untouched and ordinary reads return on the next turn.
|
|
14370
|
+
const readRecoveryTurn = readFileLoopGuard.takeRecoveryTurn();
|
|
14371
|
+
const iterationToolOptions = readRecoveryTurn
|
|
14372
|
+
? {
|
|
14373
|
+
...effectiveToolOptions,
|
|
14374
|
+
disabledTools: [
|
|
14375
|
+
...(effectiveToolOptions.disabledTools || []),
|
|
14376
|
+
"read_file",
|
|
14377
|
+
],
|
|
14378
|
+
}
|
|
14379
|
+
: effectiveToolOptions;
|
|
14380
|
+
const readContext = [
|
|
14381
|
+
readFileLoopGuard.findingsHint,
|
|
14382
|
+
readFileLoopGuard.progressHint,
|
|
14383
|
+
].filter(Boolean);
|
|
14384
|
+
if (readContext.length) {
|
|
14385
|
+
// Preserve the last conversational turn and never split a tool call
|
|
14386
|
+
// from its results. Source data must neither become system authority
|
|
14387
|
+
// nor create an assistant prefill / a new generic user request.
|
|
14388
|
+
const resultIndex = messages.findLastIndex(
|
|
14389
|
+
(message) => message.role === "tool",
|
|
14390
|
+
);
|
|
14391
|
+
if (resultIndex >= 0) {
|
|
14392
|
+
const result = messages[resultIndex];
|
|
14393
|
+
const original =
|
|
14394
|
+
typeof result.content === "string"
|
|
14395
|
+
? result.content
|
|
14396
|
+
: safeStringifyToolResult(result.content);
|
|
14397
|
+
let content;
|
|
14398
|
+
try {
|
|
14399
|
+
const value = JSON.parse(original);
|
|
14400
|
+
content = JSON.stringify({
|
|
14401
|
+
...value,
|
|
14402
|
+
retainedReadContext: readContext,
|
|
14403
|
+
});
|
|
14404
|
+
} catch {
|
|
14405
|
+
content = original + "\n\n" + readContext.join("\n\n");
|
|
14406
|
+
}
|
|
14407
|
+
// Enrich only the ephemeral copy. This preserves signed assistant
|
|
14408
|
+
// thinking blocks, the last tool result, and the persisted transcript.
|
|
14409
|
+
callMessages = messages.map((message, index) =>
|
|
14410
|
+
index === resultIndex ? { ...result, content } : message,
|
|
14411
|
+
);
|
|
14412
|
+
} else {
|
|
14413
|
+
// Full compaction can leave only the pinned request. Reiterate that
|
|
14414
|
+
// exact request after the source data, not a replacement objective.
|
|
14415
|
+
const request = messages.findLast((message) => message.role === "user");
|
|
14416
|
+
callMessages = [
|
|
14417
|
+
...messages,
|
|
14418
|
+
...readContext.map((content) => ({ role: "assistant", content })),
|
|
14419
|
+
{
|
|
14420
|
+
role: "user",
|
|
14421
|
+
content: request?.content || "Continue the original user task.",
|
|
14422
|
+
},
|
|
14423
|
+
];
|
|
14424
|
+
}
|
|
14425
|
+
}
|
|
14278
14426
|
const contextMemoryTrustedSystemIndexes = [];
|
|
14279
|
-
if (
|
|
14427
|
+
if (readRecoveryTurn) {
|
|
14280
14428
|
callMessages = [
|
|
14281
14429
|
...callMessages,
|
|
14282
|
-
{
|
|
14430
|
+
{
|
|
14431
|
+
role: "system",
|
|
14432
|
+
content:
|
|
14433
|
+
"File-read loop recovery: read_file is temporarily omitted for this model turn. Use the retained findings to choose a concrete next action or a focused search. Do not claim the user's task is complete merely because the file was read. Normal read_file availability resumes on the following turn.",
|
|
14434
|
+
},
|
|
14283
14435
|
];
|
|
14284
14436
|
contextMemoryTrustedSystemIndexes.push(callMessages.length - 1);
|
|
14285
14437
|
}
|
|
@@ -14328,7 +14480,7 @@ export async function* agentLoop(messages, options) {
|
|
|
14328
14480
|
{
|
|
14329
14481
|
...options,
|
|
14330
14482
|
contextMemoryToolDefinitions:
|
|
14331
|
-
getEffectiveToolDefinitions(
|
|
14483
|
+
getEffectiveToolDefinitions(iterationToolOptions),
|
|
14332
14484
|
contextMemoryTrustedSystemIndexes,
|
|
14333
14485
|
},
|
|
14334
14486
|
);
|
|
@@ -14358,13 +14510,13 @@ export async function* agentLoop(messages, options) {
|
|
|
14358
14510
|
);
|
|
14359
14511
|
const plannedProviderOptions = canonicalProviderContext?.plan
|
|
14360
14512
|
? {
|
|
14361
|
-
...
|
|
14513
|
+
...iterationToolOptions,
|
|
14362
14514
|
contextEngine: null,
|
|
14363
14515
|
contextMemoryPreplanned: true,
|
|
14364
14516
|
contextMemorySelectedToolNames:
|
|
14365
14517
|
canonicalProviderContext.selectedToolNames,
|
|
14366
14518
|
}
|
|
14367
|
-
:
|
|
14519
|
+
: iterationToolOptions;
|
|
14368
14520
|
const requestOptions = providerRequestId
|
|
14369
14521
|
? { ...plannedProviderOptions, providerRequestId }
|
|
14370
14522
|
: plannedProviderOptions;
|
|
@@ -14538,6 +14690,29 @@ export async function* agentLoop(messages, options) {
|
|
|
14538
14690
|
}
|
|
14539
14691
|
|
|
14540
14692
|
const toolCalls = msg.tool_calls;
|
|
14693
|
+
if (Array.isArray(toolCalls) && toolCalls.length > 0) {
|
|
14694
|
+
// Allocate missing provider IDs once, before transcript insertion and
|
|
14695
|
+
// any evidence or execution boundary. This is only local correlation,
|
|
14696
|
+
// not a provider receipt or an exactly-once execution guarantee.
|
|
14697
|
+
const usedIds = new Set();
|
|
14698
|
+
for (const call of toolCalls) {
|
|
14699
|
+
if (!call || typeof call !== "object") continue;
|
|
14700
|
+
if (call.id == null || call.id === "") {
|
|
14701
|
+
// Letter-only encoding retains UUID entropy without introducing
|
|
14702
|
+
// number-like control IDs into sensitive-data classification.
|
|
14703
|
+
const localId = randomUUID()
|
|
14704
|
+
.replaceAll("-", "")
|
|
14705
|
+
.replace(/[0-9]/g, (digit) =>
|
|
14706
|
+
String.fromCharCode(103 + Number(digit)),
|
|
14707
|
+
);
|
|
14708
|
+
call.id = `cc_tool_${localId}`;
|
|
14709
|
+
}
|
|
14710
|
+
if (typeof call.id !== "string" || usedIds.has(call.id)) {
|
|
14711
|
+
throw new Error("Malformed or duplicate tool call identity");
|
|
14712
|
+
}
|
|
14713
|
+
usedIds.add(call.id);
|
|
14714
|
+
}
|
|
14715
|
+
}
|
|
14541
14716
|
|
|
14542
14717
|
if (!toolCalls || toolCalls.length === 0) {
|
|
14543
14718
|
// A final answer while background sub-agents are still outstanding is
|
|
@@ -14694,7 +14869,7 @@ export async function* agentLoop(messages, options) {
|
|
|
14694
14869
|
|
|
14695
14870
|
// Add assistant message with tool calls
|
|
14696
14871
|
messages.push(msg);
|
|
14697
|
-
readFileLoopGuard.startBatch(
|
|
14872
|
+
readFileLoopGuard.startBatch();
|
|
14698
14873
|
|
|
14699
14874
|
// Concurrent READ-ONLY batch (latency optimization). When every call in the
|
|
14700
14875
|
// turn is a well-formed read-only built-in (pure fs/DB reads — no mutation,
|
|
@@ -15175,7 +15350,11 @@ export async function* agentLoop(messages, options) {
|
|
|
15175
15350
|
"tool_error",
|
|
15176
15351
|
);
|
|
15177
15352
|
} catch (err) {
|
|
15178
|
-
if (
|
|
15353
|
+
if (
|
|
15354
|
+
isEvolutionIngressFailure(err) ||
|
|
15355
|
+
err?.runtimeLedgerPersistence === true
|
|
15356
|
+
)
|
|
15357
|
+
throw err;
|
|
15179
15358
|
toolResult = {
|
|
15180
15359
|
error: err.message,
|
|
15181
15360
|
...(workflowBinding
|
|
@@ -379,6 +379,9 @@ export class AgentRuntime {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
async startChatSession() {
|
|
382
|
+
if (this.evolutionIngress !== null) {
|
|
383
|
+
await this.evolutionIngress.start();
|
|
384
|
+
}
|
|
382
385
|
this.emit(RUNTIME_EVENTS.RUNTIME_START, {
|
|
383
386
|
kind: this.kind,
|
|
384
387
|
policy: this.policy,
|
|
@@ -387,7 +390,23 @@ export class AgentRuntime {
|
|
|
387
390
|
kind: this.kind,
|
|
388
391
|
sessionId: this.policy.sessionId || null,
|
|
389
392
|
});
|
|
390
|
-
|
|
393
|
+
const result = await this.deps.startChatRepl({
|
|
394
|
+
...this.policy,
|
|
395
|
+
...(this.evolutionIngress === null
|
|
396
|
+
? {}
|
|
397
|
+
: { evolutionIngress: this.evolutionIngress }),
|
|
398
|
+
});
|
|
399
|
+
if (this.evolutionIngress !== null) {
|
|
400
|
+
if (result?.schema === AGENT_EVOLUTION_SESSION_SCHEMA) {
|
|
401
|
+
return await waitForAgentEvolutionSession(
|
|
402
|
+
result,
|
|
403
|
+
this.evolutionIngress,
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
if (result?.started === false) return result;
|
|
407
|
+
await this.evolutionIngress.complete();
|
|
408
|
+
}
|
|
409
|
+
return result;
|
|
391
410
|
}
|
|
392
411
|
|
|
393
412
|
async startServer() {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as c,J as d,b as a}from"./vendor-Bn1JzzAn.js";import{r as s}from"./markdown-Yo_c6Krv.js";import{_ as p}from"./index-CXmpR6N3.js";const _={__name:"MarkdownRenderer",props:{content:{type:String,default:""}},setup(t,{expose:o}){o();const e=t,r=a(()=>s(e.content||"")),n={props:e,rendered:r,computed:a,get renderMarkdown(){return s}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}},i=["innerHTML"];function m(t,o,e,r,n,u){return c(),d("div",{class:"markdown-content",innerHTML:r.rendered},null,8,i)}const w=p(_,[["render",m],["__scopeId","data-v-0b0b9f63"],["__file","/tmp/cc-web-panel-d2aftn/repo/packages/web-panel/src/components/MarkdownRenderer.vue"]]);export{w as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as r}from"./index-CXmpR6N3.js";const o=((n,a,e)=>{r(n,`[ant-design-vue: ${a}] ${e}`)});export{o as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./Col-DkPTQ2Gl.js";import{a0 as t}from"./index-CXmpR6N3.js";import"./vendor-Bn1JzzAn.js";import"./index-BxctzdYQ.js";import"./icons-DG5UD-6K.js";const s=t(o);export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as o}from"./Row-DivbeDE-.js";import{a0 as t}from"./index-CXmpR6N3.js";import"./vendor-Bn1JzzAn.js";import"./responsiveObserve-DTD02LAO.js";import"./useFlexGapSupport-BeozAWOo.js";import"./styleChecker-CFWD63T-.js";import"./index-BxctzdYQ.js";import"./icons-DG5UD-6K.js";const l=t(o);export{l as default};
|