@qwen-code/qwen-code 0.21.7 → 0.21.8

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.
Files changed (314) hide show
  1. package/README.md +2 -0
  2. package/bundled/qc-helper/docs/configuration/settings.md +43 -30
  3. package/bundled/qc-helper/docs/features/channels/dingtalk.md +40 -2
  4. package/bundled/qc-helper/docs/features/channels/feishu.md +13 -2
  5. package/bundled/qc-helper/docs/features/channels/github.md +13 -11
  6. package/bundled/qc-helper/docs/features/channels/gitlab.md +13 -11
  7. package/bundled/qc-helper/docs/features/channels/overview.md +49 -31
  8. package/bundled/qc-helper/docs/features/channels/plugins.md +2 -2
  9. package/bundled/qc-helper/docs/features/channels/qqbot.md +4 -2
  10. package/bundled/qc-helper/docs/features/channels/telegram.md +4 -2
  11. package/bundled/qc-helper/docs/features/channels/wecom.md +1 -1
  12. package/bundled/qc-helper/docs/features/code-review.md +4 -0
  13. package/bundled/qc-helper/docs/features/commands.md +1 -1
  14. package/bundled/qc-helper/docs/features/hooks.md +52 -0
  15. package/bundled/qc-helper/docs/integration-jetbrains.md +1 -0
  16. package/bundled/qc-helper/docs/qwen-serve.md +4 -1
  17. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +50 -36
  18. package/bundled/review/SKILL.md +28 -5
  19. package/chunks/{MaxSizedBox-ANWZBPTS.js → MaxSizedBox-7PM6BGJ5.js} +26 -22
  20. package/chunks/{StandaloneSessionPicker-XKS3VU3A.js → StandaloneSessionPicker-3UQHM7GV.js} +44 -40
  21. package/chunks/{acp-startup-profiler-ORIQ2CCQ.js → acp-startup-profiler-B5BYAMYQ.js} +2 -2
  22. package/chunks/{acpAgent-KUAZ3GCZ.js → acpAgent-5UWLFV6V.js} +534 -262
  23. package/chunks/{agent-T6PTGX5R.js → agent-624T2BLO.js} +26 -22
  24. package/chunks/{agent-headless-PR7YCB7S.js → agent-headless-2EE5J2KX.js} +26 -22
  25. package/chunks/{artifact-tool-U4VOZIK5.js → artifact-tool-N652YE4L.js} +1 -1
  26. package/chunks/{askUserQuestion-XOBQLPFA.js → askUserQuestion-ONW74PKJ.js} +1 -1
  27. package/chunks/{bridge-NU6YEEHK.js → bridge-JENKGFFP.js} +29 -25
  28. package/chunks/{ca-NYKNH222.js → ca-ZLKAB4K3.js} +6 -0
  29. package/chunks/{channel-management-service-FSQ7SHYI.js → channel-management-service-DDWUPHMU.js} +19 -10
  30. package/chunks/{channel-settings-store-35VQVUVV.js → channel-settings-store-SA6JZSPH.js} +34 -30
  31. package/chunks/{channel-worker-group-JWQK224X.js → channel-worker-group-E67EN3RV.js} +5 -5
  32. package/chunks/{channel-worker-manager-77E3OXRQ.js → channel-worker-manager-SW4C45CF.js} +5 -5
  33. package/chunks/{channel-worker-supervisor-62YWUGP2.js → channel-worker-supervisor-5SRD24FG.js} +3 -3
  34. package/chunks/{chunk-CJXIIILK.js → chunk-2FRY5CRX.js} +1 -1
  35. package/chunks/{chunk-ZJ3VGYHK.js → chunk-2ILAOM2I.js} +34 -17
  36. package/chunks/{chunk-6XJMFJ4D.js → chunk-2M4K4KYS.js} +177 -120
  37. package/chunks/{chunk-CNIID3TV.js → chunk-2UUMVNYT.js} +1 -1
  38. package/chunks/{chunk-22NBYCPD.js → chunk-3P2LV43B.js} +1 -1
  39. package/chunks/{chunk-2U3WZGZG.js → chunk-3PY4LPJF.js} +19 -131
  40. package/chunks/{chunk-SPMY6CX6.js → chunk-3SE7J4DR.js} +3 -3
  41. package/chunks/{chunk-6UWFTUQL.js → chunk-3WNQOYHQ.js} +66 -22
  42. package/chunks/{chunk-KXSDEOFU.js → chunk-4ALIARFY.js} +1 -1
  43. package/chunks/{chunk-D3UEZIQH.js → chunk-4DU3NCHG.js} +48 -55
  44. package/chunks/{chunk-BGG4MBYD.js → chunk-4PYCZH2V.js} +4 -187
  45. package/chunks/{chunk-H2UQ2M5Z.js → chunk-4WU6NY7F.js} +96 -22
  46. package/chunks/{chunk-TLV2IMHR.js → chunk-5ZGR6RKJ.js} +3 -3
  47. package/chunks/{chunk-3K7FH2KQ.js → chunk-67N6HB5H.js} +1310 -171
  48. package/chunks/{chunk-EORNAQDT.js → chunk-6TR7CFXH.js} +1 -1
  49. package/chunks/{chunk-NG2R4N5O.js → chunk-6ZRFAKXK.js} +1 -1
  50. package/chunks/{chunk-P2AJ7FTI.js → chunk-757GB46F.js} +1 -1
  51. package/chunks/{chunk-72LNFGUY.js → chunk-77QVBFCU.js} +3 -3
  52. package/chunks/{chunk-OH2VKQXH.js → chunk-7DVT4LVV.js} +37 -30
  53. package/chunks/{chunk-KKJJB5X6.js → chunk-7VUERJHS.js} +1503 -815
  54. package/chunks/{chunk-VOARQPTA.js → chunk-B52AWKBB.js} +65 -21
  55. package/chunks/{chunk-Y4EWSQF7.js → chunk-BF224XHL.js} +2 -2
  56. package/chunks/{chunk-PJOBIWUG.js → chunk-BF52U4XJ.js} +1 -1
  57. package/chunks/{chunk-55LYDVPU.js → chunk-C5VWPTGT.js} +1 -1
  58. package/chunks/{chunk-W7U4ESW2.js → chunk-CG3WBKJK.js} +1 -1
  59. package/chunks/chunk-COBO5EBO.js +135 -0
  60. package/chunks/chunk-CPG6P4GG.js +82 -0
  61. package/chunks/{chunk-DIEFUBV6.js → chunk-DIWZNWZT.js} +205 -35
  62. package/chunks/{chunk-AE77C5ZU.js → chunk-DQSDACD2.js} +1 -1
  63. package/chunks/{chunk-P3LEG54R.js → chunk-DX5W5AON.js} +2 -2
  64. package/chunks/{chunk-EUQTXRKZ.js → chunk-E4ZBKMSF.js} +5 -5
  65. package/chunks/{chunk-FPM27XN4.js → chunk-EIVICVHM.js} +4 -4
  66. package/chunks/{chunk-YHEEE624.js → chunk-EN2TKTFH.js} +1 -1
  67. package/chunks/chunk-F6WFNA7U.js +22 -0
  68. package/chunks/{chunk-FZBZSYKU.js → chunk-FN6YXJOP.js} +1 -1
  69. package/chunks/{chunk-KR4ZSC7K.js → chunk-FWBXMANW.js} +3 -3
  70. package/chunks/{chunk-LA7YLSR6.js → chunk-FYAXKJK7.js} +327 -67
  71. package/chunks/{chunk-CSZEXZBE.js → chunk-GBDINRIL.js} +3 -3
  72. package/chunks/{chunk-SCI7K3GM.js → chunk-GOEVOFQI.js} +19 -10
  73. package/chunks/{chunk-LEMXGVEP.js → chunk-GQCEQPYQ.js} +3 -3
  74. package/chunks/{chunk-Y7E5LNLO.js → chunk-GXSNGY5M.js} +1027 -876
  75. package/chunks/{chunk-6XU3PH66.js → chunk-HA3SAB64.js} +22 -69
  76. package/chunks/{chunk-Y4NGLFGJ.js → chunk-HUWENAHO.js} +1 -1
  77. package/chunks/{chunk-3ULCB3NE.js → chunk-HV76SFIA.js} +1 -1
  78. package/chunks/{chunk-CB2464BK.js → chunk-HWX5HPUG.js} +14 -4
  79. package/chunks/{chunk-LZC3B5N2.js → chunk-IA7TGCN2.js} +2 -2
  80. package/chunks/{chunk-RERATVSK.js → chunk-IBYULW65.js} +6 -6
  81. package/chunks/{chunk-HYRDKNUY.js → chunk-IUQ52YJK.js} +1 -1
  82. package/chunks/{chunk-TDXGKHDN.js → chunk-IYES5WOT.js} +2 -2
  83. package/chunks/{chunk-RGSBTHSU.js → chunk-KAQCJO6Y.js} +131 -4
  84. package/chunks/{chunk-VWOVHOTT.js → chunk-KJZ26VBX.js} +1 -1
  85. package/chunks/{chunk-6GONZVLS.js → chunk-KKDVZLGL.js} +1 -1
  86. package/chunks/{chunk-MKVZE4ZJ.js → chunk-KTJFU7RT.js} +3 -2
  87. package/chunks/{chunk-R574ATRM.js → chunk-M2PNLYGY.js} +41 -0
  88. package/chunks/{chunk-6EOI4HOK.js → chunk-M3STHEMM.js} +12 -17
  89. package/chunks/chunk-NGYI5EF5.js +244 -0
  90. package/chunks/{chunk-ALGGS7UH.js → chunk-NPQ5ZKRP.js} +82 -1
  91. package/chunks/{chunk-HQB2KUAN.js → chunk-NPUXXRJI.js} +1 -1
  92. package/chunks/{chunk-QETYKPMG.js → chunk-NVRDQFCX.js} +1 -1
  93. package/chunks/{chunk-PQBHU2IA.js → chunk-OHKJVAKG.js} +10 -10
  94. package/chunks/{chunk-CYR3HI5X.js → chunk-OQTXYMKW.js} +2 -2
  95. package/chunks/{chunk-DBOFL3LQ.js → chunk-PG62DFWD.js} +10 -10
  96. package/chunks/{chunk-2VSTGY6M.js → chunk-PJRW65JO.js} +1 -1
  97. package/chunks/{chunk-33ACCIIY.js → chunk-PLFATELK.js} +1 -1
  98. package/chunks/{chunk-IC4Z6LX6.js → chunk-PYQADEFD.js} +5 -0
  99. package/chunks/{chunk-MAJS7AT4.js → chunk-QGHSP65Z.js} +2 -2
  100. package/chunks/{chunk-OHJLEW5J.js → chunk-QQWD7LZV.js} +4 -4
  101. package/chunks/{chunk-ZXU5UHMI.js → chunk-QXVSWG66.js} +2 -2
  102. package/chunks/{chunk-E33LOKRA.js → chunk-RPWVIXDB.js} +18 -1
  103. package/chunks/{chunk-TYKC75AX.js → chunk-S3Y3GBFD.js} +1 -1
  104. package/chunks/{chunk-7UFKAV7Y.js → chunk-S6HYI3MF.js} +2 -2
  105. package/chunks/chunk-SAH4BD2J.js +92 -0
  106. package/chunks/{chunk-OMKQH5C5.js → chunk-SNRT2TJJ.js} +6 -23
  107. package/chunks/chunk-SR7RZ4MS.js +202 -0
  108. package/chunks/{chunk-CXE7E23H.js → chunk-TE3ZAJE7.js} +45 -17
  109. package/chunks/{chunk-S7CV4KO6.js → chunk-TKSZJ5BV.js} +3 -3
  110. package/chunks/{chunk-3NB7TSE2.js → chunk-U5SLIG7E.js} +1 -1
  111. package/chunks/chunk-UA5H3DS2.js +203 -0
  112. package/chunks/{chunk-24ER7UV4.js → chunk-UFALT4LK.js} +1 -1
  113. package/chunks/{chunk-YJQCUTT2.js → chunk-VWMUDKLC.js} +3 -3
  114. package/chunks/{chunk-RMH5OWLD.js → chunk-VXZ5HAOV.js} +1 -1
  115. package/chunks/{chunk-BVWVWGLE.js → chunk-WAUGQKUU.js} +4 -64
  116. package/chunks/{chunk-SHZYHGQH.js → chunk-WG6542MA.js} +1 -1
  117. package/chunks/{chunk-5KH532V7.js → chunk-WV5J6Q6N.js} +1 -1
  118. package/chunks/{chunk-RNVQB725.js → chunk-XHD7CRP2.js} +2 -2
  119. package/chunks/{chunk-W4B7UBUS.js → chunk-XZKQT2B2.js} +5 -5
  120. package/chunks/{chunk-6HVUFDS2.js → chunk-Y4TETC74.js} +22 -13
  121. package/chunks/{chunk-RZHU3ILK.js → chunk-YEF7XEO2.js} +4 -4
  122. package/chunks/{chunk-RUL4S3K3.js → chunk-YHJFF7KH.js} +146 -45
  123. package/chunks/{chunk-23RZCH76.js → chunk-YOM7DEGB.js} +3 -3
  124. package/chunks/{chunk-OFI7IGST.js → chunk-ZCLLJARV.js} +9 -9
  125. package/chunks/{chunk-GSS34377.js → chunk-ZHA242R4.js} +2 -2
  126. package/chunks/{chunk-TRLYP7OF.js → chunk-ZPLALRXZ.js} +17 -9
  127. package/chunks/{chunk-WUC6ZFXO.js → chunk-ZWBUH5UP.js} +1 -1
  128. package/chunks/{computer-use-KEAPATUY.js → computer-use-ESQYJ3JY.js} +26 -22
  129. package/chunks/{config-utils-K7SCOWHD.js → config-utils-XQHBJP7G.js} +4 -4
  130. package/chunks/{contextCommand-ZJA6A5K5.js → contextCommand-CX3YF4ZE.js} +28 -24
  131. package/chunks/{core-runtime-QMJPWHCI.js → core-runtime-DIAU7JMG.js} +30 -26
  132. package/chunks/{create-sub-session-DJE6XICH.js → create-sub-session-HDPD6HOA.js} +26 -22
  133. package/chunks/{create-sub-session-E4PBYXV5.js → create-sub-session-QIDZUOPU.js} +1 -1
  134. package/chunks/{cron-create-GRBWYMIJ.js → cron-create-VONA5JYY.js} +1 -1
  135. package/chunks/{cron-delete-4CMKBR2M.js → cron-delete-5JXSP2MI.js} +1 -1
  136. package/chunks/{cron-list-W7K4ASOA.js → cron-list-KE4F2CIR.js} +1 -1
  137. package/chunks/{daemon-SCTQMM7Z.js → daemon-VZBGJUNL.js} +30 -0
  138. package/chunks/{daemon-status-provider-FSWDPE2G.js → daemon-status-provider-H6O4UQ4F.js} +33 -29
  139. package/chunks/{daemon-trust-policy-P5L5VFAY.js → daemon-trust-policy-BNUXG6MT.js} +33 -29
  140. package/chunks/{daemon-trust-policy-monitor-73JYN6ET.js → daemon-trust-policy-monitor-E4EQ7GF4.js} +33 -29
  141. package/chunks/{de-VL76CPLV.js → de-LIW4XVLN.js} +5 -0
  142. package/chunks/{deferred-core-runtime-BWRCCFTE.js → deferred-core-runtime-CBMSHPAU.js} +26 -22
  143. package/chunks/{display-image-O2XFPQTC.js → display-image-NQRSIBXM.js} +2 -2
  144. package/chunks/{dist-DPPHJAVL.js → dist-EEEQGCZA.js} +918 -142
  145. package/chunks/{dist-K4WWQBHS.js → dist-HIACTZEK.js} +55 -15
  146. package/chunks/{dist-3BMEUGTG.js → dist-IRL7WA5Z.js} +1 -1
  147. package/chunks/{dist-HVBMEYWK.js → dist-KVISB2O2.js} +1 -1
  148. package/chunks/{dist-KS4O2NKE.js → dist-MBF3I5MX.js} +14 -8
  149. package/chunks/{dist-SFQ34F4M.js → dist-MKX5OSFF.js} +5 -4
  150. package/chunks/{dist-7JGAAQSC.js → dist-RCH3I7SS.js} +2 -2
  151. package/chunks/{dist-C5U4LJKW.js → dist-TUSWNE2I.js} +5 -4
  152. package/chunks/{earlyInputCapture-L5ST23A6.js → earlyInputCapture-UIOP7OIN.js} +26 -22
  153. package/chunks/{edit-LHHRFNFK.js → edit-ITMZYFKA.js} +26 -22
  154. package/chunks/{en-IRJ2WN5T.js → en-SY5GTIGX.js} +6 -0
  155. package/chunks/{enter-worktree-6NXCRZPF.js → enter-worktree-S4PL5UV6.js} +26 -22
  156. package/chunks/{enterPlanMode-ZVQT4U7D.js → enterPlanMode-YV52NNJT.js} +26 -22
  157. package/chunks/{environment-GJ2HWJOS.js → environment-NGOWPRZV.js} +30 -26
  158. package/chunks/{errors-6RLH3XXC.js → errors-BU26DTDX.js} +28 -24
  159. package/chunks/{exit-worktree-I2YLUHHY.js → exit-worktree-XRM6LH5F.js} +26 -22
  160. package/chunks/{exitPlanMode-7CCWKO7I.js → exitPlanMode-ZLI5F7KR.js} +26 -22
  161. package/chunks/{fast-path-DVFD4HQD.js → fast-path-UJWORIED.js} +23 -3
  162. package/chunks/{fast-path-settings-WQJU2LAT.js → fast-path-settings-37WQD5B2.js} +6 -3
  163. package/chunks/{fr-GK3HQYVB.js → fr-RQFO7U4P.js} +5 -0
  164. package/chunks/{gemini-7FWGOYD4.js → gemini-ZSKNDUMU.js} +77 -65
  165. package/chunks/{geminiContentGenerator-V2WVLIXU.js → geminiContentGenerator-YGEXOEKD.js} +1 -1
  166. package/chunks/{glob-3N6GGI75.js → glob-7KZG44BR.js} +26 -22
  167. package/chunks/{goal-tools-APOW6UXL.js → goal-tools-PXWN5VK3.js} +4 -2
  168. package/chunks/{grep-V43ILZVX.js → grep-6ZFC7RJ5.js} +26 -22
  169. package/chunks/{handleAutoUpdate-A5WFVWIA.js → handleAutoUpdate-KSEL3TQS.js} +30 -26
  170. package/chunks/{i18n-PLVQ4FBZ.js → i18n-ZIUXBW5V.js} +27 -23
  171. package/chunks/{image-gen-7C6IK6DC.js → image-gen-AUIZJJNK.js} +7 -5
  172. package/chunks/{initializer-CVAIKZYL.js → initializer-7AHY3N6Q.js} +33 -29
  173. package/chunks/{installationInfo-J6QDHNTK.js → installationInfo-VGBXMYLY.js} +27 -23
  174. package/chunks/{ja-3FA46IKD.js → ja-KOZKHJHZ.js} +5 -0
  175. package/chunks/{list-ZZ4OUUWV.js → list-PSFKQHLB.js} +36 -32
  176. package/chunks/{list-agents-KFFIIS2G.js → list-agents-Z4WABFDZ.js} +1 -1
  177. package/chunks/{loadedSettingsAdapter-QRYRJSWL.js → loadedSettingsAdapter-FTMRCTOF.js} +33 -29
  178. package/chunks/{loggingContentGenerator-OJCO75HM.js → loggingContentGenerator-MZAN52UV.js} +7 -5
  179. package/chunks/{loop-wakeup-TLMJPMMP.js → loop-wakeup-UZ5RL5Y2.js} +2 -2
  180. package/chunks/{ls-UVVE2XGE.js → ls-TVHDGIES.js} +1 -1
  181. package/chunks/{lsp-QMEA2VLB.js → lsp-CVN6OQPI.js} +1 -1
  182. package/chunks/{managed-npm-update-PCOSCP2N.js → managed-npm-update-O4NHK45X.js} +27 -23
  183. package/chunks/{mcp-M3WKKWKY.js → mcp-6CFP2AYQ.js} +33 -29
  184. package/chunks/{monitor-GN24FH6C.js → monitor-DAKD6OU4.js} +26 -22
  185. package/chunks/{nonInteractiveCli-KPTU3VSQ.js → nonInteractiveCli-RC7VIUZL.js} +66 -60
  186. package/chunks/{notebook-edit-4YM65BBO.js → notebook-edit-474DPMRL.js} +34 -22
  187. package/chunks/{openaiContentGenerator-EDQT6GTV.js → openaiContentGenerator-2NFY2MWO.js} +19 -9
  188. package/chunks/{pidfile-JOIIRN2C.js → pidfile-KBFVDNQP.js} +26 -22
  189. package/chunks/{process-registry-2CHQBXH5.js → process-registry-PMJOA5CO.js} +15 -0
  190. package/chunks/{processUtils-5SV4MX3Q.js → processUtils-6GRYH4Y3.js} +2 -2
  191. package/chunks/{pt-3AOBKPIJ.js → pt-U6AOCTMF.js} +5 -0
  192. package/chunks/{qwenContentGenerator-ODRJSUGR.js → qwenContentGenerator-KAHU6IZY.js} +33 -28
  193. package/chunks/{qwenOAuth2-NESCMZ47.js → qwenOAuth2-RRQTCP4W.js} +7 -5
  194. package/chunks/{read-file-HPSODLPK.js → read-file-3M6WXDXP.js} +6 -4
  195. package/chunks/{read-mcp-resource-2TNSJTC3.js → read-mcp-resource-PZ4ZF6YL.js} +1 -1
  196. package/chunks/{record-artifact-RAON52FC.js → record-artifact-P4HFMS7X.js} +2 -2
  197. package/chunks/{resumeHistoryUtils-TXCOFFMQ.js → resumeHistoryUtils-D6TAY3HX.js} +30 -26
  198. package/chunks/{ripGrep-ZKQGTQAO.js → ripGrep-PLPENT3E.js} +26 -22
  199. package/chunks/{ru-VJRAMC4W.js → ru-CMX4UMYP.js} +5 -0
  200. package/chunks/{run-qwen-serve-ZPKPKECF.js → run-qwen-serve-ZAFIJKJC.js} +168 -54
  201. package/chunks/{runtime-2FLNNM36.js → runtime-ZED7CYOZ.js} +38 -34
  202. package/chunks/{scheduler-365PJHNR.js → scheduler-MD3AL2W5.js} +26 -22
  203. package/chunks/{send-message-ZM7MRUGP.js → send-message-CAMSLG2L.js} +4 -3
  204. package/chunks/{serve-QD2RNLKJ.js → serve-E3VUDRZN.js} +33 -29
  205. package/chunks/{server-XLJVLTYM.js → server-OWMEMAKR.js} +450 -231
  206. package/chunks/{session-3VTUHH4Q.js → session-HZ57QK7K.js} +158 -97
  207. package/chunks/{settings-KULVPCQC.js → settings-V7BR3RKP.js} +32 -28
  208. package/chunks/{shell-3SWW22MH.js → shell-23OMNMW6.js} +26 -22
  209. package/chunks/{skill-KDHWYS7W.js → skill-6HBDYZRS.js} +7 -5
  210. package/chunks/{skill-settings-NMY4JEJC.js → skill-settings-HWJLTU7M.js} +32 -28
  211. package/chunks/{spawnChannel-ZKS4Q5OU.js → spawnChannel-N6KKUW5B.js} +27 -23
  212. package/chunks/{standalone-update-7CXPGAQ4.js → standalone-update-QGIKHATD.js} +28 -24
  213. package/chunks/{startInteractiveUI-2QQLEKM6.js → startInteractiveUI-GX2CRL42.js} +365 -155
  214. package/chunks/{syntheticOutput-ZLCUTKO2.js → syntheticOutput-PEBJQYJV.js} +2 -2
  215. package/chunks/{task-create-CQP5UEA3.js → task-create-5NWCQSJF.js} +5 -4
  216. package/chunks/{task-list-XLEZOJXP.js → task-list-53265TRZ.js} +1 -1
  217. package/chunks/{task-stop-7ZQM5CFF.js → task-stop-FPCOIRYX.js} +1 -1
  218. package/chunks/{task-update-JA75U2SN.js → task-update-5HN577LS.js} +5 -4
  219. package/chunks/{team-create-2WTNGAOX.js → team-create-CFFKU7KL.js} +26 -22
  220. package/chunks/{team-delete-MHY3UZGY.js → team-delete-MMQB4OSC.js} +1 -1
  221. package/chunks/{team-plan-approval-LZTYLEG4.js → team-plan-approval-6EFOKR6A.js} +26 -22
  222. package/chunks/{terminal-image-renderer-R5HHAFJN.js → terminal-image-renderer-TLDNACQY.js} +28 -24
  223. package/chunks/{theme-manager-PAUCSJFF.js → theme-manager-5LJ3H7VO.js} +26 -22
  224. package/chunks/{todoWrite-UPVOHYGD.js → todoWrite-JGV6VLOX.js} +1 -1
  225. package/chunks/{tool-search-2BFCGLI6.js → tool-search-UJV3A24H.js} +9 -6
  226. package/chunks/{total-session-admission-MK4SINFK.js → total-session-admission-D63QYXGO.js} +29 -25
  227. package/chunks/{trustedFolders-TJ5S26N7.js → trustedFolders-KZCOB53W.js} +30 -24
  228. package/chunks/{update-relaunch-N7AYLARF.js → update-relaunch-IFILM3SA.js} +5 -5
  229. package/chunks/{updateCheck-QRZ3DVT5.js → updateCheck-YZ2CRCFC.js} +29 -25
  230. package/chunks/{useAutoAcceptIndicator-DBJ7Y5AF.js → useAutoAcceptIndicator-AXEVNA3Q.js} +35 -31
  231. package/chunks/{validateNonInterActiveAuth-6ZQWUDS3.js → validateNonInterActiveAuth-3WTOJFWA.js} +61 -57
  232. package/chunks/{version-AJQGQWXC.js → version-GXK7OHZY.js} +1 -1
  233. package/chunks/{web-fetch-QWJYRXFL.js → web-fetch-ILB4GAVR.js} +12 -8
  234. package/chunks/{web-search-2AOXJGHU.js → web-search-HKRPGPZZ.js} +8 -6
  235. package/chunks/{workflow-ERH3SJG2.js → workflow-FXIPRQQA.js} +750 -147
  236. package/chunks/{workspace-providers-status-HZ474RA4.js → workspace-providers-status-NYHC7HSR.js} +35 -31
  237. package/chunks/{workspace-registration-store-6EUP4JXG.js → workspace-registration-store-AKEB7OMW.js} +1 -1
  238. package/chunks/{workspace-registry-R4APRRNC.js → workspace-registry-CDAS5TVZ.js} +29 -25
  239. package/chunks/{workspace-service-HFIFDMU7.js → workspace-service-PAMUKMAV.js} +36 -32
  240. package/chunks/{workspace-skills-status-HAHEIHGK.js → workspace-skills-status-YQSHCCMS.js} +33 -29
  241. package/chunks/{workspace-trust-reconciler-65GTAGDK.js → workspace-trust-reconciler-RPTXOIY2.js} +36 -32
  242. package/chunks/{write-file-B34CDELV.js → write-file-CGS57TS4.js} +26 -22
  243. package/chunks/{zh-ARWDLDLR.js → zh-AGL2FVBI.js} +6 -0
  244. package/chunks/{zh-TW-Y4RGI3P7.js → zh-TW-KI66MHQY.js} +6 -0
  245. package/chunks/{zoom-image-HPRBZHSS.js → zoom-image-E7D72GYV.js} +6 -4
  246. package/cli.js +13 -13
  247. package/locales/ca.js +10 -0
  248. package/locales/de.js +9 -0
  249. package/locales/en.js +10 -0
  250. package/locales/fr.js +9 -0
  251. package/locales/ja.js +9 -0
  252. package/locales/pt.js +9 -0
  253. package/locales/ru.js +9 -0
  254. package/locales/zh-TW.js +10 -0
  255. package/locales/zh.js +10 -0
  256. package/package.json +3 -3
  257. package/web-shell/assets/{arc-Ip-FFDJ0.js → arc-DybZaz32.js} +1 -1
  258. package/web-shell/assets/{architectureDiagram-3BPJPVTR-CChqgwIb.js → architectureDiagram-3BPJPVTR-jN3qBd19.js} +1 -1
  259. package/web-shell/assets/{blockDiagram-GPEHLZMM-BHN-Tfss.js → blockDiagram-GPEHLZMM-Ct5DZPrj.js} +1 -1
  260. package/web-shell/assets/{c4Diagram-AAUBKEIU-BhyjzDjN.js → c4Diagram-AAUBKEIU-CUAFMlUG.js} +1 -1
  261. package/web-shell/assets/channel-BMwLrwLW.js +1 -0
  262. package/web-shell/assets/{chunk-2J33WTMH-BB9eyHrx.js → chunk-2J33WTMH-CuV8n90B.js} +1 -1
  263. package/web-shell/assets/{chunk-4BX2VUAB-BeV7ce_J.js → chunk-4BX2VUAB-BUzl_kls.js} +1 -1
  264. package/web-shell/assets/{chunk-55IACEB6-DO7kXDiV.js → chunk-55IACEB6-BnDBLX6A.js} +1 -1
  265. package/web-shell/assets/{chunk-727SXJPM-B27MPznD.js → chunk-727SXJPM-B83uTOjm.js} +1 -1
  266. package/web-shell/assets/{chunk-AQP2D5EJ-DHIjqjD_.js → chunk-AQP2D5EJ-DM3HLgpT.js} +1 -1
  267. package/web-shell/assets/{chunk-FMBD7UC4-DabMqyN2.js → chunk-FMBD7UC4-CSQ5hgyb.js} +1 -1
  268. package/web-shell/assets/{chunk-ND2GUHAM-Dw7Nnnxc.js → chunk-ND2GUHAM-BWOF4SxX.js} +1 -1
  269. package/web-shell/assets/{chunk-QZHKN3VN-DdaZew1Q.js → chunk-QZHKN3VN-BsOH9LMi.js} +1 -1
  270. package/web-shell/assets/classDiagram-4FO5ZUOK-BGDv98jY.js +1 -0
  271. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BGDv98jY.js +1 -0
  272. package/web-shell/assets/{cose-bilkent-S5V4N54A-CgBpCYH5.js → cose-bilkent-S5V4N54A-IENqH2iJ.js} +1 -1
  273. package/web-shell/assets/{dagre-BM42HDAG-BB4IU8G0.js → dagre-BM42HDAG--dyzDTGo.js} +1 -1
  274. package/web-shell/assets/{diagram-2AECGRRQ-BcUTHU37.js → diagram-2AECGRRQ-BE7Dcqof.js} +1 -1
  275. package/web-shell/assets/{diagram-5GNKFQAL-B6Lyihyv.js → diagram-5GNKFQAL-Cr8-5OTj.js} +1 -1
  276. package/web-shell/assets/{diagram-KO2AKTUF-CRIJOjpG.js → diagram-KO2AKTUF-Bzey3uAY.js} +1 -1
  277. package/web-shell/assets/{diagram-LMA3HP47-DdNiwWWT.js → diagram-LMA3HP47-sErl28Xb.js} +1 -1
  278. package/web-shell/assets/{diagram-OG6HWLK6-Dz4b32Do.js → diagram-OG6HWLK6-Dq30ATIo.js} +1 -1
  279. package/web-shell/assets/{erDiagram-TEJ5UH35-D-8NGw77.js → erDiagram-TEJ5UH35-BkCoEfVW.js} +1 -1
  280. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dun26LyM.js → flowDiagram-I6XJVG4X-DHwO0rrI.js} +1 -1
  281. package/web-shell/assets/{ganttDiagram-6RSMTGT7-F10Hu1Gc.js → ganttDiagram-6RSMTGT7-s7vAPxWq.js} +1 -1
  282. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bf8Ez6-D.js → gitGraphDiagram-PVQCEYII-CQxhwPOU.js} +1 -1
  283. package/web-shell/assets/index-Bckpjr-I.css +5 -0
  284. package/web-shell/assets/{index-BXqw-nGq.js → index-CF4wApWp.js} +1 -1
  285. package/web-shell/assets/index-DwEr9HEW.js +1768 -0
  286. package/web-shell/assets/{infoDiagram-5YYISTIA-DVgTMLvj.js → infoDiagram-5YYISTIA-BnFrD0bq.js} +1 -1
  287. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-uT-KepvK.js → ishikawaDiagram-YF4QCWOH-Bf9zK5NK.js} +1 -1
  288. package/web-shell/assets/{journeyDiagram-JHISSGLW-Vg_XadQf.js → journeyDiagram-JHISSGLW-CyGAhsxi.js} +1 -1
  289. package/web-shell/assets/{kanban-definition-UN3LZRKU-Dyv1ESBE.js → kanban-definition-UN3LZRKU-CbsK5akB.js} +1 -1
  290. package/web-shell/assets/{linear-BMIepYX3.js → linear-cQsF4P8D.js} +1 -1
  291. package/web-shell/assets/{mermaid.core-zA8pJ9ag.js → mermaid.core-Z4HVqrKY.js} +5 -5
  292. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BCW_BZ_5.js → mindmap-definition-RKZ34NQL-CYnrBo_f.js} +1 -1
  293. package/web-shell/assets/{pieDiagram-4H26LBE5-DseNEGp2.js → pieDiagram-4H26LBE5-CBzOfhrs.js} +1 -1
  294. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-6Z7wr1Fi.js → quadrantDiagram-W4KKPZXB-D4LK1Ebn.js} +1 -1
  295. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CVOlCRPf.js → requirementDiagram-4Y6WPE33-Bzti2Lcj.js} +1 -1
  296. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-CGhgrUJZ.js → sankeyDiagram-5OEKKPKP-yTBw5Z2s.js} +1 -1
  297. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-dlqmpLuQ.js → sequenceDiagram-3UESZ5HK-D07UVRiZ.js} +1 -1
  298. package/web-shell/assets/{stateDiagram-AJRCARHV-B9EW10Xb.js → stateDiagram-AJRCARHV-UE_lHsTn.js} +1 -1
  299. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DC6xgXjX.js +1 -0
  300. package/web-shell/assets/{timeline-definition-PNZ67QCA-BBRh0mgZ.js → timeline-definition-PNZ67QCA-DRvYdiTs.js} +1 -1
  301. package/web-shell/assets/{vennDiagram-CIIHVFJN-B8Gs-REP.js → vennDiagram-CIIHVFJN-CQLIXs0u.js} +1 -1
  302. package/web-shell/assets/{wardley-L42UT6IY-D_y80Ur7.js → wardley-L42UT6IY-JZz_Xqse.js} +1 -1
  303. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-D-CNfHJ-.js → wardleyDiagram-YWT4CUSO--i7BiJwB.js} +1 -1
  304. package/web-shell/assets/{xychartDiagram-2RQKCTM6-DQ5CvELo.js → xychartDiagram-2RQKCTM6-Bkc-bW0S.js} +1 -1
  305. package/web-shell/index.html +2 -2
  306. package/chunks/chunk-6PEXNQTX.js +0 -68
  307. package/chunks/chunk-IUFV6FYU.js +0 -81
  308. package/web-shell/assets/channel-Cu8qd6OB.js +0 -1
  309. package/web-shell/assets/classDiagram-4FO5ZUOK-BI3KrXhq.js +0 -1
  310. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BI3KrXhq.js +0 -1
  311. package/web-shell/assets/index-QQlUCJGg.css +0 -5
  312. package/web-shell/assets/index-hcgjV7vS.js +0 -1768
  313. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CJTZJJ5X.js +0 -1
  314. package/chunks/{anthropicContentGenerator-DTMVEL5M.js → anthropicContentGenerator-SSFE2753.js} +9 -9
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  recomputeMcpGating
5
- } from "./chunk-RZHU3ILK.js";
5
+ } from "./chunk-YEF7XEO2.js";
6
6
  import {
7
7
  classifyApiError,
8
8
  fireSessionDeleteHook
@@ -16,14 +16,14 @@ import {
16
16
  matchMcpServerByRef,
17
17
  parseExtensionRef,
18
18
  parseMcpServerRef
19
- } from "./chunk-KR4ZSC7K.js";
19
+ } from "./chunk-FWBXMANW.js";
20
20
  import {
21
21
  getAvailableCommands,
22
22
  handleSlashCommand,
23
23
  insertAfterFunctionResponses,
24
24
  isSlashCommand,
25
25
  normalizePartList
26
- } from "./chunk-RUL4S3K3.js";
26
+ } from "./chunk-YHJFF7KH.js";
27
27
  import {
28
28
  SessionIdConflictError,
29
29
  appEvents,
@@ -31,36 +31,36 @@ import {
31
31
  cleanupReviewWorktreeLeases,
32
32
  loadCliConfig,
33
33
  normalizeDisabledToolList
34
- } from "./chunk-KKJJB5X6.js";
34
+ } from "./chunk-7VUERJHS.js";
35
35
  import {
36
36
  getCommandSubcommandNames
37
- } from "./chunk-QETYKPMG.js";
37
+ } from "./chunk-NVRDQFCX.js";
38
38
  import {
39
39
  getEffectiveSupportedModes
40
- } from "./chunk-RNVQB725.js";
40
+ } from "./chunk-XHD7CRP2.js";
41
41
  import "./chunk-NYX53SV4.js";
42
- import "./chunk-YHEEE624.js";
42
+ import "./chunk-EN2TKTFH.js";
43
43
  import {
44
44
  collectContextData,
45
45
  formatContextUsageText
46
- } from "./chunk-SCI7K3GM.js";
46
+ } from "./chunk-GOEVOFQI.js";
47
47
  import "./chunk-4WGODMVR.js";
48
- import "./chunk-GSS34377.js";
48
+ import "./chunk-ZHA242R4.js";
49
49
  import "./chunk-YAF2MQZ6.js";
50
50
  import "./chunk-CTJLZLB5.js";
51
51
  import {
52
52
  computeCpuPercent
53
53
  } from "./chunk-LBOVL47Y.js";
54
- import "./chunk-CB2464BK.js";
54
+ import "./chunk-HWX5HPUG.js";
55
55
  import "./chunk-6H67XLET.js";
56
56
  import {
57
57
  beginAcpBootstrapConfigProfiling,
58
58
  buildAndFreezeAcpStartupProfile,
59
59
  endAcpBootstrapConfigProfiling,
60
60
  markAcpStartup
61
- } from "./chunk-W7U4ESW2.js";
62
- import "./chunk-FPM27XN4.js";
63
- import "./chunk-TDXGKHDN.js";
61
+ } from "./chunk-CG3WBKJK.js";
62
+ import "./chunk-EIVICVHM.js";
63
+ import "./chunk-IYES5WOT.js";
64
64
  import {
65
65
  GENERATION_MAX_PROMPT_BYTES,
66
66
  GENERATION_TIMEOUT_MS,
@@ -83,7 +83,7 @@ import {
83
83
  shouldSuppressRememberErrorDetails,
84
84
  workspaceMemoryFailureCode,
85
85
  workspaceMemoryFailureDiagnostics
86
- } from "./chunk-TRLYP7OF.js";
86
+ } from "./chunk-ZPLALRXZ.js";
87
87
  import {
88
88
  HistoryReplayer,
89
89
  MessageEmitter,
@@ -93,9 +93,9 @@ import {
93
93
  goalTerminalEventToHistoryItem,
94
94
  recordGoalStatusItem,
95
95
  restoreGoalFromHistory
96
- } from "./chunk-6XJMFJ4D.js";
96
+ } from "./chunk-2M4K4KYS.js";
97
97
  import "./chunk-OWMAZHIX.js";
98
- import "./chunk-KXSDEOFU.js";
98
+ import "./chunk-4ALIARFY.js";
99
99
  import "./chunk-4NFY2S7N.js";
100
100
  import "./chunk-2MIN6GRR.js";
101
101
  import "./chunk-QHTIBUWB.js";
@@ -113,7 +113,7 @@ import {
113
113
  parseAcpModelOption,
114
114
  resolveAcpModelOption,
115
115
  sanitizeProviderBaseUrl
116
- } from "./chunk-CSZEXZBE.js";
116
+ } from "./chunk-GBDINRIL.js";
117
117
  import {
118
118
  mapSkillConfigToStatus
119
119
  } from "./chunk-BGXZBI5B.js";
@@ -123,38 +123,38 @@ import {
123
123
  buildPermissionSettings,
124
124
  normalizePermissionRules,
125
125
  readPermissionRuleSet
126
- } from "./chunk-6GONZVLS.js";
126
+ } from "./chunk-KKDVZLGL.js";
127
127
  import {
128
128
  MAX_AUDIO_BYTES,
129
129
  sanitizeVoiceErrorMessage,
130
130
  transcribeVoiceAudio
131
- } from "./chunk-AE77C5ZU.js";
131
+ } from "./chunk-DQSDACD2.js";
132
132
  import {
133
133
  readVoiceModel
134
- } from "./chunk-55LYDVPU.js";
134
+ } from "./chunk-C5VWPTGT.js";
135
135
  import "./chunk-AOHJKPKL.js";
136
136
  import {
137
137
  resolveSkillSettings
138
138
  } from "./chunk-Z4X5MTRT.js";
139
- import "./chunk-EUQTXRKZ.js";
140
- import "./chunk-OHJLEW5J.js";
139
+ import "./chunk-E4ZBKMSF.js";
140
+ import "./chunk-QQWD7LZV.js";
141
141
  import "./chunk-57OAHC2Y.js";
142
142
  import {
143
143
  createLoadedSettingsAdapter
144
- } from "./chunk-5KH532V7.js";
144
+ } from "./chunk-WV5J6Q6N.js";
145
145
  import "./chunk-VXZBKKQR.js";
146
- import "./chunk-SPMY6CX6.js";
146
+ import "./chunk-3SE7J4DR.js";
147
147
  import "./chunk-3SH53ANB.js";
148
148
  import {
149
149
  SESSION_SOURCE_META_KEY,
150
150
  parseSessionSource
151
- } from "./chunk-LA7YLSR6.js";
151
+ } from "./chunk-FYAXKJK7.js";
152
152
  import "./chunk-MZSJ43WV.js";
153
153
  import "./chunk-XCGIMOLN.js";
154
154
  import "./chunk-OCPBI7J5.js";
155
155
  import {
156
156
  ndJsonStream
157
- } from "./chunk-E33LOKRA.js";
157
+ } from "./chunk-RPWVIXDB.js";
158
158
  import {
159
159
  ACP_PREFLIGHT_KINDS,
160
160
  IDLE_HOOK_EVENTS,
@@ -163,11 +163,16 @@ import {
163
163
  STATUS_SCHEMA_VERSION,
164
164
  mapDomainErrorToErrorKind
165
165
  } from "./chunk-NLREQJFK.js";
166
- import "./chunk-ZXU5UHMI.js";
167
- import "./chunk-VWOVHOTT.js";
168
- import "./chunk-IUFV6FYU.js";
166
+ import "./chunk-QXVSWG66.js";
167
+ import "./chunk-KJZ26VBX.js";
168
+ import "./chunk-NGYI5EF5.js";
169
169
  import "./chunk-V6WHFGST.js";
170
170
  import {
171
+ ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
172
+ ACTIVE_WORK_HEARTBEAT_META_KEY,
173
+ ACTIVE_WORK_HEARTBEAT_VERSION,
174
+ ACTIVE_WORK_HOLD_CATEGORIES,
175
+ ACTIVE_WORK_NOTIFICATION_METHOD,
171
176
  CHANNEL_STARTUP_PROFILE_META_KEY,
172
177
  CHANNEL_STARTUP_PROFILE_VERSION,
173
178
  CLIENT_MCP_OVER_WS_CONFIG_FLAG,
@@ -185,8 +190,9 @@ import {
185
190
  TODO_STOP_GUARD_CONTINUATION_CLAIM_METHOD,
186
191
  TODO_STOP_GUARD_QUEUE_RELEASE_METHOD,
187
192
  WORKTREE_MCP_DEFER_META_KEY,
193
+ clampActiveWorkIntervalMs,
188
194
  isValidTrustedModelPrompt
189
- } from "./chunk-R574ATRM.js";
195
+ } from "./chunk-M2PNLYGY.js";
190
196
  import {
191
197
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
192
198
  isNotCurrentlyGeneratingCancelError
@@ -194,7 +200,7 @@ import {
194
200
  import "./chunk-6PLDPT2C.js";
195
201
  import "./chunk-FYJ7W2PI.js";
196
202
  import "./chunk-YP5KH5Y7.js";
197
- import "./chunk-24ER7UV4.js";
203
+ import "./chunk-UFALT4LK.js";
198
204
  import "./chunk-ALMR3E6Q.js";
199
205
  import "./chunk-HIBNSEJE.js";
200
206
  import {
@@ -206,10 +212,10 @@ import {
206
212
  } from "./chunk-BKHCW2BI.js";
207
213
  import "./chunk-M5GB774H.js";
208
214
  import "./chunk-UVX4Y6IN.js";
209
- import "./chunk-WUC6ZFXO.js";
215
+ import "./chunk-ZWBUH5UP.js";
210
216
  import {
211
217
  ACP_EVENT_LOOP_STALL_RESTART_MS
212
- } from "./chunk-DIEFUBV6.js";
218
+ } from "./chunk-DIWZNWZT.js";
213
219
  import {
214
220
  AgentSideConnection,
215
221
  PROTOCOL_VERSION,
@@ -218,7 +224,7 @@ import {
218
224
  import {
219
225
  assembleMcpServers,
220
226
  loadMcpApprovals
221
- } from "./chunk-6HVUFDS2.js";
227
+ } from "./chunk-Y4TETC74.js";
222
228
  import {
223
229
  getOutputLanguageFilePath,
224
230
  getPersistScopeForModelSelection,
@@ -226,7 +232,7 @@ import {
226
232
  resolveOutputLanguageOrPreserveAuto,
227
233
  updateOutputLanguageFile,
228
234
  writeOutputLanguageAndRegisterPath
229
- } from "./chunk-PQBHU2IA.js";
235
+ } from "./chunk-OHKJVAKG.js";
230
236
  import "./chunk-RKUWKYED.js";
231
237
  import "./chunk-GOXKNSDZ.js";
232
238
  import "./chunk-IDS7MSUP.js";
@@ -234,20 +240,20 @@ import {
234
240
  SUPPORTED_LANGUAGES,
235
241
  getCurrentLanguage,
236
242
  setLanguageAsync
237
- } from "./chunk-DBOFL3LQ.js";
243
+ } from "./chunk-PG62DFWD.js";
238
244
  import {
239
245
  reloadEnvironment
240
- } from "./chunk-VOARQPTA.js";
241
- import "./chunk-6PEXNQTX.js";
242
- import "./chunk-HYRDKNUY.js";
243
- import "./chunk-FZBZSYKU.js";
246
+ } from "./chunk-B52AWKBB.js";
247
+ import "./chunk-UA5H3DS2.js";
248
+ import "./chunk-IUQ52YJK.js";
249
+ import "./chunk-FN6YXJOP.js";
244
250
  import "./chunk-VJNBRRZG.js";
245
251
  import {
246
252
  isFolderTrustEnabled,
247
253
  isWorkspaceTrusted,
248
254
  loadTrustedFolders
249
- } from "./chunk-6XU3PH66.js";
250
- import "./chunk-ALGGS7UH.js";
255
+ } from "./chunk-HA3SAB64.js";
256
+ import "./chunk-NPQ5ZKRP.js";
251
257
  import "./chunk-MR3PXB6E.js";
252
258
  import "./chunk-XFSFZCM5.js";
253
259
  import {
@@ -255,6 +261,7 @@ import {
255
261
  APPROVAL_MODE_INFO,
256
262
  BTW_MAX_INPUT_LENGTH,
257
263
  ExtensionManager,
264
+ GLOBAL_DUPLICATE_THRESHOLD,
258
265
  IMAGE_CAPABILITY,
259
266
  InvalidMcpConfigError,
260
267
  InvalidSessionTranscriptCursorError,
@@ -308,12 +315,14 @@ import {
308
315
  dedupeToolCallsById,
309
316
  detectAutonomousSentinel,
310
317
  detectLoopSentinel,
318
+ didWriteProjectContextFile,
311
319
  encodeSessionTranscriptCursor,
312
320
  evaluateAutoMode,
313
321
  evaluatePermissionFlow,
314
322
  evaluatePlanModeShellPolicy,
315
323
  evaluateToolInvocationGuard,
316
324
  finalizeToolResponses,
325
+ findBoundaryAtOrBefore,
317
326
  findExistingProviderModels,
318
327
  findPlanModeEntryBatchBoundaryIndex,
319
328
  findProviderById,
@@ -339,11 +348,13 @@ import {
339
348
  getProviderToolCallId,
340
349
  getScopedEnvContents,
341
350
  getStopHookContinuationReason,
351
+ getToolCallRepeatKey,
342
352
  injectPermissionRulesIfMissing,
343
353
  isApproveOutcome,
344
354
  isDenialFallbackReason,
345
355
  isGatedMcpScope,
346
356
  isPlanModeBlocked,
357
+ isReplayTurnStartType,
347
358
  markDuplicateProviderToolCallResponseSent,
348
359
  matchesAnyServerPattern,
349
360
  mcpServerRequiresOAuth,
@@ -368,32 +379,32 @@ import {
368
379
  shouldFallback,
369
380
  shouldFirePermissionDeniedForAutoMode,
370
381
  shouldForceAutoModeReviewForAllow,
382
+ shouldHaltOnTurnToolCallCap,
371
383
  shouldRunAutoModeForCall,
372
384
  subagentGenerator,
373
385
  unregisterGoalHook,
374
386
  updateSetting,
375
387
  validatePlanModeShellApproval,
376
- validatePlanModeShellContext,
377
- wrapUserPromptSubmitContext
378
- } from "./chunk-Y7E5LNLO.js";
388
+ validatePlanModeShellContext
389
+ } from "./chunk-GXSNGY5M.js";
379
390
  import "./chunk-GOFAQQZA.js";
380
391
  import "./chunk-5M6IDOMF.js";
381
392
  import "./chunk-TWPJO254.js";
382
393
  import {
383
394
  external_exports
384
395
  } from "./chunk-H6XPXXMH.js";
385
- import "./chunk-CNIID3TV.js";
396
+ import "./chunk-2UUMVNYT.js";
386
397
  import "./chunk-MVUQRLOH.js";
387
398
  import "./chunk-XCWO3SMQ.js";
388
399
  import "./chunk-7MH4J33A.js";
389
400
  import {
390
401
  parsePositiveIntegerEnv
391
402
  } from "./chunk-6PVPNMXU.js";
392
- import "./chunk-RMH5OWLD.js";
403
+ import "./chunk-VXZ5HAOV.js";
393
404
  import "./chunk-IRH27ZC2.js";
394
405
  import "./chunk-QHWCP53L.js";
395
406
  import "./chunk-GNPNYXJB.js";
396
- import "./chunk-Y4NGLFGJ.js";
407
+ import "./chunk-HUWENAHO.js";
397
408
  import {
398
409
  promptIdContext,
399
410
  todoWorkChainContext
@@ -408,48 +419,53 @@ import {
408
419
  createHookOutput
409
420
  } from "./chunk-GM463R2B.js";
410
421
  import "./chunk-SEZ556DZ.js";
411
- import "./chunk-CJXIIILK.js";
412
- import "./chunk-3K7FH2KQ.js";
422
+ import "./chunk-2FRY5CRX.js";
423
+ import {
424
+ wrapUserPromptSubmitContext
425
+ } from "./chunk-67N6HB5H.js";
426
+ import {
427
+ APPROVAL_MODES
428
+ } from "./chunk-WAUGQKUU.js";
429
+ import "./chunk-PLFATELK.js";
430
+ import {
431
+ addToolArgumentsAttributes,
432
+ addToolCallResultAttributes,
433
+ extractDaemonTraceContext,
434
+ registerAcpEventLoopLagGauge,
435
+ startEventLoopLagMonitor,
436
+ withDaemonSpan
437
+ } from "./chunk-L4N6TIP7.js";
438
+ import "./chunk-SAH4BD2J.js";
413
439
  import {
414
- APPROVAL_MODES,
415
440
  runWithRuntimeContentGenerator
416
- } from "./chunk-BVWVWGLE.js";
441
+ } from "./chunk-CPG6P4GG.js";
417
442
  import "./chunk-S6LOFUVP.js";
443
+ import "./chunk-2J3OJGTL.js";
418
444
  import {
419
445
  FORK_SUBAGENT_TYPE,
420
446
  getStartupContextLength,
421
447
  isSystemReminderContent
422
- } from "./chunk-LZC3B5N2.js";
448
+ } from "./chunk-IA7TGCN2.js";
423
449
  import "./chunk-K623ENWT.js";
424
450
  import "./chunk-AQ37AY7B.js";
425
451
  import "./chunk-EQL65XGA.js";
426
- import "./chunk-IIJEYBNH.js";
427
452
  import {
428
453
  clearCachedCredentialFile,
429
454
  qwenOAuth2Events
430
- } from "./chunk-22NBYCPD.js";
455
+ } from "./chunk-3P2LV43B.js";
431
456
  import "./chunk-NAVJD2PQ.js";
432
- import "./chunk-3ULCB3NE.js";
433
- import "./chunk-BGG4MBYD.js";
457
+ import "./chunk-HV76SFIA.js";
458
+ import "./chunk-4PYCZH2V.js";
459
+ import "./chunk-P3QQPMQA.js";
460
+ import "./chunk-SR7RZ4MS.js";
461
+ import "./chunk-M6HMMKVG.js";
434
462
  import "./chunk-DGEIYUC3.js";
435
463
  import "./chunk-MPHPFVKK.js";
436
464
  import "./chunk-AXMWHKXA.js";
437
- import "./chunk-DJ2GSRLV.js";
438
- import "./chunk-33ACCIIY.js";
439
- import {
440
- addToolArgumentsAttributes,
441
- addToolCallResultAttributes,
442
- extractDaemonTraceContext,
443
- registerAcpEventLoopLagGauge,
444
- startEventLoopLagMonitor,
445
- withDaemonSpan
446
- } from "./chunk-L4N6TIP7.js";
447
- import "./chunk-2J3OJGTL.js";
448
- import "./chunk-P3QQPMQA.js";
449
- import "./chunk-M6HMMKVG.js";
450
465
  import {
451
466
  getToolCallPreparations
452
467
  } from "./chunk-GLCZKT5V.js";
468
+ import "./chunk-DJ2GSRLV.js";
453
469
  import "./chunk-EI3HZX6C.js";
454
470
  import {
455
471
  ConversationFinishedEvent,
@@ -475,31 +491,35 @@ import {
475
491
  logUserPrompt,
476
492
  normalizeParts,
477
493
  parseInvocationContext,
478
- runSideQuery,
479
494
  runVisionBridge,
480
495
  runWithInvocationContext,
481
496
  shouldRunVisionBridge,
482
497
  splitImageParts,
483
498
  uiTelemetryService
484
- } from "./chunk-2U3WZGZG.js";
499
+ } from "./chunk-3PY4LPJF.js";
485
500
  import "./chunk-WOJZWRAZ.js";
486
501
  import "./chunk-VGC4I5JJ.js";
487
502
  import {
488
503
  getAutoMemoryRoot,
489
504
  getUserAutoMemoryRoot
490
505
  } from "./chunk-FVKHVJZQ.js";
491
- import "./chunk-NG2R4N5O.js";
506
+ import {
507
+ runSideQuery
508
+ } from "./chunk-COBO5EBO.js";
509
+ import "./chunk-6ZRFAKXK.js";
492
510
  import {
493
511
  BaseDeclarativeTool,
494
512
  BaseToolInvocation,
495
513
  ToolConfirmationOutcome,
496
514
  ToolNames,
515
+ canonicalToolName,
497
516
  isShellProgressData
498
- } from "./chunk-IC4Z6LX6.js";
517
+ } from "./chunk-PYQADEFD.js";
499
518
  import {
500
519
  AuthType,
501
520
  preloadContentGenerator
502
- } from "./chunk-6EOI4HOK.js";
521
+ } from "./chunk-M3STHEMM.js";
522
+ import "./chunk-F6WFNA7U.js";
503
523
  import "./chunk-46UV252V.js";
504
524
  import {
505
525
  DEFAULT_TOKEN_LIMIT,
@@ -527,10 +547,10 @@ import {
527
547
  isSubpath
528
548
  } from "./chunk-OIVKILPI.js";
529
549
  import "./chunk-VOQXFAY5.js";
530
- import "./chunk-PJOBIWUG.js";
550
+ import "./chunk-BF52U4XJ.js";
531
551
  import {
532
552
  runExitCleanup
533
- } from "./chunk-EORNAQDT.js";
553
+ } from "./chunk-6TR7CFXH.js";
534
554
  import {
535
555
  writeStderrLine,
536
556
  writeStderrLineSafe
@@ -2361,6 +2381,8 @@ function createDaemonToolLoopState() {
2361
2381
  return {
2362
2382
  totalToolCalls: 0,
2363
2383
  invalidToolParamErrors: /* @__PURE__ */ new Map(),
2384
+ toolCallKeyCounts: /* @__PURE__ */ new Map(),
2385
+ maxToolCallKeyRepeat: 0,
2364
2386
  loopDetected: false
2365
2387
  };
2366
2388
  }
@@ -2381,18 +2403,42 @@ function recordDaemonLoopDetected(config, promptId, loopType, message, loopState
2381
2403
  return true;
2382
2404
  }
2383
2405
  __name(recordDaemonLoopDetected, "recordDaemonLoopDetected");
2384
- function recordDaemonToolCalls(config, promptId, loopState, count) {
2406
+ function recordDaemonToolCalls(config, promptId, loopState, calls) {
2385
2407
  if (!loopState || loopState.loopDetected)
2386
2408
  return loopState?.loopDetected ?? false;
2387
- loopState.totalToolCalls += count;
2388
- if (loopState.totalToolCalls <= config.getMaxToolCallsPerTurn()) return false;
2389
- return recordDaemonLoopDetected(
2390
- config,
2391
- promptId,
2392
- "turn_tool_call_cap" /* TURN_TOOL_CALL_CAP */,
2393
- `Stopping ACP turn after ${loopState.totalToolCalls} tool calls in one turn.`,
2394
- loopState
2395
- );
2409
+ loopState.totalToolCalls += calls.length;
2410
+ for (const call of calls) {
2411
+ const key = getToolCallRepeatKey(call.name ?? "", call.args ?? {});
2412
+ const count = (loopState.toolCallKeyCounts.get(key) ?? 0) + 1;
2413
+ loopState.toolCallKeyCounts.set(key, count);
2414
+ if (count > loopState.maxToolCallKeyRepeat) {
2415
+ loopState.maxToolCallKeyRepeat = count;
2416
+ }
2417
+ }
2418
+ if (shouldHaltOnTurnToolCallCap(
2419
+ loopState.totalToolCalls,
2420
+ loopState.maxToolCallKeyRepeat,
2421
+ config.getMaxToolCallsPerTurn(),
2422
+ config.isMaxToolCallsPerTurnExplicit()
2423
+ )) {
2424
+ return recordDaemonLoopDetected(
2425
+ config,
2426
+ promptId,
2427
+ "turn_tool_call_cap" /* TURN_TOOL_CALL_CAP */,
2428
+ `Stopping ACP turn after ${loopState.totalToolCalls} tool calls in one turn.`,
2429
+ loopState
2430
+ );
2431
+ }
2432
+ if (!config.getSkipLoopDetection() && loopState.maxToolCallKeyRepeat >= GLOBAL_DUPLICATE_THRESHOLD) {
2433
+ return recordDaemonLoopDetected(
2434
+ config,
2435
+ promptId,
2436
+ "global_tool_call_duplicate" /* GLOBAL_TOOL_CALL_DUPLICATE */,
2437
+ `Stopping ACP turn after the same tool call repeated ${loopState.maxToolCallKeyRepeat} times.`,
2438
+ loopState
2439
+ );
2440
+ }
2441
+ return false;
2396
2442
  }
2397
2443
  __name(recordDaemonToolCalls, "recordDaemonToolCalls");
2398
2444
  function recordDaemonInvalidToolParams(config, promptId, loopState, toolName, error) {
@@ -2869,10 +2915,11 @@ async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.
2869
2915
  }
2870
2916
  __name(buildAvailableCommandsSnapshot, "buildAvailableCommandsSnapshot");
2871
2917
  var Session = class {
2872
- constructor(id, config, client, settings) {
2918
+ constructor(id, config, client, settings, onActiveWorkChanged) {
2873
2919
  this.config = config;
2874
2920
  this.client = client;
2875
2921
  this.settings = settings;
2922
+ this.onActiveWorkChanged = onActiveWorkChanged;
2876
2923
  this.sessionId = id;
2877
2924
  this.runtimeBaseDir = config.storage.getRuntimeBaseDir();
2878
2925
  const todoStopGuardEnabled = this.settings.merged.experimental?.todoStopGuard === true && !this.config.getBareMode() && !this.config.isSafeMode();
@@ -2912,6 +2959,7 @@ var Session = class {
2912
2959
  */
2913
2960
  followupAbort = null;
2914
2961
  turn = 0;
2962
+ refreshContextFilesOnWrite = false;
2915
2963
  activeTodoWorkChainPromptId;
2916
2964
  createdAt = Date.now();
2917
2965
  /**
@@ -2966,8 +3014,10 @@ var Session = class {
2966
3014
  notificationProcessing = false;
2967
3015
  notificationAbortController = null;
2968
3016
  notificationCompletion = null;
3017
+ currentAgentNotificationTaskId = null;
2969
3018
  persistedBackgroundNotificationTaskIds = /* @__PURE__ */ new Set();
2970
3019
  backgroundNotificationAcceptances = /* @__PURE__ */ new Map();
3020
+ activeAgentNotificationAcceptances = /* @__PURE__ */ new Set();
2971
3021
  // Set true in dispose(). Guards #drainCronQueue and #drainNotificationQueue
2972
3022
  // against the race where #drainNotificationQueue's finally block kicks off
2973
3023
  // #drainCronQueue after the session has already been disposed (e.g. /clear
@@ -2978,6 +3028,9 @@ var Session = class {
2978
3028
  closeGateCompletion = null;
2979
3029
  resolveCloseGate = null;
2980
3030
  unsubscribeChatRecordingFailure;
3031
+ /** The exact status-change callback this Session installed, so dispose can
3032
+ * retract its own and nobody else's. */
3033
+ #statusChangeCallback;
2981
3034
  workflowApprovalAbortController = new AbortController();
2982
3035
  activeTodoPlanRevision;
2983
3036
  // Modular components
@@ -3615,7 +3668,51 @@ var Session = class {
3615
3668
  }
3616
3669
  }
3617
3670
  isIdle() {
3618
- return !this.closing && !this.#hasActiveTurn();
3671
+ return !this.closing && !this.#hasActiveTurn() && this.collectActiveWorkHolds().length === 0;
3672
+ }
3673
+ /**
3674
+ * The Session's current active-work holds, derived on every call.
3675
+ *
3676
+ * Nothing here is bookkeeping kept in parallel with the real work: agent
3677
+ * holds come straight out of the registry's unfinalized set, notification
3678
+ * holds out of the queue and the in-flight acceptance/continuation state.
3679
+ * A hold therefore cannot leak past the work it names, and the daemon's
3680
+ * cached copy converges on whatever these owners actually say.
3681
+ *
3682
+ * `hasUnfinalizedTasks()`'s predicate — not `hasRunningTasks()`' — backs the
3683
+ * agent category on purpose: an agent that has been cancelled still owes its
3684
+ * terminal task-notification, and treating it as finished would let the
3685
+ * daemon reap the Session inside the cancel → finalizeCancelled() window and
3686
+ * strand that notification.
3687
+ *
3688
+ * Prompts are absent by design. The daemon accepts, queues, dispatches, and
3689
+ * settles them itself, so its own count is both authoritative and strictly
3690
+ * wider than anything reported from here (it covers prompts still waiting in
3691
+ * the FIFO, which the child cannot see).
3692
+ */
3693
+ collectActiveWorkHolds() {
3694
+ if (this.disposed) return [];
3695
+ const holds = [];
3696
+ for (const agentId of this.config.getBackgroundTaskRegistry().listUnfinalizedBackgroundAgentIds()) {
3697
+ holds.push({ category: "agent", id: agentId });
3698
+ }
3699
+ const notificationIds = /* @__PURE__ */ new Set();
3700
+ for (const item of this.notificationQueue) {
3701
+ if (item.kind === "agent") notificationIds.add(item.taskId);
3702
+ }
3703
+ for (const taskId of this.activeAgentNotificationAcceptances) {
3704
+ notificationIds.add(taskId);
3705
+ }
3706
+ if (this.currentAgentNotificationTaskId !== null) {
3707
+ notificationIds.add(this.currentAgentNotificationTaskId);
3708
+ }
3709
+ for (const taskId of notificationIds) {
3710
+ holds.push({ category: "notification", id: taskId });
3711
+ }
3712
+ return holds;
3713
+ }
3714
+ #activeWorkChanged() {
3715
+ this.onActiveWorkChanged?.();
3619
3716
  }
3620
3717
  #hasActiveTurn() {
3621
3718
  return Boolean(
@@ -3725,6 +3822,10 @@ var Session = class {
3725
3822
  }
3726
3823
  this.config.getBackgroundTaskRegistry().abortAll({ notify: false });
3727
3824
  this.config.getBackgroundTaskRegistry().setNotificationCallback(void 0);
3825
+ if (this.#statusChangeCallback) {
3826
+ this.config.getBackgroundTaskRegistry().clearStatusChangeCallback(this.#statusChangeCallback);
3827
+ this.#statusChangeCallback = void 0;
3828
+ }
3728
3829
  this.config.getMonitorRegistry().setNotificationCallback(void 0);
3729
3830
  this.config.getBackgroundShellRegistry().setNotificationCallback(void 0);
3730
3831
  this.config.getChatRecordingService()?.setTitleRecordedCallback(void 0);
@@ -3949,6 +4050,7 @@ var Session = class {
3949
4050
  }
3950
4051
  this.notificationQueue = [];
3951
4052
  this.notificationProcessing = false;
4053
+ this.#activeWorkChanged();
3952
4054
  const scheduler = this.config.isCronEnabled() ? this.config.getCronScheduler() : null;
3953
4055
  if (scheduler) {
3954
4056
  const summary = scheduler.getExitSummary();
@@ -4318,6 +4420,9 @@ var Session = class {
4318
4420
  );
4319
4421
  const inputText = firstTextBlock?.text || "";
4320
4422
  const isSlashInput = !isContinue && isSlashCommand(inputText);
4423
+ if (!isSlashInput && !isContinue && !isRetry) {
4424
+ this.refreshContextFilesOnWrite = false;
4425
+ }
4321
4426
  let parts;
4322
4427
  let fullTurnModelOverride;
4323
4428
  const onFullTurnModel = /* @__PURE__ */ __name((model) => {
@@ -6415,6 +6520,10 @@ ${this.pendingRecoveredAgentsNotice}
6415
6520
  }
6416
6521
  #registerBackgroundNotificationCallbacks() {
6417
6522
  const backgroundRegistry = this.config.getBackgroundTaskRegistry();
6523
+ this.#statusChangeCallback = () => {
6524
+ this.#activeWorkChanged();
6525
+ };
6526
+ backgroundRegistry.setStatusChangeCallback(this.#statusChangeCallback);
6418
6527
  backgroundRegistry.setNotificationCallback(
6419
6528
  (displayText, modelText, meta) => {
6420
6529
  this.#enqueueBackgroundNotification({
@@ -6509,6 +6618,7 @@ ${this.pendingRecoveredAgentsNotice}
6509
6618
  );
6510
6619
  }
6511
6620
  this.notificationQueue.push(item);
6621
+ this.#activeWorkChanged();
6512
6622
  void this.#drainNotificationQueue();
6513
6623
  }
6514
6624
  async enqueueBackgroundNotification(item) {
@@ -6519,11 +6629,19 @@ ${this.pendingRecoveredAgentsNotice}
6519
6629
  if (existing) return { accepted: await existing };
6520
6630
  const acceptance = this.#persistDaemonBackgroundNotification(item);
6521
6631
  this.backgroundNotificationAcceptances.set(item.taskId, acceptance);
6632
+ if (item.kind === "agent") {
6633
+ this.activeAgentNotificationAcceptances.add(item.taskId);
6634
+ this.#activeWorkChanged();
6635
+ }
6522
6636
  try {
6523
6637
  return { accepted: await acceptance };
6524
6638
  } finally {
6525
6639
  if (this.backgroundNotificationAcceptances.get(item.taskId) === acceptance) {
6526
6640
  this.backgroundNotificationAcceptances.delete(item.taskId);
6641
+ if (item.kind === "agent") {
6642
+ this.activeAgentNotificationAcceptances.delete(item.taskId);
6643
+ this.#activeWorkChanged();
6644
+ }
6527
6645
  }
6528
6646
  }
6529
6647
  }
@@ -6594,18 +6712,26 @@ ${this.pendingRecoveredAgentsNotice}
6594
6712
  if (nextIndex < 0) break;
6595
6713
  const [item] = this.notificationQueue.splice(nextIndex, 1);
6596
6714
  if (!item) break;
6597
- await runWithInvocationContext(
6598
- void 0,
6599
- () => sessionIdContext.run(
6600
- this.config.getSessionId(),
6601
- () => this.#executeBackgroundNotificationPromptInner(item)
6602
- )
6603
- );
6715
+ this.currentAgentNotificationTaskId = item.kind === "agent" ? item.taskId : null;
6716
+ this.#activeWorkChanged();
6717
+ try {
6718
+ await runWithInvocationContext(
6719
+ void 0,
6720
+ () => sessionIdContext.run(
6721
+ this.config.getSessionId(),
6722
+ () => this.#executeBackgroundNotificationPromptInner(item)
6723
+ )
6724
+ );
6725
+ } finally {
6726
+ this.currentAgentNotificationTaskId = null;
6727
+ this.#activeWorkChanged();
6728
+ }
6604
6729
  }
6605
6730
  } finally {
6606
6731
  this.notificationProcessing = false;
6607
6732
  resolveCompletion();
6608
6733
  this.notificationCompletion = null;
6734
+ this.#activeWorkChanged();
6609
6735
  void this.#drainCronQueue();
6610
6736
  if (this.notificationQueue.length > 0 && !this.pendingPrompt && !this.cronProcessing && !this.cronAbortController) {
6611
6737
  void this.#drainNotificationQueue();
@@ -7228,27 +7354,6 @@ ${this.pendingRecoveredAgentsNotice}
7228
7354
  }
7229
7355
  return part;
7230
7356
  }, "recordSkippedToolCall");
7231
- if (recordDaemonToolCalls(
7232
- this.config,
7233
- promptId,
7234
- toolLoopState,
7235
- dedupedFunctionCalls.length
7236
- )) {
7237
- return await finalizeRunToolResult({
7238
- parts: await Promise.all(
7239
- dedupedFunctionCalls.map(
7240
- (fc) => recordSkippedToolCall(
7241
- fc,
7242
- LOOP_DETECTED_SKIP_MESSAGE,
7243
- false,
7244
- "unknown" /* UNKNOWN */
7245
- )
7246
- )
7247
- ),
7248
- stopAfterPermissionCancel: false,
7249
- loopDetected: true
7250
- });
7251
- }
7252
7357
  const batches = [];
7253
7358
  const handledProviderToolCallIds = new Set(
7254
7359
  this.#getCurrentChat().getHistoryFunctionResponseIds()
@@ -7358,7 +7463,7 @@ ${this.pendingRecoveredAgentsNotice}
7358
7463
  }
7359
7464
  handledProviderToolCallIds.add(providerCallId);
7360
7465
  }
7361
- const isAgent = fc.name === ToolNames.AGENT;
7466
+ const isAgent = canonicalToolName(fc.name ?? "") === ToolNames.AGENT;
7362
7467
  const last = batches[batches.length - 1];
7363
7468
  if (isAgent && last?.kind === "execute" && last.concurrent) {
7364
7469
  last.calls.push(fc);
@@ -7369,6 +7474,27 @@ ${this.pendingRecoveredAgentsNotice}
7369
7474
  const executableCalls = batches.flatMap(
7370
7475
  (batch) => batch.kind === "execute" ? batch.calls : []
7371
7476
  );
7477
+ if (recordDaemonToolCalls(
7478
+ this.config,
7479
+ promptId,
7480
+ toolLoopState,
7481
+ executableCalls
7482
+ )) {
7483
+ return await finalizeRunToolResult({
7484
+ parts: await Promise.all(
7485
+ dedupedFunctionCalls.map(
7486
+ (fc) => recordSkippedToolCall(
7487
+ fc,
7488
+ LOOP_DETECTED_SKIP_MESSAGE,
7489
+ false,
7490
+ "unknown" /* UNKNOWN */
7491
+ )
7492
+ )
7493
+ ),
7494
+ stopAfterPermissionCancel: false,
7495
+ loopDetected: true
7496
+ });
7497
+ }
7372
7498
  const planModeEntryBoundaryIndex = findPlanModeEntryBatchBoundaryIndex(
7373
7499
  executableCalls.map((call) => call.name)
7374
7500
  );
@@ -7391,20 +7517,35 @@ ${this.pendingRecoveredAgentsNotice}
7391
7517
  await refreshMemoryAfterManagedWrite(this.config, memoryWriteCandidates, {
7392
7518
  logContext: `ACP session ${this.sessionId} memory tool batch`
7393
7519
  });
7520
+ if (!this.refreshContextFilesOnWrite) {
7521
+ return;
7522
+ }
7523
+ const matchedContextFileWrite = didWriteProjectContextFile(
7524
+ memoryWriteCandidates,
7525
+ this.config.getProjectRoot()
7526
+ );
7527
+ debugLogger5.debug(
7528
+ `ACP session ${this.sessionId} checked marked context-file memory tool batch; matched=${matchedContextFileWrite}`
7529
+ );
7530
+ if (!matchedContextFileWrite) {
7531
+ return;
7532
+ }
7533
+ debugLogger5.debug(
7534
+ `ACP session ${this.sessionId} refreshing memory after context-file memory write`
7535
+ );
7536
+ await refreshMemoryInstruction(this.config, {
7537
+ logContext: `ACP session ${this.sessionId} context-file memory tool batch`
7538
+ });
7394
7539
  }, "refreshMemoryIfNeeded");
7395
- const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, onStopAfterLoopDetected, shouldSkipUnstarted) => {
7396
- const configuredMaxConcurrency = parsePositiveIntegerEnv(
7540
+ const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, shouldSkipUnstarted) => {
7541
+ const maxConcurrency = parsePositiveIntegerEnv(
7397
7542
  process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"],
7398
7543
  10
7399
7544
  );
7400
- const maxConcurrency = toolLoopState ? Math.min(
7401
- configuredMaxConcurrency,
7402
- DAEMON_INVALID_TOOL_PARAMS_THRESHOLD
7403
- ) : configuredMaxConcurrency;
7404
7545
  const results = new Array(calls.length);
7405
7546
  const executing = /* @__PURE__ */ new Set();
7406
- const fillLoopSkippedFrom = /* @__PURE__ */ __name(async (startIndex2) => {
7407
- for (let i = startIndex2; i < calls.length; i++) {
7547
+ const fillLoopSkippedFrom = /* @__PURE__ */ __name(async (startIndex) => {
7548
+ for (let i = startIndex; i < calls.length; i++) {
7408
7549
  if (results[i]) continue;
7409
7550
  results[i] = {
7410
7551
  parts: [
@@ -7420,49 +7561,8 @@ ${this.pendingRecoveredAgentsNotice}
7420
7561
  };
7421
7562
  }
7422
7563
  }, "fillLoopSkippedFrom");
7423
- const fillPermissionSkippedFrom = /* @__PURE__ */ __name(async (startIndex2) => {
7424
- for (let i = startIndex2; i < calls.length; i++) {
7425
- if (results[i]) continue;
7426
- results[i] = {
7427
- parts: [await recordSkippedToolCall(calls[i])],
7428
- stopAfterPermissionCancel: false
7429
- };
7430
- }
7431
- }, "fillPermissionSkippedFrom");
7432
- let startIndex = 0;
7433
- if (toolLoopState && calls.length > DAEMON_INVALID_TOOL_PARAMS_THRESHOLD) {
7434
- startIndex = DAEMON_INVALID_TOOL_PARAMS_THRESHOLD;
7435
- for (let i = 0; i < startIndex; i++) {
7436
- if (runAbortSignal.aborted && shouldSkipUnstarted?.()) {
7437
- results[i] = {
7438
- parts: [await recordSkippedToolCall(calls[i])],
7439
- stopAfterPermissionCancel: false
7440
- };
7441
- continue;
7442
- }
7443
- const r = await this.runTool(
7444
- runAbortSignal,
7445
- promptId,
7446
- calls[i],
7447
- onStopAfterPermissionCancel,
7448
- toolLoopState,
7449
- recordSkippedToolCall,
7450
- queueToolResultRecord,
7451
- executionCallIds.get(calls[i]),
7452
- onFullTurnModel
7453
- );
7454
- results[i] = r;
7455
- if (r.loopDetected) {
7456
- await fillLoopSkippedFrom(i + 1);
7457
- return results;
7458
- }
7459
- if (r.stopAfterPermissionCancel) {
7460
- await fillPermissionSkippedFrom(i + 1);
7461
- return results;
7462
- }
7463
- }
7464
- }
7465
- for (let i = startIndex; i < calls.length; i++) {
7564
+ let warnedWaitingForInFlight = false;
7565
+ for (let i = 0; i < calls.length; i++) {
7466
7566
  const idx = i;
7467
7567
  if (toolLoopState?.loopDetected) {
7468
7568
  await fillLoopSkippedFrom(idx);
@@ -7487,6 +7587,12 @@ ${this.pendingRecoveredAgentsNotice}
7487
7587
  onFullTurnModel
7488
7588
  ).then((r) => {
7489
7589
  results[idx] = r;
7590
+ if (r.loopDetected && executing.size > 1 && !warnedWaitingForInFlight) {
7591
+ warnedWaitingForInFlight = true;
7592
+ debugLogger5.warn(
7593
+ `Loop detection stopped this ACP turn; waiting for ${executing.size - 1} in-flight tool call(s) to settle before returning.`
7594
+ );
7595
+ }
7490
7596
  }).finally(() => {
7491
7597
  executing.delete(p);
7492
7598
  });
@@ -7494,7 +7600,6 @@ ${this.pendingRecoveredAgentsNotice}
7494
7600
  if (executing.size >= maxConcurrency) {
7495
7601
  await Promise.race(executing);
7496
7602
  if (results.some((result) => result?.loopDetected)) {
7497
- onStopAfterLoopDetected?.();
7498
7603
  await Promise.all(executing);
7499
7604
  await fillLoopSkippedFrom(idx + 1);
7500
7605
  return results;
@@ -7505,7 +7610,6 @@ ${this.pendingRecoveredAgentsNotice}
7505
7610
  if (invalidToolErrorNearThreshold && executing.size > 0) {
7506
7611
  await Promise.all(executing);
7507
7612
  if (results.some((result) => result?.loopDetected)) {
7508
- onStopAfterLoopDetected?.();
7509
7613
  await fillLoopSkippedFrom(idx + 1);
7510
7614
  return results;
7511
7615
  }
@@ -7559,7 +7663,6 @@ ${this.pendingRecoveredAgentsNotice}
7559
7663
  batch.calls,
7560
7664
  batchAbortController.signal,
7561
7665
  stopBatchAfterPermissionCancel,
7562
- () => batchAbortController.abort("loop_detected"),
7563
7666
  () => batchStopAfterPermissionCancel
7564
7667
  );
7565
7668
  } finally {
@@ -9122,6 +9225,7 @@ ${this.pendingRecoveredAgentsNotice}
9122
9225
  */
9123
9226
  async #processSlashCommandResult(result, originalPrompt, abortSignal, onFullTurnModel) {
9124
9227
  this.#emitGoalStatusItems(result);
9228
+ this.refreshContextFilesOnWrite = result.type === "submit_prompt" && Boolean(result.refreshContextFilesOnWrite);
9125
9229
  switch (result.type) {
9126
9230
  case "submit_prompt":
9127
9231
  return this.#applyBridgeConversionsIfNeeded(
@@ -9628,6 +9732,98 @@ ${contextPart.text}`
9628
9732
  }
9629
9733
  };
9630
9734
 
9735
+ // packages/cli/src/acp-integration/active-work-reporter.ts
9736
+ init_esbuild_shims();
9737
+ var debugLogger6 = createDebugLogger("ACTIVE_WORK");
9738
+ var ActiveWorkReporter = class {
9739
+ constructor(send, listSources, intervalMs) {
9740
+ this.send = send;
9741
+ this.listSources = listSources;
9742
+ this.intervalMs = intervalMs;
9743
+ this.#timer = setInterval(() => {
9744
+ this.#publish();
9745
+ }, intervalMs);
9746
+ this.#timer.unref?.();
9747
+ this.#publish();
9748
+ }
9749
+ static {
9750
+ __name(this, "ActiveWorkReporter");
9751
+ }
9752
+ #seq = 0;
9753
+ #tail = Promise.resolve();
9754
+ #coalescing = false;
9755
+ #timer;
9756
+ #disposed = false;
9757
+ /**
9758
+ * Note that some Session's derived state may have changed. Coalesced to
9759
+ * one snapshot per microtask so a burst of transitions (an agent finishing
9760
+ * and its terminal notification enqueuing in the same tick) produces a
9761
+ * single message that already reflects the settled state.
9762
+ */
9763
+ notifyChanged() {
9764
+ if (this.#disposed || this.#coalescing) return;
9765
+ this.#coalescing = true;
9766
+ queueMicrotask(() => {
9767
+ if (!this.#coalescing) return;
9768
+ this.#coalescing = false;
9769
+ this.#publish();
9770
+ });
9771
+ }
9772
+ /**
9773
+ * Publish now and resolve once the snapshot has been handed to the
9774
+ * transport.
9775
+ *
9776
+ * Callers use this to order a snapshot ahead of an RPC response on the same
9777
+ * stream. The prompt path needs it: the daemon drops its own
9778
+ * `pendingPromptCount` the moment the prompt response lands, so a hold
9779
+ * taken during that prompt (a background agent it started) has to be on the
9780
+ * wire *first* or the daemon briefly sees neither fact and may reap the
9781
+ * Session.
9782
+ */
9783
+ async flush() {
9784
+ this.#coalescing = false;
9785
+ this.#publish();
9786
+ await this.#tail.catch(() => void 0);
9787
+ }
9788
+ dispose() {
9789
+ this.#disposed = true;
9790
+ this.#coalescing = false;
9791
+ if (this.#timer) {
9792
+ clearInterval(this.#timer);
9793
+ this.#timer = void 0;
9794
+ }
9795
+ }
9796
+ #publish() {
9797
+ if (this.#disposed) return;
9798
+ let sessions;
9799
+ try {
9800
+ sessions = [];
9801
+ for (const source of this.listSources()) {
9802
+ sessions.push({
9803
+ sessionId: source.sessionId,
9804
+ holds: source.collectActiveWorkHolds()
9805
+ });
9806
+ }
9807
+ } catch (error) {
9808
+ debugLogger6.warn(
9809
+ `active-work snapshot collection failed; skipping this report: ${error instanceof Error ? error.message : String(error)}`
9810
+ );
9811
+ return;
9812
+ }
9813
+ const snapshot = {
9814
+ v: ACTIVE_WORK_HEARTBEAT_VERSION,
9815
+ seq: ++this.#seq,
9816
+ sessions
9817
+ };
9818
+ this.#tail = this.#tail.then(
9819
+ () => this.#disposed ? void 0 : this.send(
9820
+ ACTIVE_WORK_NOTIFICATION_METHOD,
9821
+ snapshot
9822
+ )
9823
+ ).catch(() => void 0);
9824
+ }
9825
+ };
9826
+
9631
9827
  // packages/cli/src/acp-integration/session/tasksSnapshot.ts
9632
9828
  init_esbuild_shims();
9633
9829
  function runtimeMs(entry, now) {
@@ -9739,7 +9935,7 @@ function runWithAcpRuntimeOutputDir(settings, cwd, fn) {
9739
9935
  __name(runWithAcpRuntimeOutputDir, "runWithAcpRuntimeOutputDir");
9740
9936
 
9741
9937
  // packages/cli/src/acp-integration/acpAgent.ts
9742
- var debugLogger6 = createDebugLogger("ACP_AGENT");
9938
+ var debugLogger7 = createDebugLogger("ACP_AGENT");
9743
9939
  var QWEN_ACP_LOCAL_READ_ROOTS_ENV = "QWEN_ACP_LOCAL_READ_ROOTS";
9744
9940
  var POSIX_TMP_LOCAL_READ_ROOT = "/tmp";
9745
9941
  var BTW_CHILD_TIMEOUT_MS = 55e3;
@@ -9874,7 +10070,7 @@ async function beginSessionCloseAfterCurrentGate(session, timeoutMs) {
9874
10070
  }
9875
10071
  }
9876
10072
  __name(beginSessionCloseAfterCurrentGate, "beginSessionCloseAfterCurrentGate");
9877
- var logWorkspaceMemoryExtractionError = createWorkspaceMemoryExtractionErrorLogger(debugLogger6);
10073
+ var logWorkspaceMemoryExtractionError = createWorkspaceMemoryExtractionErrorLogger(debugLogger7);
9878
10074
  function parseAcpLocalReadRootsEnv(raw = process.env[QWEN_ACP_LOCAL_READ_ROOTS_ENV]) {
9879
10075
  if (!raw) return [];
9880
10076
  return raw.split(path3.delimiter).map((entry) => entry.trim()).filter((entry) => entry.length > 0 && path3.isAbsolute(entry));
@@ -9996,9 +10192,24 @@ function getLoadReplayPageSize(params) {
9996
10192
  }
9997
10193
  __name(getLoadReplayPageSize, "getLoadReplayPageSize");
9998
10194
  function isHistoryTurnStart(record) {
9999
- return record.type === "user" && record.subtype !== "mid_turn_user_message";
10195
+ return isReplayTurnStartType(record.type, record.subtype);
10000
10196
  }
10001
10197
  __name(isHistoryTurnStart, "isHistoryTurnStart");
10198
+ function isHistoryPageStart(record) {
10199
+ return record.subtype !== "realtime_message" && (record.type === "assistant" || isHistoryTurnStart(record));
10200
+ }
10201
+ __name(isHistoryPageStart, "isHistoryPageStart");
10202
+ function historyOrphansToolResult(records, start, end) {
10203
+ for (let i = start; i < end; i++) {
10204
+ if (records[i].type !== "tool_result") continue;
10205
+ for (let owner = i - 1; owner >= start; owner--) {
10206
+ if (isHistoryPageStart(records[owner])) return false;
10207
+ }
10208
+ return true;
10209
+ }
10210
+ return false;
10211
+ }
10212
+ __name(historyOrphansToolResult, "historyOrphansToolResult");
10002
10213
  function selectRecentHistoryRecords(records, pageSize) {
10003
10214
  if (pageSize === void 0 || records.length <= pageSize) {
10004
10215
  return { records, hasMore: false };
@@ -10010,8 +10221,27 @@ function selectRecentHistoryRecords(records, pageSize) {
10010
10221
  break;
10011
10222
  }
10012
10223
  }
10013
- while (start > 0 && !isHistoryTurnStart(records[start])) {
10014
- start--;
10224
+ const expansionFloor = Math.max(0, records.length - 2 * pageSize);
10225
+ const aligned = findBoundaryAtOrBefore(
10226
+ records,
10227
+ start,
10228
+ expansionFloor,
10229
+ isHistoryTurnStart
10230
+ );
10231
+ if (isHistoryTurnStart(records[aligned])) {
10232
+ start = aligned;
10233
+ }
10234
+ if (start > 0 && historyOrphansToolResult(records, start, records.length)) {
10235
+ const pairFloor = Math.max(0, start - pageSize);
10236
+ const owner = findBoundaryAtOrBefore(
10237
+ records,
10238
+ start,
10239
+ pairFloor,
10240
+ isHistoryPageStart
10241
+ );
10242
+ if (isHistoryPageStart(records[owner])) {
10243
+ start = owner;
10244
+ }
10015
10245
  }
10016
10246
  return { records: records.slice(start), hasMore: start > 0 };
10017
10247
  }
@@ -10673,7 +10903,7 @@ async function downloadGitHubSkillDirectory(githubUrl, directoryPath) {
10673
10903
  githubUrl,
10674
10904
  directoryPath
10675
10905
  ).catch((error) => {
10676
- debugLogger6.warn(
10906
+ debugLogger7.warn(
10677
10907
  "GitHub API directory listing failed, falling back to archive download:",
10678
10908
  error
10679
10909
  );
@@ -11239,7 +11469,7 @@ function readMcpServers(source, scope) {
11239
11469
  const server = toMcpServerConfig(value);
11240
11470
  return server ? { name, scope, server: redactMcpServerSecrets(server) } : void 0;
11241
11471
  } catch (error) {
11242
- debugLogger6.warn(
11472
+ debugLogger7.warn(
11243
11473
  `Skipping malformed MCP server config [${scope}:${name}]:`,
11244
11474
  error
11245
11475
  );
@@ -11335,7 +11565,7 @@ function readHooks(source, scope, extensionName) {
11335
11565
  extensionName
11336
11566
  });
11337
11567
  } catch (error) {
11338
- debugLogger6.warn(
11568
+ debugLogger7.warn(
11339
11569
  `Skipping malformed hook entry [${scope}:${event}:${index}]:`,
11340
11570
  error
11341
11571
  );
@@ -11637,7 +11867,7 @@ async function runAcpAgent(config, settings, argv, options) {
11637
11867
  void preloadContentGenerator(
11638
11868
  session.getConfig().getContentGenerator()
11639
11869
  ).catch((error) => {
11640
- debugLogger6.debug(
11870
+ debugLogger7.debug(
11641
11871
  `[ACP] Session provider preload failed for ${sessionId}: ${error instanceof Error ? error.message : String(error)}`
11642
11872
  );
11643
11873
  });
@@ -11678,7 +11908,7 @@ async function runAcpAgent(config, settings, argv, options) {
11678
11908
  try {
11679
11909
  await agentInstance.shutdownMcpPool(8e3);
11680
11910
  } catch (err) {
11681
- debugLogger6.error(`[ACP] MCP pool drain (${label}) error:`, err);
11911
+ debugLogger7.error(`[ACP] MCP pool drain (${label}) error:`, err);
11682
11912
  if (strict) throw err;
11683
11913
  }
11684
11914
  }, "drainPoolBeforeExit");
@@ -11711,7 +11941,7 @@ async function runAcpAgent(config, settings, argv, options) {
11711
11941
  await hookSystem.fireSessionEndEvent(reason);
11712
11942
  } catch (err) {
11713
11943
  if (managedConfigs) failures.push(err);
11714
- debugLogger6.warn(
11944
+ debugLogger7.warn(
11715
11945
  `SessionEnd hook failed: ${err instanceof Error ? err.message : String(err)}`
11716
11946
  );
11717
11947
  }
@@ -11735,7 +11965,7 @@ async function runAcpAgent(config, settings, argv, options) {
11735
11965
  await terminal.writerShutdown;
11736
11966
  } catch (error) {
11737
11967
  failures.push(error);
11738
- debugLogger6.error("[ACP] Managed writer shutdown error:", error);
11968
+ debugLogger7.error("[ACP] Managed writer shutdown error:", error);
11739
11969
  const retainedLockPaths = terminal.configs.flatMap((config2) => {
11740
11970
  if (typeof config2.getSessionRuntimeBaseDir !== "function" || typeof config2.getSessionId !== "function") {
11741
11971
  return [];
@@ -11762,7 +11992,7 @@ async function runAcpAgent(config, settings, argv, options) {
11762
11992
  await agent.finishManagedShutdown(terminal.configs);
11763
11993
  } catch (error) {
11764
11994
  failures.push(error);
11765
- debugLogger6.error("[ACP] Managed resource shutdown error:", error);
11995
+ debugLogger7.error("[ACP] Managed resource shutdown error:", error);
11766
11996
  }
11767
11997
  try {
11768
11998
  await drainPoolBeforeExit(label, true);
@@ -11773,7 +12003,7 @@ async function runAcpAgent(config, settings, argv, options) {
11773
12003
  await runExitCleanup();
11774
12004
  } catch (error) {
11775
12005
  failures.push(error);
11776
- debugLogger6.error("[ACP] Cleanup error:", error);
12006
+ debugLogger7.error("[ACP] Cleanup error:", error);
11777
12007
  }
11778
12008
  if (failures.length > 0) {
11779
12009
  throw new AggregateError(failures, "Managed ACP shutdown failed");
@@ -11784,14 +12014,14 @@ async function runAcpAgent(config, settings, argv, options) {
11784
12014
  const shutdownHandler = /* @__PURE__ */ __name(async () => {
11785
12015
  if (shuttingDown) return;
11786
12016
  shuttingDown = true;
11787
- debugLogger6.debug("[ACP] Shutdown signal received, closing streams");
12017
+ debugLogger7.debug("[ACP] Shutdown signal received, closing streams");
11788
12018
  if (agentInstance?.isTrustedManagedParent()) {
11789
12019
  let exitCode = 0;
11790
12020
  try {
11791
12021
  await shutdownManagedAgent("other" /* Other */, "signal");
11792
12022
  } catch (err) {
11793
12023
  exitCode = 1;
11794
- debugLogger6.error("[ACP] Managed shutdown error:", err);
12024
+ debugLogger7.error("[ACP] Managed shutdown error:", err);
11795
12025
  } finally {
11796
12026
  eventLoopMonitor.dispose();
11797
12027
  }
@@ -11816,12 +12046,12 @@ async function runAcpAgent(config, settings, argv, options) {
11816
12046
  }
11817
12047
  await drainPoolBeforeExit("signal");
11818
12048
  } catch (err) {
11819
- debugLogger6.error("[ACP] Shutdown error:", err);
12049
+ debugLogger7.error("[ACP] Shutdown error:", err);
11820
12050
  } finally {
11821
12051
  eventLoopMonitor.dispose();
11822
12052
  }
11823
12053
  runExitCleanup().catch((err) => {
11824
- debugLogger6.error("[ACP] Cleanup error:", err);
12054
+ debugLogger7.error("[ACP] Cleanup error:", err);
11825
12055
  }).finally(() => {
11826
12056
  process.exit(0);
11827
12057
  });
@@ -12022,6 +12252,8 @@ var QwenAgent = class {
12022
12252
  initializingConfigs = /* @__PURE__ */ new Set();
12023
12253
  managedShuttingDown = false;
12024
12254
  clientCapabilities;
12255
+ /** Set once the daemon negotiates active-work reporting; one per channel. */
12256
+ activeWorkReporter;
12025
12257
  privateParentState = "uninitialized";
12026
12258
  // CPU-usage delta baseline for the daemon's `workspaceResource` extMethod
12027
12259
  // (Daemon Status child-resource chart). The daemon polls this at a fixed
@@ -12094,12 +12326,12 @@ var QwenAgent = class {
12094
12326
  try {
12095
12327
  session.beginCloseIfAvailable();
12096
12328
  } catch (error) {
12097
- debugLogger6.debug(
12329
+ debugLogger7.debug(
12098
12330
  `Session ${session.getId()} admission close during managed shutdown failed: ${error instanceof Error ? error.message : String(error)}`
12099
12331
  );
12100
12332
  }
12101
12333
  void session.cancelPendingPrompt().catch((error) => {
12102
- debugLogger6.debug(
12334
+ debugLogger7.debug(
12103
12335
  `Session ${session.getId()} cancel during managed shutdown failed: ${error instanceof Error ? error.message : String(error)}`
12104
12336
  );
12105
12337
  });
@@ -12247,7 +12479,7 @@ var QwenAgent = class {
12247
12479
  await run();
12248
12480
  }).catch((err) => {
12249
12481
  this.workspaceMcpDiscoveryError = err instanceof Error ? err.message : String(err);
12250
- debugLogger6.error(
12482
+ debugLogger7.error(
12251
12483
  `Workspace MCP ${label} failed: ${err instanceof Error ? err.message : String(err)}`
12252
12484
  );
12253
12485
  }).finally(() => {
@@ -12434,7 +12666,7 @@ var QwenAgent = class {
12434
12666
  try {
12435
12667
  const result = await this.mcpPool.drainAll({ force: true, timeoutMs });
12436
12668
  if (result.forced > 0 || result.errors.length > 0) {
12437
- debugLogger6.warn(
12669
+ debugLogger7.warn(
12438
12670
  `MCP pool drain: ${result.drained} clean, ${result.forced} timed out, ${result.errors.length} errors`
12439
12671
  );
12440
12672
  throw new Error(
@@ -12442,7 +12674,7 @@ var QwenAgent = class {
12442
12674
  );
12443
12675
  }
12444
12676
  } catch (err) {
12445
- debugLogger6.error(
12677
+ debugLogger7.error(
12446
12678
  `MCP pool drainAll failed: ${err instanceof Error ? err.message : String(err)}`
12447
12679
  );
12448
12680
  throw err;
@@ -12478,8 +12710,9 @@ var QwenAgent = class {
12478
12710
  cleanupErrors.push(error);
12479
12711
  }
12480
12712
  this.sessions.delete(sessionId);
12713
+ this.activeWorkReporter?.notifyChanged();
12481
12714
  if (cleanupErrors.length > 0) {
12482
- debugLogger6.warn(
12715
+ debugLogger7.warn(
12483
12716
  `Session ${sessionId} closed after ${cleanupErrors.length} cleanup failure(s): ${cleanupErrors.map(
12484
12717
  (error) => error instanceof Error ? error.message : String(error)
12485
12718
  ).join("; ")}`
@@ -12533,7 +12766,7 @@ var QwenAgent = class {
12533
12766
  try {
12534
12767
  await cleanup();
12535
12768
  } catch (cleanupError) {
12536
- debugLogger6.warn(
12769
+ debugLogger7.warn(
12537
12770
  `Session cleanup failed while preserving the original request error: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
12538
12771
  );
12539
12772
  }
@@ -12557,7 +12790,7 @@ var QwenAgent = class {
12557
12790
  await this.cleanupUnstoredConfig(config);
12558
12791
  } catch (error) {
12559
12792
  if (config.getSessionId() === requiredSessionId) throw error;
12560
- debugLogger6.warn(
12793
+ debugLogger7.warn(
12561
12794
  `Deferred Config cleanup retry failed for session ${config.getSessionId()}: ${error instanceof Error ? error.message : String(error)}`
12562
12795
  );
12563
12796
  }
@@ -12567,7 +12800,7 @@ var QwenAgent = class {
12567
12800
  const session = this.sessions.get(sessionId);
12568
12801
  if (!session) {
12569
12802
  this.mcpPool?.releaseSession(sessionId);
12570
- return;
12803
+ return { closed: true, holds: [] };
12571
12804
  }
12572
12805
  const recorder = session.getConfig().getChatRecordingService();
12573
12806
  const requireFlush = opts?.requireFlush === true;
@@ -12576,6 +12809,13 @@ var QwenAgent = class {
12576
12809
  }
12577
12810
  const drainTimeoutMs = opts?.drainTimeoutMs ?? SESSION_DRAIN_TIMEOUT_MS;
12578
12811
  const cancelClose = opts?.waitForCloseGate ? await beginSessionCloseAfterCurrentGate(session, drainTimeoutMs) : session.beginClose();
12812
+ if (opts?.onlyIfUnheld) {
12813
+ const holds = session.collectActiveWorkHolds();
12814
+ if (holds.length > 0) {
12815
+ cancelClose();
12816
+ return { closed: false, holds };
12817
+ }
12818
+ }
12579
12819
  for (const [requestId, generation] of this.generationControllers) {
12580
12820
  if (generation.sessionId !== sessionId) continue;
12581
12821
  generation.controller.abort();
@@ -12588,7 +12828,7 @@ var QwenAgent = class {
12588
12828
  try {
12589
12829
  await session.cancelPendingPrompt();
12590
12830
  } catch (err) {
12591
- debugLogger6.debug(
12831
+ debugLogger7.debug(
12592
12832
  `Session ${sessionId} cancel during close failed: ${err instanceof Error ? err.message : String(err)}`
12593
12833
  );
12594
12834
  }
@@ -12626,6 +12866,7 @@ var QwenAgent = class {
12626
12866
  } finally {
12627
12867
  if (!removedFromStore) cancelClose();
12628
12868
  }
12869
+ return { closed: true, holds: [] };
12629
12870
  }
12630
12871
  async discardStoredSessionIfCurrent(sessionId, session, opts) {
12631
12872
  if (this.sessions.get(sessionId) !== session) {
@@ -12634,6 +12875,8 @@ var QwenAgent = class {
12634
12875
  await this.closeStoredSession(sessionId, opts);
12635
12876
  }
12636
12877
  async disposeSessions() {
12878
+ this.activeWorkReporter?.dispose();
12879
+ this.activeWorkReporter = void 0;
12637
12880
  for (const generation of this.generationControllers.values()) {
12638
12881
  generation.controller.abort();
12639
12882
  }
@@ -12692,7 +12935,7 @@ var QwenAgent = class {
12692
12935
  scope: "workspace",
12693
12936
  ...event
12694
12937
  }).catch((err) => {
12695
- debugLogger6.debug(
12938
+ debugLogger7.debug(
12696
12939
  `MCP workspace budget event delivery to session ${sid} failed (kind=${event.kind}): ${err instanceof Error ? err.message : String(err)}`
12697
12940
  );
12698
12941
  });
@@ -12727,7 +12970,7 @@ var QwenAgent = class {
12727
12970
  }
12728
12971
  this.clientCapabilities = args.clientCapabilities;
12729
12972
  const authMethods = buildAuthMethods();
12730
- const version = "0.21.7";
12973
+ const version = "0.21.8";
12731
12974
  const response = {
12732
12975
  protocolVersion: PROTOCOL_VERSION,
12733
12976
  agentInfo: {
@@ -12766,11 +13009,31 @@ var QwenAgent = class {
12766
13009
  }
12767
13010
  const requestedProfile = args._meta?.[CHANNEL_STARTUP_PROFILE_META_KEY];
12768
13011
  const profileRequested = requestedProfile !== null && typeof requestedProfile === "object" && !Array.isArray(requestedProfile) && requestedProfile["v"] === CHANNEL_STARTUP_PROFILE_VERSION;
13012
+ const requestedActiveWork = args._meta?.[ACTIVE_WORK_HEARTBEAT_META_KEY];
13013
+ const activeWorkRequested = requestedActiveWork !== null && typeof requestedActiveWork === "object" && !Array.isArray(requestedActiveWork) && requestedActiveWork["v"] === ACTIVE_WORK_HEARTBEAT_VERSION;
13014
+ const activeWorkIntervalMs = activeWorkRequested ? clampActiveWorkIntervalMs(
13015
+ requestedActiveWork["intervalMs"]
13016
+ ) : void 0;
13017
+ if (activeWorkIntervalMs !== void 0) {
13018
+ this.activeWorkReporter?.dispose();
13019
+ this.activeWorkReporter = new ActiveWorkReporter(
13020
+ (method, params) => this.connection.extNotification(method, params),
13021
+ () => this.sessions.values(),
13022
+ activeWorkIntervalMs
13023
+ );
13024
+ }
12769
13025
  const responseMeta = {
12770
13026
  ...this.managedToolInvocationGuard ? {
12771
13027
  [EXTERNAL_TOOL_GUARD_READY_META_KEY]: EXTERNAL_TOOL_GUARD_REQUIRED_VALUE
12772
13028
  } : {},
12773
- ...profileRequested && startupProfile ? { [CHANNEL_STARTUP_PROFILE_META_KEY]: startupProfile } : {}
13029
+ ...profileRequested && startupProfile ? { [CHANNEL_STARTUP_PROFILE_META_KEY]: startupProfile } : {},
13030
+ ...activeWorkIntervalMs !== void 0 ? {
13031
+ [ACTIVE_WORK_HEARTBEAT_META_KEY]: {
13032
+ v: ACTIVE_WORK_HEARTBEAT_VERSION,
13033
+ intervalMs: activeWorkIntervalMs,
13034
+ categories: [...ACTIVE_WORK_HOLD_CATEGORIES]
13035
+ }
13036
+ } : {}
12774
13037
  };
12775
13038
  return Object.keys(responseMeta).length > 0 ? { ...response, _meta: responseMeta } : response;
12776
13039
  }
@@ -12890,7 +13153,7 @@ var QwenAgent = class {
12890
13153
  records: replayPage.records,
12891
13154
  gaps: sessionData2.historyGaps,
12892
13155
  cumulativeUsage: createReplayCumulativeUsage(),
12893
- logger: debugLogger6
13156
+ logger: debugLogger7
12894
13157
  });
12895
13158
  if (!bulkReplay2) {
12896
13159
  try {
@@ -12977,7 +13240,7 @@ var QwenAgent = class {
12977
13240
  gaps: sessionData?.historyGaps,
12978
13241
  cumulativeUsage: replayUsage,
12979
13242
  supersedeUnrestorableGoal: true,
12980
- logger: debugLogger6
13243
+ logger: debugLogger7
12981
13244
  });
12982
13245
  replayUpdates = replay.updates;
12983
13246
  copyCumulativeUsage(createdSession.cumulativeUsage, replayUsage);
@@ -13121,7 +13384,7 @@ var QwenAgent = class {
13121
13384
  session.pendingWorktreeNotice = restored.contextMessage;
13122
13385
  }
13123
13386
  } catch (error) {
13124
- debugLogger6.warn(`ACP worktree restore failed: ${error}`);
13387
+ debugLogger7.warn(`ACP worktree restore failed: ${error}`);
13125
13388
  }
13126
13389
  }
13127
13390
  async #restoreBackgroundAgentsOnResume(config, session) {
@@ -13154,7 +13417,7 @@ var QwenAgent = class {
13154
13417
  config
13155
13418
  );
13156
13419
  if (restored.restored) {
13157
- debugLogger6.info(
13420
+ debugLogger7.info(
13158
13421
  `ACP goal restored sessionId=${config.getSessionId()} condition=${restored.condition}`
13159
13422
  );
13160
13423
  } else if (restored.blockedBy && restored.blockedBy !== "condition-invalid") {
@@ -13314,6 +13577,7 @@ var QwenAgent = class {
13314
13577
  this.activePromptCalls.delete(params.sessionId);
13315
13578
  }
13316
13579
  settleCall();
13580
+ await this.activeWorkReporter?.flush();
13317
13581
  }
13318
13582
  }
13319
13583
  async cancel(params) {
@@ -13347,7 +13611,7 @@ var QwenAgent = class {
13347
13611
  await extensionManager.refreshCache();
13348
13612
  extensions = extensionManager.getLoadedExtensions();
13349
13613
  } catch (error) {
13350
- debugLogger6.warn(
13614
+ debugLogger7.warn(
13351
13615
  "Extension loading failed, continuing without extensions:",
13352
13616
  error
13353
13617
  );
@@ -13473,7 +13737,7 @@ var QwenAgent = class {
13473
13737
  pm.addPersistentRule(rule, ruleType);
13474
13738
  }
13475
13739
  } catch (error) {
13476
- debugLogger6.warn(
13740
+ debugLogger7.warn(
13477
13741
  `Failed to sync permission rules to a live session: ${error instanceof Error ? error.message : String(error)}`
13478
13742
  );
13479
13743
  }
@@ -14031,7 +14295,7 @@ var QwenAgent = class {
14031
14295
  if (!changed) return;
14032
14296
  await config.getSkillManager()?.refreshCache();
14033
14297
  } catch (error) {
14034
- debugLogger6.warn("Extension source revalidation failed:", error);
14298
+ debugLogger7.warn("Extension source revalidation failed:", error);
14035
14299
  }
14036
14300
  }
14037
14301
  async buildWorkspaceSkillsStatus(config) {
@@ -15486,7 +15750,7 @@ var QwenAgent = class {
15486
15750
  config,
15487
15751
  finalizeDangling: !activePromptBeforeRead && !this.activePromptCalls.has(sessionId),
15488
15752
  encodeCursor: /* @__PURE__ */ __name((state) => encodeSessionTranscriptCursor(state, cwd), "encodeCursor"),
15489
- logger: debugLogger6
15753
+ logger: debugLogger7
15490
15754
  });
15491
15755
  return {
15492
15756
  v: 1,
@@ -15682,7 +15946,7 @@ var QwenAgent = class {
15682
15946
  );
15683
15947
  if (childSignal.aborted) {
15684
15948
  const timeoutCode = "remember_timeout";
15685
- debugLogger6.error("Workspace memory remember timed out:", {
15949
+ debugLogger7.error("Workspace memory remember timed out:", {
15686
15950
  projectRoot,
15687
15951
  code: timeoutCode,
15688
15952
  details: diagnostics.debugDetails,
@@ -15694,7 +15958,7 @@ var QwenAgent = class {
15694
15958
  workspaceMemoryErrorData(timeoutCode, diagnostics)
15695
15959
  );
15696
15960
  }
15697
- debugLogger6.error("Workspace memory remember failed:", {
15961
+ debugLogger7.error("Workspace memory remember failed:", {
15698
15962
  projectRoot,
15699
15963
  code,
15700
15964
  details: diagnostics.debugDetails,
@@ -15768,7 +16032,7 @@ var QwenAgent = class {
15768
16032
  );
15769
16033
  if (childSignal.aborted) {
15770
16034
  const timeoutCode = "forget_timeout";
15771
- debugLogger6.error("Workspace memory forget timed out:", {
16035
+ debugLogger7.error("Workspace memory forget timed out:", {
15772
16036
  projectRoot,
15773
16037
  code: timeoutCode,
15774
16038
  details: diagnostics.debugDetails,
@@ -15780,7 +16044,7 @@ var QwenAgent = class {
15780
16044
  workspaceMemoryErrorData(timeoutCode, diagnostics)
15781
16045
  );
15782
16046
  }
15783
- debugLogger6.error("Workspace memory forget failed:", {
16047
+ debugLogger7.error("Workspace memory forget failed:", {
15784
16048
  projectRoot,
15785
16049
  code,
15786
16050
  details: diagnostics.debugDetails,
@@ -15848,7 +16112,7 @@ var QwenAgent = class {
15848
16112
  );
15849
16113
  if (childSignal.aborted) {
15850
16114
  const timeoutCode = "dream_timeout";
15851
- debugLogger6.error("Workspace memory dream timed out:", {
16115
+ debugLogger7.error("Workspace memory dream timed out:", {
15852
16116
  projectRoot,
15853
16117
  code: timeoutCode,
15854
16118
  details: diagnostics.debugDetails,
@@ -15860,7 +16124,7 @@ var QwenAgent = class {
15860
16124
  workspaceMemoryErrorData(timeoutCode, diagnostics)
15861
16125
  );
15862
16126
  }
15863
- debugLogger6.error("Workspace memory dream failed:", {
16127
+ debugLogger7.error("Workspace memory dream failed:", {
15864
16128
  projectRoot,
15865
16129
  code,
15866
16130
  details: diagnostics.debugDetails,
@@ -16270,7 +16534,7 @@ var QwenAgent = class {
16270
16534
  error: error instanceof Error ? error.message : String(error)
16271
16535
  });
16272
16536
  rejectStarted(error);
16273
- debugLogger6.warn(
16537
+ debugLogger7.warn(
16274
16538
  `MCP OAuth authentication failed for ${serverName}:`,
16275
16539
  error
16276
16540
  );
@@ -16282,7 +16546,7 @@ var QwenAgent = class {
16282
16546
  "discover"
16283
16547
  );
16284
16548
  } catch (error) {
16285
- debugLogger6.warn(
16549
+ debugLogger7.warn(
16286
16550
  `MCP OAuth authenticated for ${serverName}, but tool synchronization failed:`,
16287
16551
  error
16288
16552
  );
@@ -16690,11 +16954,12 @@ var QwenAgent = class {
16690
16954
  "Invalid session close drain timeout"
16691
16955
  );
16692
16956
  }
16693
- await this.closeStoredSession(sessionId, {
16957
+ const outcome = await this.closeStoredSession(sessionId, {
16694
16958
  requireFlush: params["requireFlush"] === true,
16959
+ onlyIfUnheld: params[ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM] === true,
16695
16960
  ...typeof rawDrainTimeoutMs === "number" ? { drainTimeoutMs: rawDrainTimeoutMs } : {}
16696
16961
  });
16697
- return { sessionId, closed: true };
16962
+ return outcome.closed ? { sessionId, closed: true } : { sessionId, closed: false, holds: outcome.holds };
16698
16963
  }
16699
16964
  case SERVE_CONTROL_EXT_METHODS.sessionCd: {
16700
16965
  const sessionId = params["sessionId"];
@@ -16971,7 +17236,7 @@ var QwenAgent = class {
16971
17236
  try {
16972
17237
  await setLanguageAsync(language);
16973
17238
  } catch (err) {
16974
- debugLogger6.warn("setLanguageAsync failed:", err);
17239
+ debugLogger7.warn("setLanguageAsync failed:", err);
16975
17240
  throw new RequestError(
16976
17241
  -32603,
16977
17242
  `Failed to switch UI language: ${err instanceof Error ? err.message : String(err)}`
@@ -16985,7 +17250,7 @@ var QwenAgent = class {
16985
17250
  language
16986
17251
  );
16987
17252
  } catch (err) {
16988
- debugLogger6.warn("Failed to persist UI language setting:", err);
17253
+ debugLogger7.warn("Failed to persist UI language setting:", err);
16989
17254
  }
16990
17255
  let outputLanguage = null;
16991
17256
  let refreshed = false;
@@ -16999,7 +17264,7 @@ var QwenAgent = class {
16999
17264
  );
17000
17265
  fileWriteOk = true;
17001
17266
  } catch (err) {
17002
- debugLogger6.warn("Failed to write output-language.md:", err);
17267
+ debugLogger7.warn("Failed to write output-language.md:", err);
17003
17268
  }
17004
17269
  if (fileWriteOk) {
17005
17270
  try {
@@ -17009,7 +17274,7 @@ var QwenAgent = class {
17009
17274
  settingValue
17010
17275
  );
17011
17276
  } catch (err) {
17012
- debugLogger6.warn(
17277
+ debugLogger7.warn(
17013
17278
  "Failed to persist output language setting:",
17014
17279
  err
17015
17280
  );
@@ -17029,7 +17294,7 @@ var QwenAgent = class {
17029
17294
  writeOutputLanguageAndRegisterPath(settingValue, cfg);
17030
17295
  }
17031
17296
  } catch (err) {
17032
- debugLogger6.warn(
17297
+ debugLogger7.warn(
17033
17298
  `Failed to write output-language.md for session ${s.getId()} (path=${sessionPath ?? "global-default"}):`,
17034
17299
  err
17035
17300
  );
@@ -17042,7 +17307,7 @@ var QwenAgent = class {
17042
17307
  (r) => r.status === "rejected"
17043
17308
  ).length;
17044
17309
  if (failedCount > 0) {
17045
- debugLogger6.warn(
17310
+ debugLogger7.warn(
17046
17311
  `Language refresh failed for ${failedCount}/${results.length} session(s)`
17047
17312
  );
17048
17313
  }
@@ -17060,14 +17325,14 @@ var QwenAgent = class {
17060
17325
  "Invalid or missing sessionId"
17061
17326
  );
17062
17327
  }
17063
- debugLogger6.debug(`recap ext-method received for session=${sessionId}`);
17328
+ debugLogger7.debug(`recap ext-method received for session=${sessionId}`);
17064
17329
  const session = this.sessionOrThrow(sessionId);
17065
17330
  const config = session.getConfig();
17066
17331
  const recap = await generateSessionRecap(
17067
17332
  config,
17068
17333
  new AbortController().signal
17069
17334
  );
17070
- debugLogger6.debug(
17335
+ debugLogger7.debug(
17071
17336
  `recap ext-method completed for session=${sessionId} result=${recap ? `len=${recap.length}` : "null"}`
17072
17337
  );
17073
17338
  return { sessionId, recap };
@@ -17149,7 +17414,7 @@ var QwenAgent = class {
17149
17414
  const config = session.getConfig();
17150
17415
  const cacheSafeParams = buildBtwCacheSafeParams(config);
17151
17416
  if (!cacheSafeParams) {
17152
- debugLogger6.debug(`btw: no cacheSafeParams for session=${sessionId}`);
17417
+ debugLogger7.debug(`btw: no cacheSafeParams for session=${sessionId}`);
17153
17418
  return { sessionId, answer: null };
17154
17419
  }
17155
17420
  const childSignal = AbortSignal.timeout(BTW_CHILD_TIMEOUT_MS);
@@ -17203,7 +17468,7 @@ var QwenAgent = class {
17203
17468
  try {
17204
17469
  hasHistory = (config.getGeminiClient().getHistoryShallow() ?? []).length > 0;
17205
17470
  } catch (error) {
17206
- debugLogger6.debug("Failed to read history before /fork:", error);
17471
+ debugLogger7.debug("Failed to read history before /fork:", error);
17207
17472
  }
17208
17473
  if (!hasHistory) {
17209
17474
  throw RequestError.invalidParams(
@@ -17245,7 +17510,7 @@ var QwenAgent = class {
17245
17510
  ]
17246
17511
  });
17247
17512
  } catch (error) {
17248
- debugLogger6.debug("Failed to record fork event in history:", error);
17513
+ debugLogger7.debug("Failed to record fork event in history:", error);
17249
17514
  }
17250
17515
  return { sessionId, description, launched: true };
17251
17516
  }
@@ -17308,7 +17573,7 @@ ${outputText}
17308
17573
  'taskKind must be "agent", "shell", or "monitor"'
17309
17574
  );
17310
17575
  }
17311
- debugLogger6.info(
17576
+ debugLogger7.info(
17312
17577
  `sessionTaskCancel requested sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind}`
17313
17578
  );
17314
17579
  const session = this.sessionOrThrow(sessionId);
@@ -17318,7 +17583,7 @@ ${outputText}
17318
17583
  const task = config.getBackgroundTaskRegistry().get(taskId);
17319
17584
  if (!task || task.status !== "running" && task.status !== "paused") {
17320
17585
  const reason = task ? "not_running" : "not_found";
17321
- debugLogger6.info(
17586
+ debugLogger7.info(
17322
17587
  `sessionTaskCancel skipped sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} reason=${reason} status=${task?.status ?? "missing"}`
17323
17588
  );
17324
17589
  return { cancelled: false, reason, status: task?.status };
@@ -17328,7 +17593,7 @@ ${outputText}
17328
17593
  } else {
17329
17594
  config.getBackgroundTaskRegistry().cancel(taskId);
17330
17595
  }
17331
- debugLogger6.info(
17596
+ debugLogger7.info(
17332
17597
  `sessionTaskCancel completed sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} status=${task.status}`
17333
17598
  );
17334
17599
  return { cancelled: true, status: task.status };
@@ -17337,13 +17602,13 @@ ${outputText}
17337
17602
  const task = config.getBackgroundShellRegistry().get(taskId);
17338
17603
  if (!task || task.status !== "running") {
17339
17604
  const reason = task ? "not_running" : "not_found";
17340
- debugLogger6.info(
17605
+ debugLogger7.info(
17341
17606
  `sessionTaskCancel skipped sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} reason=${reason} status=${task?.status ?? "missing"}`
17342
17607
  );
17343
17608
  return { cancelled: false, reason, status: task?.status };
17344
17609
  }
17345
17610
  config.getBackgroundShellRegistry().requestCancel(taskId);
17346
- debugLogger6.info(
17611
+ debugLogger7.info(
17347
17612
  `sessionTaskCancel completed sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} status=${task.status}`
17348
17613
  );
17349
17614
  return { cancelled: true, status: task.status };
@@ -17352,13 +17617,13 @@ ${outputText}
17352
17617
  const task = config.getMonitorRegistry().get(taskId);
17353
17618
  if (!task || task.status !== "running") {
17354
17619
  const reason = task ? "not_running" : "not_found";
17355
- debugLogger6.info(
17620
+ debugLogger7.info(
17356
17621
  `sessionTaskCancel skipped sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} reason=${reason} status=${task?.status ?? "missing"}`
17357
17622
  );
17358
17623
  return { cancelled: false, reason, status: task?.status };
17359
17624
  }
17360
17625
  config.getMonitorRegistry().cancel(taskId);
17361
- debugLogger6.info(
17626
+ debugLogger7.info(
17362
17627
  `sessionTaskCancel completed sessionId=${sessionId} taskId=${taskId} taskKind=${taskKind} status=${task.status}`
17363
17628
  );
17364
17629
  return { cancelled: true, status: task.status };
@@ -17388,7 +17653,7 @@ ${outputText}
17388
17653
  durationMs: Date.now() - cleared.setAt
17389
17654
  });
17390
17655
  }
17391
- debugLogger6.info(
17656
+ debugLogger7.info(
17392
17657
  `sessionGoalClear sessionId=${sessionId} cleared=${!!cleared} condition=${cleared?.condition ?? "(none)"}`
17393
17658
  );
17394
17659
  return {
@@ -17427,7 +17692,7 @@ ${outputText}
17427
17692
  }
17428
17693
  const session = this.sessionOrThrow(sessionId);
17429
17694
  const result = await session.continueLastTurn();
17430
- debugLogger6.info(
17695
+ debugLogger7.info(
17431
17696
  `sessionContinue sessionId=${sessionId} accepted=${result.accepted} interruption=${result.interruption}`
17432
17697
  );
17433
17698
  return result;
@@ -17449,7 +17714,7 @@ ${outputText}
17449
17714
  request.runtimeClientId
17450
17715
  );
17451
17716
  } catch (sessionErr) {
17452
- debugLogger6.warn(
17717
+ debugLogger7.warn(
17453
17718
  `workspaceMcpRuntimeAdd: failed to add runtime MCP server '${request.name}' to active session ${session.getConfig().getSessionId()}: ${sessionErr instanceof Error ? sessionErr.message : String(sessionErr)}`
17454
17719
  );
17455
17720
  }
@@ -17472,7 +17737,7 @@ ${outputText}
17472
17737
  request.runtimeClientId
17473
17738
  );
17474
17739
  } catch (sessionErr) {
17475
- debugLogger6.warn(
17740
+ debugLogger7.warn(
17476
17741
  `workspaceMcpRuntimeRemove: failed to remove runtime MCP server '${request.name}' from active session ${session.getConfig().getSessionId()}: ${sessionErr instanceof Error ? sessionErr.message : String(sessionErr)}`
17477
17742
  );
17478
17743
  }
@@ -17581,7 +17846,7 @@ ${outputText}
17581
17846
  }
17582
17847
  );
17583
17848
  if (success) {
17584
- fireSessionDeleteHook(this.config, sessionId, debugLogger6);
17849
+ fireSessionDeleteHook(this.config, sessionId, debugLogger7);
17585
17850
  }
17586
17851
  return { success };
17587
17852
  }
@@ -17707,7 +17972,7 @@ ${outputText}
17707
17972
  filesFailed = fileResult.filesFailed;
17708
17973
  } catch (err) {
17709
17974
  const reason = err instanceof Error ? err.message : String(err);
17710
- debugLogger6.error(
17975
+ debugLogger7.error(
17711
17976
  `[ACP] File-history rewind failed for session=${sessionId} promptId=${promptId}: ${reason}`
17712
17977
  );
17713
17978
  filesFailed = [`file-history-rewind: ${reason}`];
@@ -17739,7 +18004,7 @@ ${outputText}
17739
18004
  } catch (err) {
17740
18005
  const reason = err instanceof Error ? err.message : String(err);
17741
18006
  artifactSnapshotUnavailable = "artifact snapshot unavailable after rewind";
17742
- debugLogger6.warn(
18007
+ debugLogger7.warn(
17743
18008
  `[ACP] Failed to rebuild artifact snapshot after rewind for session=${sessionId}: ${reason}`
17744
18009
  );
17745
18010
  }
@@ -17795,7 +18060,7 @@ ${outputText}
17795
18060
  records: sessionData.conversation.messages,
17796
18061
  gaps: sessionData.historyGaps,
17797
18062
  cumulativeUsage: createReplayCumulativeUsage(),
17798
- logger: debugLogger6
18063
+ logger: debugLogger7
17799
18064
  });
17800
18065
  return {
17801
18066
  updates: replay.updates,
@@ -18151,7 +18416,7 @@ ${outputText}
18151
18416
  newMerged.providerProtocol ?? {}
18152
18417
  );
18153
18418
  } catch (err) {
18154
- debugLogger6.warn(
18419
+ debugLogger7.warn(
18155
18420
  `reload: reloadModelProvidersConfig failed for session ${id}: ${err}`
18156
18421
  );
18157
18422
  }
@@ -18161,7 +18426,7 @@ ${outputText}
18161
18426
  try {
18162
18427
  await config.switchModel(authType, newModelName);
18163
18428
  } catch (err) {
18164
- debugLogger6.warn(
18429
+ debugLogger7.warn(
18165
18430
  `reload: switchModel failed for session ${id}: ${err}`
18166
18431
  );
18167
18432
  }
@@ -18169,7 +18434,7 @@ ${outputText}
18169
18434
  try {
18170
18435
  await config.refreshAuth(authType);
18171
18436
  } catch (err) {
18172
- debugLogger6.warn(
18437
+ debugLogger7.warn(
18173
18438
  `reload: refreshAuth failed for session ${id}: ${err}`
18174
18439
  );
18175
18440
  }
@@ -18188,7 +18453,7 @@ ${outputText}
18188
18453
  session.clearTodoStopGuardTrust();
18189
18454
  }
18190
18455
  } catch (err) {
18191
- debugLogger6.warn(
18456
+ debugLogger7.warn(
18192
18457
  `reload: setApprovalMode failed for session ${id}: ${err}`
18193
18458
  );
18194
18459
  }
@@ -18197,14 +18462,14 @@ ${outputText}
18197
18462
  try {
18198
18463
  await config.refreshHierarchicalMemory();
18199
18464
  } catch (err) {
18200
- debugLogger6.warn(
18465
+ debugLogger7.warn(
18201
18466
  `reload: refreshHierarchicalMemory failed for session ${id}: ${err}`
18202
18467
  );
18203
18468
  }
18204
18469
  try {
18205
18470
  await config.getGeminiClient()?.refreshSystemInstruction();
18206
18471
  } catch (err) {
18207
- debugLogger6.warn(
18472
+ debugLogger7.warn(
18208
18473
  `reload: refreshSystemInstruction failed for session ${id}: ${err}`
18209
18474
  );
18210
18475
  }
@@ -18214,7 +18479,7 @@ ${outputText}
18214
18479
  for (let i = 0; i < results.length; i++) {
18215
18480
  if (results[i].status === "rejected") {
18216
18481
  const reason = results[i].reason;
18217
- debugLogger6.warn(
18482
+ debugLogger7.warn(
18218
18483
  `Session ${sessions[i][0]} reload failed: ${reason}`
18219
18484
  );
18220
18485
  skipped.push(sessions[i][0]);
@@ -18259,7 +18524,7 @@ ${outputText}
18259
18524
  );
18260
18525
  for (const result of configResults) {
18261
18526
  if (result.status === "rejected") {
18262
- debugLogger6.warn(`Skill config refresh failed: ${result.reason}`);
18527
+ debugLogger7.warn(`Skill config refresh failed: ${result.reason}`);
18263
18528
  }
18264
18529
  }
18265
18530
  }
@@ -18278,7 +18543,7 @@ ${outputText}
18278
18543
  for (let i = 0; i < results.length; i++) {
18279
18544
  if (results[i].status === "rejected") {
18280
18545
  const reason2 = results[i].reason;
18281
- debugLogger6.warn(
18546
+ debugLogger7.warn(
18282
18547
  `Session ${sessions[i].getId()} skill refresh failed: ${reason2}`
18283
18548
  );
18284
18549
  }
@@ -18322,12 +18587,12 @@ ${outputText}
18322
18587
  disposeTranscriptReplayConfig(config) {
18323
18588
  try {
18324
18589
  void Promise.resolve(config.getToolRegistry()?.stop()).catch((err) => {
18325
- debugLogger6.debug(
18590
+ debugLogger7.debug(
18326
18591
  `Transcript replay config tool registry stop failed: ${err instanceof Error ? err.message : String(err)}`
18327
18592
  );
18328
18593
  });
18329
18594
  } catch (err) {
18330
- debugLogger6.debug(
18595
+ debugLogger7.debug(
18331
18596
  `Transcript replay config tool registry stop failed: ${err instanceof Error ? err.message : String(err)}`
18332
18597
  );
18333
18598
  }
@@ -18575,7 +18840,7 @@ ${outputText}
18575
18840
  sessionId: sid,
18576
18841
  ...event
18577
18842
  }).catch((err) => {
18578
- debugLogger6.debug(
18843
+ debugLogger7.debug(
18579
18844
  `MCP budget extNotification dropped (session=${sid}, kind=${event.kind}): ${err instanceof Error ? err.message : String(err)}`
18580
18845
  );
18581
18846
  });
@@ -18605,7 +18870,7 @@ ${outputText}
18605
18870
  try {
18606
18871
  await config.waitForMcpReady();
18607
18872
  } catch (err) {
18608
- debugLogger6.error(
18873
+ debugLogger7.error(
18609
18874
  `MCP discovery readiness failed: ${err instanceof Error ? err.message : String(err)}`
18610
18875
  );
18611
18876
  return;
@@ -18629,7 +18894,7 @@ ${outputText}
18629
18894
  try {
18630
18895
  await config.refreshAuth(selectedType, true);
18631
18896
  } catch (e) {
18632
- debugLogger6.error(`Authentication failed: ${e}`);
18897
+ debugLogger7.error(`Authentication failed: ${e}`);
18633
18898
  throw RequestError.authRequired(
18634
18899
  {
18635
18900
  authMethods: pickAuthMethodsForAuthRequired(selectedType)
@@ -18663,8 +18928,15 @@ ${outputText}
18663
18928
  if (this.sessions.has(sessionId)) {
18664
18929
  throw new Error(`Session ${sessionId} is already active.`);
18665
18930
  }
18666
- const session = new Session(sessionId, config, this.connection, settings);
18931
+ const session = new Session(
18932
+ sessionId,
18933
+ config,
18934
+ this.connection,
18935
+ settings,
18936
+ () => this.activeWorkReporter?.notifyChanged()
18937
+ );
18667
18938
  this.sessions.set(sessionId, session);
18939
+ this.activeWorkReporter?.notifyChanged();
18668
18940
  this.initializingConfigs.delete(config);
18669
18941
  try {
18670
18942
  if (options.enableLiveScreenContext) {