kiki-agent 0.5.0 → 0.6.0-beta.3

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 (307) hide show
  1. package/README.md +3 -3
  2. package/dist/builtin/examples/custom-json.mjs +7 -1
  3. package/dist/builtin/rules/claude/entry.mjs +8 -7
  4. package/dist/builtin/rules/codex/entry.mjs +8 -7
  5. package/dist/builtin/rules/files.mjs +6 -1
  6. package/dist/builtin/rules/grok.mjs +2 -2
  7. package/dist/builtin/rules/opencode.mjs +2 -2
  8. package/dist/builtin/rules/pi.mjs +3 -3
  9. package/dist/cpu-worker.mjs +61264 -0
  10. package/dist/docs/en/configuration/config-files.md +258 -45
  11. package/dist/docs/en/configuration/data-locations.md +18 -10
  12. package/dist/docs/en/configuration/env-vars.md +32 -2
  13. package/dist/docs/en/configuration/overrides.md +1 -1
  14. package/dist/docs/en/configuration/providers.md +98 -16
  15. package/dist/docs/en/customization/agent-profiles.md +3 -3
  16. package/dist/docs/en/customization/agents-and-subagents.md +120 -19
  17. package/dist/docs/en/customization/hooks.md +69 -13
  18. package/dist/docs/en/customization/personas.md +4 -4
  19. package/dist/docs/en/customization/plugins.md +171 -8
  20. package/dist/docs/en/customization/prompt-fields.md +66 -8
  21. package/dist/docs/en/customization/recipes.md +77 -0
  22. package/dist/docs/en/customization/skills.md +1 -1
  23. package/dist/docs/en/customization/skins.md +3 -3
  24. package/dist/docs/en/customization/themes.md +1 -1
  25. package/dist/docs/en/features/agent-workflows.md +1 -1
  26. package/dist/docs/en/features/browser-and-computer.md +5 -5
  27. package/dist/docs/en/features/daily.md +8 -6
  28. package/dist/docs/en/features/ecosystem.md +2 -2
  29. package/dist/docs/en/features/extend.md +2 -2
  30. package/dist/docs/en/features/freedom.md +4 -4
  31. package/dist/docs/en/features/index.md +19 -4
  32. package/dist/docs/en/features/long-work.md +13 -7
  33. package/dist/docs/en/features/look.md +2 -2
  34. package/dist/docs/en/features/people.md +2 -2
  35. package/dist/docs/en/features/phone.md +12 -4
  36. package/dist/docs/en/features/spaces.md +39 -27
  37. package/dist/docs/en/features/workbench.md +2 -0
  38. package/dist/docs/en/getting-started/desktop-app.md +4 -8
  39. package/dist/docs/en/getting-started/first-launch.md +11 -9
  40. package/dist/docs/en/getting-started/installation.md +15 -1
  41. package/dist/docs/en/getting-started/use-cases.md +2 -2
  42. package/dist/docs/en/guides/goals.md +4 -2
  43. package/dist/docs/en/guides/interaction.md +12 -10
  44. package/dist/docs/en/guides/interface.md +39 -19
  45. package/dist/docs/en/guides/memory.md +64 -10
  46. package/dist/docs/en/guides/sessions.md +21 -9
  47. package/dist/docs/en/guides/settings.md +88 -76
  48. package/dist/docs/en/index.md +11 -6
  49. package/dist/docs/en/reference/command.md +91 -42
  50. package/dist/docs/en/reference/keyboard.md +32 -15
  51. package/dist/docs/en/reference/model-vocabulary.md +5 -9
  52. package/dist/docs/en/reference/slash-commands.md +11 -5
  53. package/dist/docs/en/reference/tools.md +107 -46
  54. package/dist/docs/en/server/acp.md +6 -2
  55. package/dist/docs/en/server/local-server.md +27 -29
  56. package/dist/docs/en/server/mcp.md +4 -4
  57. package/dist/docs/en/server/rest-api.md +394 -56
  58. package/dist/docs/en/server/script-tools.md +268 -0
  59. package/dist/docs/zh/configuration/config-files.md +258 -45
  60. package/dist/docs/zh/configuration/data-locations.md +18 -10
  61. package/dist/docs/zh/configuration/env-vars.md +32 -2
  62. package/dist/docs/zh/configuration/overrides.md +1 -1
  63. package/dist/docs/zh/configuration/providers.md +98 -16
  64. package/dist/docs/zh/customization/agent-profiles.md +3 -3
  65. package/dist/docs/zh/customization/agents-and-subagents.md +120 -19
  66. package/dist/docs/zh/customization/hooks.md +69 -13
  67. package/dist/docs/zh/customization/personas.md +4 -4
  68. package/dist/docs/zh/customization/plugins.md +171 -8
  69. package/dist/docs/zh/customization/prompt-fields.md +66 -8
  70. package/dist/docs/zh/customization/recipes.md +77 -0
  71. package/dist/docs/zh/customization/skills.md +1 -1
  72. package/dist/docs/zh/customization/skins.md +3 -3
  73. package/dist/docs/zh/customization/themes.md +1 -1
  74. package/dist/docs/zh/features/agent-workflows.md +1 -1
  75. package/dist/docs/zh/features/browser-and-computer.md +5 -5
  76. package/dist/docs/zh/features/daily.md +8 -6
  77. package/dist/docs/zh/features/ecosystem.md +2 -2
  78. package/dist/docs/zh/features/extend.md +2 -2
  79. package/dist/docs/zh/features/freedom.md +4 -4
  80. package/dist/docs/zh/features/index.md +20 -5
  81. package/dist/docs/zh/features/long-work.md +13 -7
  82. package/dist/docs/zh/features/look.md +2 -2
  83. package/dist/docs/zh/features/people.md +2 -2
  84. package/dist/docs/zh/features/phone.md +12 -4
  85. package/dist/docs/zh/features/spaces.md +40 -28
  86. package/dist/docs/zh/features/workbench.md +2 -0
  87. package/dist/docs/zh/getting-started/desktop-app.md +4 -8
  88. package/dist/docs/zh/getting-started/first-launch.md +11 -9
  89. package/dist/docs/zh/getting-started/installation.md +15 -1
  90. package/dist/docs/zh/getting-started/use-cases.md +2 -2
  91. package/dist/docs/zh/guides/goals.md +4 -2
  92. package/dist/docs/zh/guides/interaction.md +12 -10
  93. package/dist/docs/zh/guides/interface.md +39 -19
  94. package/dist/docs/zh/guides/memory.md +64 -10
  95. package/dist/docs/zh/guides/sessions.md +21 -9
  96. package/dist/docs/zh/guides/settings.md +89 -77
  97. package/dist/docs/zh/index.md +12 -7
  98. package/dist/docs/zh/reference/command.md +91 -42
  99. package/dist/docs/zh/reference/keyboard.md +32 -15
  100. package/dist/docs/zh/reference/model-vocabulary.md +5 -9
  101. package/dist/docs/zh/reference/slash-commands.md +11 -5
  102. package/dist/docs/zh/reference/tools.md +105 -44
  103. package/dist/docs/zh/server/acp.md +6 -2
  104. package/dist/docs/zh/server/local-server.md +27 -29
  105. package/dist/docs/zh/server/mcp.md +4 -4
  106. package/dist/docs/zh/server/rest-api.md +381 -56
  107. package/dist/docs/zh/server/script-tools.md +268 -0
  108. package/dist/external-harness/agy-cli-acp.mjs +3856 -848
  109. package/dist/external-harness/agy-hook-registration.mjs +133 -42
  110. package/dist/external-harness/agy-mcp-plugin.mjs +19 -0
  111. package/dist/external-harness/agy-permission-hook.mjs +38 -2
  112. package/dist/history-navigation-worker.mjs +25512 -0
  113. package/dist/hostRunner.mjs +423 -13
  114. package/dist/mailbox-worker.mjs +256 -49
  115. package/dist/main.mjs +2 -2
  116. package/dist/memory-worker.mjs +1184 -0
  117. package/dist/native/windows-process-helper.exe +0 -0
  118. package/dist/plugin-isolation-worker.mjs +57 -0
  119. package/dist/query-store-worker.mjs +168 -43
  120. package/dist/sqlite-indexer.mjs +6087 -275
  121. package/dist/sqlite-query-worker.mjs +5918 -233
  122. package/dist/usage-parser-worker.mjs +3989 -4
  123. package/dist/usage-read-model-worker.mjs +852 -0
  124. package/dist/web/assets/AppErrorBoundary-C9VSooQP.js +1 -0
  125. package/dist/web/assets/ArchivedSessionsPage-QBDgQfmJ.js +1 -0
  126. package/dist/web/assets/CapabilitiesPage-CGd_8tc1.js +11 -0
  127. package/dist/web/assets/CodeEditor-BH2oKQ1E.js +4 -0
  128. package/dist/web/assets/ExternalEnginesSection-Cg0ZHV_Q.js +2 -0
  129. package/dist/web/assets/GlobalCronPanel-CkxiceFF.js +1 -0
  130. package/dist/web/assets/ImageViewport-Bm3A9cOx.js +1 -0
  131. package/dist/web/assets/ListParts-ALUaVCbQ.js +1 -0
  132. package/dist/web/assets/MediaLightbox-B_ovuTW7.js +1 -0
  133. package/dist/web/assets/MemoryPage-B7uc5mfC.js +1 -0
  134. package/dist/web/assets/ModelConnectCard-DZ3oD99k.js +2 -0
  135. package/dist/web/assets/NavScopeBoundary-BlowWTWB.js +1 -0
  136. package/dist/web/assets/PersonasPage-DfoIJD5s.js +3 -0
  137. package/dist/web/assets/PluginPanelHost-DYo0hMIh.js +1 -0
  138. package/dist/web/assets/PreviewWorkspace-DouCcOAD.js +1 -0
  139. package/dist/web/assets/RoomPage-H_4BwkAH.js +1 -0
  140. package/dist/web/assets/SecretField-DFIbmeTY.js +1 -0
  141. package/dist/web/assets/SectionCard-DWTLEA6F.js +1 -0
  142. package/dist/web/assets/SettingsPage-D7XE_1Qb.js +253 -0
  143. package/dist/web/assets/TasksPage-CSu0juVx.js +1 -0
  144. package/dist/web/assets/TerminalPanel-QWFMyS_C.js +9 -0
  145. package/dist/web/assets/UsagePage-CE_H2MKQ.js +1 -0
  146. package/dist/web/assets/{arc-C7IAvCCJ.js → arc-Do2UT5LJ.js} +1 -1
  147. package/dist/web/assets/architectureDiagram-3BPJPVTR-_lPS4SA2.js +36 -0
  148. package/dist/web/assets/askKiki-NJNt6ZhE.js +2 -0
  149. package/dist/web/assets/{blockDiagram-GPEHLZMM-B20N4t8r.js → blockDiagram-GPEHLZMM-Dg_y7shf.js} +2 -2
  150. package/dist/web/assets/{c4Diagram-AAUBKEIU-3BYtlcP-.js → c4Diagram-AAUBKEIU-Ytc3U8k7.js} +2 -2
  151. package/dist/web/assets/channel-ftewyUYM.js +1 -0
  152. package/dist/web/assets/{chunk-2J33WTMH-CpjgczxM.js → chunk-2J33WTMH-CqGuNCrJ.js} +1 -1
  153. package/dist/web/assets/{chunk-4BX2VUAB-BScxUF5G.js → chunk-4BX2VUAB-DRbcHFwS.js} +1 -1
  154. package/dist/web/assets/{chunk-55IACEB6-CrcLYJXd.js → chunk-55IACEB6-BNbqFUmr.js} +1 -1
  155. package/dist/web/assets/{chunk-727SXJPM-BwlyIOjw.js → chunk-727SXJPM-CVRLzEnd.js} +1 -1
  156. package/dist/web/assets/{chunk-AQP2D5EJ-DKKIRkRv.js → chunk-AQP2D5EJ-WwaaHdh3.js} +1 -1
  157. package/dist/web/assets/{chunk-FMBD7UC4-CVDMj2kX.js → chunk-FMBD7UC4-CTnLqBUW.js} +1 -1
  158. package/dist/web/assets/{chunk-ND2GUHAM-CL-PM6r8.js → chunk-ND2GUHAM-DfNIka0g.js} +1 -1
  159. package/dist/web/assets/{chunk-QZHKN3VN-DPV2KbKZ.js → chunk-QZHKN3VN-BoPlJyiP.js} +1 -1
  160. package/dist/web/assets/classDiagram-4FO5ZUOK-qKmPNr--.js +1 -0
  161. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-qKmPNr--.js +1 -0
  162. package/dist/web/assets/client-D1ri2q1x.js +5 -0
  163. package/dist/web/assets/connection-ChgSscSb.js +380 -0
  164. package/dist/web/assets/cose-bilkent-S5V4N54A-WLT7POr1.js +1 -0
  165. package/dist/web/assets/dagre-BM42HDAG-BXUVmWhW.js +4 -0
  166. package/dist/web/assets/diagram-2AECGRRQ-MZROjHGa.js +43 -0
  167. package/dist/web/assets/diagram-5GNKFQAL-CvgKuYL7.js +10 -0
  168. package/dist/web/assets/{diagram-KO2AKTUF-B75UNw6D.js → diagram-KO2AKTUF-ittFRs4S.js} +2 -2
  169. package/dist/web/assets/diagram-LMA3HP47-BJd5TYg_.js +24 -0
  170. package/dist/web/assets/diagram-OG6HWLK6-Bpiu3NRl.js +24 -0
  171. package/dist/web/assets/{erDiagram-TEJ5UH35-3756GOvS.js → erDiagram-TEJ5UH35-CxnYHs1J.js} +4 -4
  172. package/dist/web/assets/export-mMswqyX7.js +2 -0
  173. package/dist/web/assets/{flowDiagram-I6XJVG4X-DB6Y_UDg.js → flowDiagram-I6XJVG4X-CLYrSoLb.js} +2 -2
  174. package/dist/web/assets/ganttDiagram-6RSMTGT7-61QGJn_n.js +292 -0
  175. package/dist/web/assets/gitGraphDiagram-PVQCEYII-BAhOrVeR.js +106 -0
  176. package/dist/web/assets/highlighted-body-OFNGDK62-SDd5GB8L.js +1 -0
  177. package/dist/web/assets/index-0gPR5d3F.js +1 -0
  178. package/dist/web/assets/index-BA9G_SDz.js +1 -0
  179. package/dist/web/assets/{index-DRMjjql1.js → index-BCIhGPzu.js} +1 -1
  180. package/dist/web/assets/index-BHly9bb_.js +1 -0
  181. package/dist/web/assets/index-BXMQKufW.js +1 -0
  182. package/dist/web/assets/{index-0tHq8zh2.js → index-BcSha9Jz.js} +2 -2
  183. package/dist/web/assets/index-Bdx0etDz.js +1 -0
  184. package/dist/web/assets/index-Bf5YCkSy.js +1 -0
  185. package/dist/web/assets/index-BfAzAzpA.css +1 -0
  186. package/dist/web/assets/{index-C6qeLCPw.js → index-BnWnRbrf.js} +10 -10
  187. package/dist/web/assets/index-Bry0pMwp.js +7 -0
  188. package/dist/web/assets/index-BtPOr38s.js +1 -0
  189. package/dist/web/assets/{index-C7mOS2T4.js → index-C9M75mVg.js} +5 -5
  190. package/dist/web/assets/index-CIiZeIPv.js +1 -0
  191. package/dist/web/assets/index-CX9gQtt9.js +1 -0
  192. package/dist/web/assets/index-CpkOEdmz.js +13 -0
  193. package/dist/web/assets/index-Cy-BfvW9.js +1 -0
  194. package/dist/web/assets/index-CyyQI7pL.js +1 -0
  195. package/dist/web/assets/index-DHMHDDXt.js +1 -0
  196. package/dist/web/assets/index-DRz_-PDL.js +1 -0
  197. package/dist/web/assets/index-DSrINsBp.js +1 -0
  198. package/dist/web/assets/index-DXDJteB5.js +1 -0
  199. package/dist/web/assets/{index-DqK8MfQN.js → index-DibUqmJR.js} +1 -1
  200. package/dist/web/assets/index-DoSMztOD.js +1 -0
  201. package/dist/web/assets/index-DpYi3xv9.js +206 -0
  202. package/dist/web/assets/index-DxlP-RnZ.js +1 -0
  203. package/dist/web/assets/{index-D--cw39y.js → index-Ke_VZNNU.js} +4 -4
  204. package/dist/web/assets/index-h4LfI98N.js +1 -0
  205. package/dist/web/assets/{index-DZMkZKhW.js → index-jXLzpyDX.js} +2 -2
  206. package/dist/web/assets/index-oRr6dIng.js +1 -0
  207. package/dist/web/assets/index-q0pNyABD.js +1 -0
  208. package/dist/web/assets/index-wYbP0VdO.js +3 -0
  209. package/dist/web/assets/infoDiagram-5YYISTIA-ChA8rWAW.js +2 -0
  210. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-ButuBiBW.js → ishikawaDiagram-YF4QCWOH-wAdA3Wum.js} +2 -2
  211. package/dist/web/assets/{journeyDiagram-JHISSGLW-Dlbmqm-j.js → journeyDiagram-JHISSGLW-XQ27BLI2.js} +2 -2
  212. package/dist/web/assets/{kanban-definition-UN3LZRKU-tlQK1cOz.js → kanban-definition-UN3LZRKU-enaS2PwO.js} +6 -6
  213. package/dist/web/assets/{linear-iXuNfUWp.js → linear-dpbaf_C7.js} +1 -1
  214. package/dist/web/assets/memoryAuthority-DU5hzCm_.js +1 -0
  215. package/dist/web/assets/mermaid-GHXKKRXX-B_VPMKIu.css +1 -0
  216. package/dist/web/assets/mermaid-GHXKKRXX-DK-iCZ3T.js +362 -0
  217. package/dist/web/assets/{mindmap-definition-RKZ34NQL-2qPv-mwT.js → mindmap-definition-RKZ34NQL-CCR0JUFu.js} +2 -2
  218. package/dist/web/assets/navViewState-Dx1Fcceg.js +1 -0
  219. package/dist/web/assets/packs-BpjM4FQC.js +1 -0
  220. package/dist/web/assets/pdf-CIFzrehN.js +13 -0
  221. package/dist/web/assets/pieDiagram-4H26LBE5-BaLRkfVx.js +30 -0
  222. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-DfeIFxc0.js → quadrantDiagram-W4KKPZXB-4x90cb4U.js} +2 -2
  223. package/dist/web/assets/{requirementDiagram-4Y6WPE33-BWtjdxie.js → requirementDiagram-4Y6WPE33-CJUCq4Dk.js} +2 -2
  224. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-B5TxJ6mb.js → sankeyDiagram-5OEKKPKP-Bqgmpo8V.js} +2 -2
  225. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-Cf92ZCl1.js → sequenceDiagram-3UESZ5HK-CwReh5y5.js} +2 -2
  226. package/dist/web/assets/sessionList-BPxVFLPa.js +1 -0
  227. package/dist/web/assets/spaces-BeS8BmJE.js +1 -0
  228. package/dist/web/assets/stateDiagram-AJRCARHV-CqH-TMCh.js +1 -0
  229. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-gUjzaHlq.js +1 -0
  230. package/dist/web/assets/theme-gMChIIPj.js +1 -0
  231. package/dist/web/assets/{timeline-definition-PNZ67QCA-CBAOVMfm.js → timeline-definition-PNZ67QCA-DcCNXJwx.js} +2 -2
  232. package/dist/web/assets/uiZoom-Bgw2mRqt.js +1 -0
  233. package/dist/web/assets/vendor-react-C8dhNtzF.js +61 -0
  234. package/dist/web/assets/{vennDiagram-CIIHVFJN-C68x6TdS.js → vennDiagram-CIIHVFJN-CHtc_X23.js} +2 -2
  235. package/dist/web/assets/{wardley-L42UT6IY-DuZZr5jm.js → wardley-L42UT6IY-Bmi7Nc9-.js} +1 -1
  236. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-D6dVGtHd.js → wardleyDiagram-YWT4CUSO-C3By9c62.js} +2 -2
  237. package/dist/web/assets/{xychartDiagram-2RQKCTM6-DYLUhZX4.js → xychartDiagram-2RQKCTM6-v4BXQWoy.js} +2 -2
  238. package/dist/web/icons/apple-touch-icon.png +0 -0
  239. package/dist/web/icons/icon-192.png +0 -0
  240. package/dist/web/icons/icon-512.png +0 -0
  241. package/dist/web/icons/maskable-512.png +0 -0
  242. package/dist/web/index.html +35 -17
  243. package/dist/web/manifest.webmanifest +16 -0
  244. package/dist/web/pdfjs/pdf.worker.min.mjs +1 -1
  245. package/dist/web/theme-boot.js +20 -0
  246. package/native/auth-native/index.cjs +6 -0
  247. package/native/auth-native/index.d.ts +14 -0
  248. package/native/auth-native/package.json +1 -2
  249. package/native/auth-native/prebuilds/darwin-arm64/auth-native.node +0 -0
  250. package/native/auth-native/prebuilds/darwin-x64/auth-native.node +0 -0
  251. package/native/auth-native/prebuilds/linux-arm64/auth-native.node +0 -0
  252. package/native/auth-native/prebuilds/linux-x64/auth-native.node +0 -0
  253. package/native/auth-native/prebuilds/win32-arm64/auth-native.node +0 -0
  254. package/native/auth-native/prebuilds/win32-x64/auth-native.node +0 -0
  255. package/package.json +22 -3
  256. package/dist/web/assets/AppErrorBoundary-BN6IDdP1.js +0 -1
  257. package/dist/web/assets/LifeMark-UBMVaTWr.js +0 -1
  258. package/dist/web/assets/NavScopeBoundary-BCryw-UG.js +0 -1
  259. package/dist/web/assets/architectureDiagram-3BPJPVTR-CbwFBxn7.js +0 -36
  260. package/dist/web/assets/channel-BJs5vJuh.js +0 -1
  261. package/dist/web/assets/classDiagram-4FO5ZUOK-BookeACB.js +0 -1
  262. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BookeACB.js +0 -1
  263. package/dist/web/assets/client-CXcrCawx.js +0 -3
  264. package/dist/web/assets/connection-C8nwzwXB.js +0 -1
  265. package/dist/web/assets/cose-bilkent-S5V4N54A-D1CEiQM6.js +0 -1
  266. package/dist/web/assets/dagre-BM42HDAG-BlFV941E.js +0 -4
  267. package/dist/web/assets/diagram-2AECGRRQ-BC0ldkFY.js +0 -43
  268. package/dist/web/assets/diagram-5GNKFQAL-B22Iej6G.js +0 -10
  269. package/dist/web/assets/diagram-LMA3HP47-CypI7IJM.js +0 -24
  270. package/dist/web/assets/diagram-OG6HWLK6-OsXumvcD.js +0 -24
  271. package/dist/web/assets/export-Bn8PqPg4.js +0 -2
  272. package/dist/web/assets/ganttDiagram-6RSMTGT7-CHJeuoAY.js +0 -292
  273. package/dist/web/assets/gitGraphDiagram-PVQCEYII-Dj85554Y.js +0 -106
  274. package/dist/web/assets/highlighted-body-OFNGDK62-DMgPHetp.js +0 -1
  275. package/dist/web/assets/index-7ySDqvaN.css +0 -1
  276. package/dist/web/assets/index-B0KPRi1U.js +0 -166
  277. package/dist/web/assets/index-B599VnpP.js +0 -1
  278. package/dist/web/assets/index-BFK-GypQ.js +0 -1
  279. package/dist/web/assets/index-BPX8gmpB.js +0 -1
  280. package/dist/web/assets/index-BSGYc1tb.js +0 -1
  281. package/dist/web/assets/index-BTt9Q5iv.js +0 -1
  282. package/dist/web/assets/index-BWzUsoY_.js +0 -1
  283. package/dist/web/assets/index-BYlSV3FO.js +0 -3
  284. package/dist/web/assets/index-BpXQ1q-u.js +0 -1
  285. package/dist/web/assets/index-BqPxpGUh.js +0 -1
  286. package/dist/web/assets/index-C8OFfbEs.js +0 -1
  287. package/dist/web/assets/index-CI7yuMGZ.js +0 -1
  288. package/dist/web/assets/index-CJqIcuAl.js +0 -1
  289. package/dist/web/assets/index-CTRJmDep.js +0 -1
  290. package/dist/web/assets/index-CXGCKoId.js +0 -1
  291. package/dist/web/assets/index-CsY571EL.js +0 -13
  292. package/dist/web/assets/index-CwQG_9rB.js +0 -1
  293. package/dist/web/assets/index-D260jsUJ.js +0 -1
  294. package/dist/web/assets/index-DJjmEXx4.js +0 -1
  295. package/dist/web/assets/index-DUxOVxHS.js +0 -1
  296. package/dist/web/assets/index-DxUmR9aV.js +0 -1
  297. package/dist/web/assets/index-GK8aa9pT.js +0 -7
  298. package/dist/web/assets/index-bYtKyBMB.js +0 -1
  299. package/dist/web/assets/index-wxHFHTgD.js +0 -1
  300. package/dist/web/assets/infoDiagram-5YYISTIA-DeDPIdEH.js +0 -2
  301. package/dist/web/assets/mermaid-GHXKKRXX-sDJax95P.js +0 -624
  302. package/dist/web/assets/pdf-C-olXVQ4.js +0 -12
  303. package/dist/web/assets/pieDiagram-4H26LBE5-CrLe1C-O.js +0 -30
  304. package/dist/web/assets/spaces-DqMTtCXX.js +0 -1
  305. package/dist/web/assets/stateDiagram-AJRCARHV-NR9I-Q4d.js +0 -1
  306. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BiegFWxE.js +0 -1
  307. package/dist/web/assets/theme-6OL1RXgY.js +0 -1
@@ -1,11 +1,11 @@
1
1
  # Data locations
2
2
 
3
- Kiki stores its runtime data — the config files, session history, login credentials, and diagnostic logs — under `~/.kiki/` by default. This page helps you understand where each type of data lives, what it is for, and how to clean up or relocate it when needed.
3
+ Kiki stores its runtime data — the config files, session history, login credentials, and diagnostic logs — under `<home>` on the server host. `<home>` means the current Space's resolved Kiki home; `~/.kiki/` is only the default when no supported explicit `--home` or `KIKI_HOME` selects another path. This page helps you understand where each type of data lives, what it is for, and how to clean up or relocate it when needed.
4
4
 
5
5
  ::: warning Desktop OAuth credentials have a separate default
6
- When `KIKI_HOME` is unset, the desktop app keeps its runtime data (config, sessions, `server.token`) in `~/.kiki/`, but its OAuth credentials default to the compatibility home `~/.kimi-code/` (`~/.kimi-code/credentials/`). If you already have a Moonshot `~/.kimi-code/credentials/kimi-code.json`, the desktop app uses that token instead of starting logged out — and deleting `~/.kiki/` does **not** clear it. Running `kiki login` writes the token to `~/.kiki/credentials/`, so a daemon started outside the desktop environment does not see the desktop's credentials.
6
+ When no supported explicit `--home` is selected and `KIKI_HOME` is unset, the desktop app keeps its runtime data (config, sessions, `server.token`) in `~/.kiki/`, but its OAuth credentials default to the compatibility home `~/.kimi-code/` (`~/.kimi-code/credentials/`). If you already have a Moonshot `~/.kimi-code/credentials/kimi-code.json`, the desktop app uses that token instead of starting logged out — and deleting `~/.kiki/` does **not** clear it. Running `kiki login` writes the token to `~/.kiki/credentials/`, so a daemon started outside the desktop environment does not see the desktop's credentials.
7
7
 
8
- Setting `KIKI_HOME` moves both the runtime data and the desktop OAuth credentials to that path. The desktop app also lets you pick the compatibility home in its settings. The kimi-cli-era `~/.kimi` directory is never read and is not imported.
8
+ Setting `KIKI_HOME` moves the runtime data and desktop OAuth credentials selected by that home. The desktop app also lets you pick the compatibility home in its settings. The kimi-cli-era `~/.kimi` directory is never read and is not imported.
9
9
  :::
10
10
 
11
11
  ## Data root directory
@@ -22,11 +22,11 @@ If you need to move the data directory elsewhere (for example, to isolate config
22
22
  export KIKI_HOME="$HOME/.config/kiki"
23
23
  ```
24
24
 
25
- Once set, **all** Kiki data — config, provider credentials, sessions, logs, OAuth credentials, Kiki-specific user Skills, global `AGENTS.md`, and more — lands under the new path. For the full reference on `KIKI_HOME`, see [Environment variables](./env-vars.md).
25
+ Once resolved, current config, sessions, memory, logs, and other runtime data belong under `<home>`. A base home can supply selected inherited resources, and shared credentials may use that base when configured; this does not mean every Kiki file moves to or is shared from the same path. For shell paths, quote the current home as `"$KIKI_HOME/..."` when that environment variable names `<home>`. For the full reference on `KIKI_HOME`, see [Environment variables](./env-vars.md).
26
26
 
27
27
  ::: tip Note
28
28
 
29
- **Generic `.agents` resources** stay under the real OS home so they can be shared across tools. For example, user-level generic Skills remain at `~/.agents/skills/`, while Kiki-specific user Skills move with `KIKI_HOME` as `$KIKI_HOME/skills/`.
29
+ **Generic `.agents` resources** stay under the real OS home so they can be shared across tools. For example, user-level generic Skills remain at `~/.agents/skills/`, while Kiki-specific user Skills move with the current home as `"$KIKI_HOME/skills/"` when `KIKI_HOME` names it.
30
30
  :::
31
31
 
32
32
  ## Directory layout
@@ -57,7 +57,8 @@ $KIKI_HOME (default: ~/.kiki)
57
57
  ├── store/
58
58
  │ └── thread-mailbox-sqlite-v1/ # Canonical mailbox and upgrade recovery copies
59
59
  ├── server/
60
- │ └── events/ # Bounded client event replay journals
60
+ │ ├── events/ # Bounded client event replay journals
61
+ │ └── history-navigation.sqlite # Derived history navigation index
61
62
  ├── bin/
62
63
  │ ├── rg # managed ripgrep binary for Grep (rg.exe on Windows)
63
64
  │ └── fd # managed fd binary for file references (fd.exe on Windows)
@@ -78,7 +79,7 @@ Each file under the data root serves a specific purpose; most are managed automa
78
79
  - **`mcp.json`**: user-level MCP server declarations, merged with the project-local `.kiki/mcp.json` on startup. See [MCP](../server/mcp.md).
79
80
  - **`skills/`**: Kiki-specific user-level Skills. This directory moves with `KIKI_HOME`; generic cross-tool Skills can still live under `~/.agents/skills/`. See [Agent Skills](../customization/skills.md).
80
81
  - **`cognition/`**: prompt files referenced by `[models."<alias>".cognition]`; paths are relative to the data root. See [Model cognition](./config-files.md#model-cognition).
81
- - **`hooks/`**: script files referenced by `[[hooks]]` command paths (for example `node ~/.kiki/hooks/check-bash.mjs`). See [Hooks](../customization/hooks.md).
82
+ - **`hooks/`**: script files referenced by `[[hooks]]` command paths (for example `node "$KIKI_HOME/hooks/check-bash.mjs"` for the current home). See [Hooks](../customization/hooks.md).
82
83
  - **`plugins/installed.json`**: records installed plugins, each plugin's enabled state, and MCP server capability state changes made via `/plugins` or `/plugins mcp disable|enable`. Files installed from local paths or zip URLs are copied to `plugins/managed/<id>/`. See [Plugins](../customization/plugins.md).
83
84
  - **`credentials/`**: restricted credential directory, with requested permissions `0o700` (directory) / `0o600` (files). OAuth logins for managed providers are stored as `credentials/<name>.json`; MCP server credentials are stored under `credentials/mcp/`. On Windows, check the file and parent-directory ACLs yourself before relying on the file to stay private.
84
85
  - **`workspaces.json` and `workspaces/`**: the registered workspace catalog and the project directories Kiki creates when a new session has no selected workspace. Each automatically created session receives a distinct directory; these are working files, separate from the session history under `sessions/`.
@@ -110,13 +111,13 @@ This retention does not remove `sessions/`, agent `wire.jsonl` files, or saved m
110
111
 
111
112
  `store/thread-mailbox-sqlite-v1/` contains durable peer messages, delivery state, idempotency receipts, activity cursors, and workspace overrides. Unlike the search and query caches, these records are authoritative and must not be deleted to trigger a rebuild. `authority.json` selects `mailbox-<migrationId>.sqlite`; keep the adjacent `-wal` and `-shm` files while it is open. Use [`kiki storage backup`](../reference/command.md#kiki-storage) for a consistent SQLite copy instead of copying only a live `.sqlite` file.
112
113
 
113
- The 0.5.x upgrade retains its checkpoint in `migration.json`, its source backup under `recovery/<migrationId>/sources/`, and moved originals under `recovery/<migrationId>/originals/`. The former `store/thread-mailbox-v3`, `store/thread-mailbox-v1`, and `store/agent-collaboration-mailbox-v2` directory names become fence files. Keep these files: they stop older versions from reopening those locations as writable mailboxes. Do not point an old binary at the recovery copies. Run `kiki storage status` to inspect recovery state and `kiki storage migrate` to resume; follow the [storage command's rollback rules](../reference/command.md#kiki-storage) rather than moving original directories back by hand.
114
+ The 0.5.x upgrade retains its checkpoint in `migration.json`, frozen source copies under `recovery/<migrationId>/sources/`, and moved originals under `recovery/<migrationId>/originals/`. The former `store/thread-mailbox-v3`, `store/thread-mailbox-v1`, and `store/agent-collaboration-mailbox-v2` directory names become fence files. Keep the originals and fences: older versions must not reopen those locations as writable mailboxes, and the originals also retain older activity records. Do not point an old binary at the recovery copies. Run `kiki storage status` to inspect recovery state and `kiki storage migrate` to resume. After rollback is no longer possible, [`kiki storage cleanup-recovery`](../reference/command.md#kiki-storage) can preview and, with a verified independent SQLite backup and explicit confirmation, remove only `sources/` files that match the originals. Never remove these directories manually; follow the [storage command's rollback rules](../reference/command.md#kiki-storage) rather than moving originals back by hand.
114
115
 
115
116
  ## Session and usage query cache
116
117
 
117
- `cache/query-store-sqlite-v1/index.sqlite` holds the SQLite query cache for session lists, usage facts, and thread-turn lookups. Kiki rebuilds these views from session metadata, usage-fact journals, and conversation history when needed. The database may have adjacent `-wal` and `-shm` files while it is open.
118
+ `cache/query-store-sqlite-v1/index.sqlite` holds the SQLite query cache for session lists and thread-turn lookups. Usage facts and source coverage use a separate database at `cache/usage-read-model-v2/index.sqlite`. Conversation history navigation (`HistoryList`, `HistoryRead`, `HistorySearch`, and older transcript detail lookups) uses a derived SQLite index at `server/history-navigation.sqlite` inside a dedicated background worker; when upgrading from an earlier index format, Kiki automatically resets and compacts `server/history-navigation.sqlite` on first use and rebuilds slices on demand from `wire.jsonl`, so continuation cursors issued before the rebuild restart from a fresh query. Kiki rebuilds these views from session metadata, usage-fact journals, retained accounting ledgers, and conversation history when needed. Each open database may have adjacent `-wal` and `-shm` files.
118
119
 
119
- If this cache is damaged, stop every Kiki process using the data root, back up and remove only `cache/query-store-sqlite-v1/`, then restart. Rebuilding a large history can take several requests; Usage reports incomplete coverage until preparation finishes. Keep `cache/usage-facts-v1/`, `sessions/`, and `store/`: they contain the journals and records needed for recovery. The older `cache/query-store-v*/` directories are separate from the SQLite cache and are not imported by this backend.
120
+ If one cache is damaged, stop every Kiki process using the data root, back up and remove only that cache directory, then restart. Rebuilding a large Usage history can take several requests; committed import progress survives a restart. Keep `cache/usage-facts-v1/`, `sessions/`, and `store/`: they contain the journals and records needed for recovery, including standalone requests such as Output Layer transformations in `store/session-operations-v1.jsonl`. Keep `store/deleted-private-sessions/` as well: it prevents previously recorded usage from deleted private sessions from reappearing after a rebuild. Older generic Usage collections and `cache/query-store-v*/` directories are retained for rollback; do not remove the shared query database to reset Usage.
120
121
 
121
122
  ## Content search index
122
123
 
@@ -130,10 +131,17 @@ Search is available by default. `[search] enabled = false`, `KIKI_SEARCH_DISABLE
130
131
 
131
132
  The first time the `Grep` tool needs ripgrep, the CLI can automatically download `rg` and cache it at `bin/rg` (`bin/rg.exe` on Windows). File-reference completion in the terminal UI uses `fd`; the CLI downloads and caches it at `bin/fd` (`bin/fd.exe` on Windows) in the background when needed. Subsequent runs reuse the cached binaries. `rg` prefers the system `PATH` before the cache, while `fd` checks the managed cache before falling back to system `fd` / `fdfind`. Deleting the `bin/` directory triggers a fresh download on the next use.
132
133
 
134
+ Registered local workspaces with at least 1,500 files also use a derived content index at `cache/workspace-trigram-v1/<root-hash>.sqlite`. Kiki builds it in background workers and uses ordinary filesystem search while it is unavailable or updating. To rebuild it, stop Kiki and remove only `cache/workspace-trigram-v1/`; the workspace files are unchanged.
135
+
133
136
  ## Logs
134
137
 
135
138
  - **`logs/kimi-code.log`** (global): records startup, login, export, and other cross-session events.
136
139
  - **`<sessionDir>/logs/kimi-code.log`** (session-level): records diagnostic events within a single session.
140
+ - **`logs/server-runtime.log`**: synchronous daemon startup, shutdown, uncaught-error and exit records, with process ID and memory counters; rotates at 1 MiB with one backup.
141
+ - **`logs/desktop-backend.log`**: desktop backend stderr and the desktop owner's observed exit code or signal, including when the backend cannot write its own final record.
142
+ - **`logs/reports/`**: Node.js reports for fatal errors such as heap exhaustion. Environment variables and network details are excluded; inspect reports before sharing because file paths and error text remain. Reports are retained until you remove them.
143
+
144
+ When investigating a daemon restart, keep `server-runtime.log`, `desktop-backend.log`, their backups and any matching report. In `server-runtime.log`, `closed` records the daemon's cleanup result and the runtime resources still active at that point; look for `exit` or the desktop owner's exit record to confirm the process stopped. The desktop also uses `server/explicit-exit.json` to distinguish a requested stop from a crash. Leave that file in place while troubleshooting a restart.
137
145
 
138
146
  When reporting a bug, prefer exporting the relevant session with `kiki export` (see [kiki command](../reference/command.md)); the session log is included in the export by default. Add `--no-include-global-log` if you do not want to share the global log.
139
147
 
@@ -12,9 +12,17 @@ The separate `KIKI_MODEL_*` family can supply a temporary model and key — see
12
12
 
13
13
  ## Core paths
14
14
 
15
+ ### Current Kiki home
16
+
17
+ `<home>` means the resolved Kiki home for the current Space on the server host. For a subcommand that supports `--home`, Kiki resolves it in this order: explicit `--home` > `KIKI_HOME` > the OS home default `~/.kiki`. Only subcommands that document `--home` accept that explicit override; the root `kiki` command does not. `KIMI_CODE_HOME` does not select this home — it is reserved for vendor Kimi Code integrations, such as an external Kimi CLI or its OAuth credential directory.
18
+
19
+ Local child processes inherit the current Space's Kiki home by default. An explicit `KIKI_HOME` supplied in a child environment still overrides that default. SSH and other remote children do not receive the local Kiki home; they resolve their own home on the remote host.
20
+
21
+ Use `<home>` for current config, sessions, memory, and logs. A base home can supply selected inherited resources, and shared credentials may use that base when configured; this does not mean every file moves to or is shared from the same path. In shell examples, quote paths as `"$KIKI_HOME/..."` when `KIKI_HOME` names the current home.
22
+
15
23
  ### `KIKI_HOME`
16
24
 
17
- Overrides the data root directory; the default is `~/.kiki`. Once set, the config and credentials files, sessions, logs, OAuth credentials, and all other data land under the new path. The desktop app's OAuth credentials follow `KIKI_HOME` too: unset, they default to the compatibility home `~/.kimi-code/` (see [Data locations](./data-locations.md)).
25
+ Selects the runtime home when no supported command-specific `--home` is supplied; the default is `~/.kiki`. Once resolved, config and credentials files, sessions, logs, OAuth credentials, and other runtime data use that home subject to the inheritance and shared-credential rules above. The desktop app's OAuth credentials follow `KIKI_HOME` too: when it is unset, they default to the compatibility home `~/.kimi-code/` (see [Data locations](./data-locations.md)).
18
26
 
19
27
  ```sh
20
28
  export KIKI_HOME="/path/to/custom/kiki"
@@ -144,7 +152,7 @@ Switches that control the behavior of subsystems such as background tasks, the b
144
152
  | `KIKI_MCP_TOOL_TIMEOUT_MS` | Global default single tool-call timeout (ms) for all MCP servers; takes higher priority than `[mcp] tool_timeout_ms` in `config.toml`, but a per-server `toolTimeoutMs` in `mcp.json` still wins (default `60000`) | Integer from `1` to `2147483647`; invalid values are ignored |
145
153
  | `KIKI_LOOP_MAX_STEPS_PER_TURN` | Maximum Agent steps per turn; takes higher priority than `[loop_control] max_steps_per_turn` in `config.toml` (unset or `0` means unlimited) | Non-negative integer; invalid values are ignored |
146
154
  | `KIKI_LOOP_MAX_ATTEMPTS_PER_STEP` | Maximum total attempts for a failing step (including the initial attempt); takes higher priority than `[loop_control] max_attempts_per_step` in `config.toml` (default `5`) | Non-negative integer; invalid values are ignored |
147
- | `KIKI_INFINITE_RETRY` | Retry failed LLM requests indefinitely, including turn steps, compaction, HTTP 400/404, and quota errors. Waits use exponential backoff (capped at 32 s) and honor `Retry-After`. Does not override cancellation, local admission denials, observed output or tool execution, `retry = false`, or per-request `retry: 'never'`; the one-use [`Continue.` request](./config-files.md#loop-control) is never retried. Context overflow still uses context recovery. Intended for unattended evaluations against temporarily failing endpoints | Truthy: `1`/`true`/`yes`/`on`; falsy: `0`/`false`/`no`/`off` |
155
+ | `KIKI_INFINITE_RETRY` | Retry failed LLM requests indefinitely, including turn steps, compaction, HTTP 400/404, and quota errors. Waits use exponential backoff (capped at 32 s) and honor `Retry-After`. Connection interruptions in native turns still use the [bounded retry budget](./config-files.md#retry), so this setting does not replay partial responses indefinitely. Compaction stream interruptions after partial output still use `compaction_max_attempts`. Does not override cancellation, local admission denials, refusals, provider-hosted tool output, `retry = false`, or per-request `retry: 'never'`; the one-use [`Continue.` request](./config-files.md#loop-control) is never retried. Context overflow still uses context recovery. Intended for unattended evaluations against temporarily failing endpoints | Truthy: `1`/`true`/`yes`/`on`; falsy: `0`/`false`/`no`/`off` |
148
156
  | `KIKI_TOKEN_COUNTING_STRATEGY` | Which context token count is reported externally (the context-size display); takes higher priority than `[token_counting] strategy` in `config.toml` (default `measured+estimated`) | `measured+estimated`, `measured`, `estimated` (case-insensitive); invalid values are ignored |
149
157
  | `NB_SEARCH_CONFIG` | Path to a canonical JSON configuration for the built-in search and retrieval module, loaded before Kiki's `[nb_search]` patch | File path |
150
158
  | `NB_SEARCH_HOME` | Data directory for the built-in search and retrieval module | Directory path |
@@ -164,6 +172,28 @@ Switches that control the behavior of subsystems such as background tasks, the b
164
172
  | `KIKI_MODEL_THINKING_KEEP` | Preserved-thinking passthrough; on `kimi` sent as `thinking.keep`, on `anthropic` (Claude and Kimi's Anthropic-compatible mode) sent as a `context_management` `clear_thinking_20251015` edit (enabling keep routes Anthropic requests to the beta Messages API); overrides `[thinking] keep` (which defaults to `"all"`); only injected while Thinking is on | A value the API accepts, e.g. `all`; an off-value (`false`/`0`/`no`/`off`/`none`/`null`) disables it |
165
173
  | `KIKI_DISABLE_CRON` | Disable the scheduled-task tool (a `Cron` call with `action: "create"` is refused; existing tasks do not fire) | `1` to disable |
166
174
 
175
+ ## Resource overrides
176
+
177
+ The hardware-scaled defaults are described in [configuration files](./config-files.md#hardware-scaled-resource-defaults). The variables below override only the named resource; they do not rewrite `config.toml`.
178
+
179
+ | Variable | Purpose | Valid values and timing |
180
+ | --- | --- | --- |
181
+ | `KIKI_CPU_MAX_WORKERS` | Override `[cpu_workers].max_workers` | Positive integer; read when the App service starts. The effective pool still caps at `C - 1` |
182
+ | `KIKI_CPU_MAX_QUEUE` | Override `[cpu_workers].max_queue` | Positive integer; read when the App service starts |
183
+ | `KIKI_CPU_MAX_QUEUED_BYTES` | Override `[cpu_workers].max_queued_bytes` | Positive integer bytes; read when the App service starts |
184
+ | `KIKI_CPU_TIMEOUT_MS` | Override `[cpu_workers].timeout_ms` | Positive integer up to `2147483647`; read when the App service starts |
185
+ | `KIKI_SEARCH_INDEXER_SOFT_MB` / `KIKI_SEARCH_INDEXER_HARD_MB` | Override the search indexer's soft or hard RSS budget | Positive integer MiB. An explicit search-host option wins, then the environment variable, then the hardware default `2H + 256` / `3H + 256` MiB |
186
+ | `KIKI_DESKTOP_BUNDLED` | Mark the process as the bundled desktop sidecar for watchdog defaults | `1` enables bundled defaults; unset or another value leaves defaults off unless a threshold override is set |
187
+ | `KIKI_SERVER_HEAP_RESTART_MB` | Override the desktop sidecar heap watchdog threshold | Positive integer MiB; `0` disables the heap metric. The default is 75% of the effective V8 heap |
188
+ | `KIKI_SERVER_RSS_RESTART_MB` | Override the desktop sidecar RSS watchdog threshold | Positive integer MiB; `0` disables the RSS metric. The default is `max(3 GiB, 35% of total memory)` |
189
+ | `KIKI_SERVER_EXTERNAL_RESTART_MB` | Override the desktop sidecar external-memory watchdog threshold | Positive integer MiB; `0` disables the external metric. The default is `max(1.5 GiB, total memory / 16)` and it remains eligible only when RSS is at least 3 GiB |
190
+
191
+ The desktop watchdog samples every 30 seconds. Its defaults apply to the bundled desktop sidecar; explicit variables apply on any host. The desktop launcher injects a sidecar target of `max(8192, floor(totalmem / MiB / 4))` MiB. Native SEA profiles use `execArgv=[]` and `execArgvExtension="env"`, so the user's `NODE_OPTIONS` remains authoritative. Foreground `serve`, non-login `acp`, and in-process prompt runs (`-p`, `--prompt`, or `--prompt-file`) re-exec at most once when the current heap is below 90% of the target and no user heap override exists. The default interactive `kiki`, resume/continue, `web`, and `serve --ensure/--query/--stop` are daemon clients and do not auto-restart. A newly spawned daemon receives its target before launch. `--version`, tool calls, and completion do not restart.
192
+
193
+ The CLI accepts legacy `--node-options` only for heap-related flags; other flags produce an error rather than being discarded. Put other supported Node flags in `NODE_OPTIONS`. Entrypoints preserve the user's original `NODE_OPTIONS` and remove only Kiki's one-time heap override before spawning child processes.
194
+
195
+ Kiki-owned CLI/SEA entries enable independent worker heaps once before creating workers. SDK imports do not change process-wide flags. If an SDK host starts Node with `--max-old-space-size` or its percentage form, that global setting can override `Worker.resourceLimits`. To opt in to independent limits, call `enableIndependentWorkerHeaps` from `@kiki/node-sdk/worker-heap-policy` before creating workers. This changes the V8 default for all later isolates in the host process, not just Kiki workers, and depends on Node/V8 behavior; set the main heap at process startup. Workers warn if their observed heap limit differs substantially from the requested budget.
196
+
167
197
  Subagent concurrency has no environment-variable override. Configure [`[subagent]`](./config-files.md#subagent) with `max_direct_children` and `max_total_subagents`; their defaults are `16` and `0` (unlimited), respectively.
168
198
 
169
199
  `[subagent].default_model` supplies a model only when dispatch parameters and effective pins do not. It never inherits the caller's model, and neither it nor a forced environment value can bypass a profile's hard model rules. `[subagent].default_effort` was removed and is no longer read — startup warns about it; set an effort pin on the profile, route, or caller lease, or let the selected model use its own default.
@@ -100,7 +100,7 @@ When a profile binds — a new main session, a new subagent, a model switch, or
100
100
 
101
101
  If none of those produces a value, or the resulting effort is not one the model supports, the bind fails as a configuration error rather than silently picking something. With no model configured at all, the bind asks for both a model and an effort. You do not have to pass an effort when a route, lease, profile pin, or model default already supplies one; you need one only when nothing else does, in which case configure that pin or pass `effort` for this call.
102
102
 
103
- This applies to profile binding only. A plain resume that keeps an existing valid binding is not recomputed, so an effort saved earlier keeps working. Changing only `effort` keeps the saved model, and changing model on resume still requires `allow_model_change: true`.
103
+ This applies to profile binding only. A plain resume that keeps an existing valid binding is not recomputed, so an effort saved earlier keeps working. Changing only `effort` keeps the saved model, and changing model on resume requires an explicit [`context_mode`](../customization/agents-and-subagents.md#named-child-agents) or the legacy `allow_model_change: true` / `new_window: true` confirmation.
104
104
 
105
105
  Paths that do not bind a profile are unchanged: the global `[thinking]` section still supplies its fallback, and `[thinking].enabled = false` still resolves an unpinned effort to Off there.
106
106
 
@@ -4,7 +4,7 @@ Kiki can connect to multiple model providers at once. An API key is the most gen
4
4
 
5
5
  ## Supported provider types
6
6
 
7
- The `type` field in the `providers` table sets the default request format (the API payload and endpoint), which individual models can override with `protocol`:
7
+ The `type` field in the `providers` table selects the connection's request format (the API payload and endpoint). Chat models can override their connection's format with `protocol`; decision connections use the format of the connection itself:
8
8
 
9
9
  | Type | Protocol | Typical use |
10
10
  | --- | --- | --- |
@@ -14,10 +14,58 @@ The `type` field in the `providers` table sets the default request format (the A
14
14
  | `openai_responses` | OpenAI Responses API | OpenAI's newer Responses interface |
15
15
  | `google-genai` | Google GenAI | Gemini API |
16
16
  | `vertexai` | Google GenAI on Vertex | Google Cloud Vertex AI |
17
+ | `openai_decisions` | OpenAI Decisions | Native `/v1/decisions` services; permission review and memory recommendations |
18
+ | `system_one` | System One | Decision services such as Jev; permission review and memory recommendations |
19
+ | `pair_score` | Reranking scores | Memory ranking with compatible rerankers or classifiers |
17
20
 
18
- All providers communicate with models in streaming mode by default. Capabilities such as thinking, vision, and tool use are matched automatically by model name prefix — you typically do not need to declare them manually.
21
+ Chat connections stream by default. Capabilities such as thinking, vision, and tool use are matched automatically by model name prefix — you typically do not need to declare them manually. Decision connections return judgments or scores and do not add entries to the chat model catalog.
19
22
 
20
- **Credential priority**: a model's own credential wins; otherwise Kiki uses the provider's `api_key`, then its explicitly configured `api_key_env` variable. Without `api_key_env`, the existing `[providers.<name>.env]` credential fallback remains unchanged. Shell variables are not read automatically. See [Config overrides: provider credentials](./overrides.md#provider-credentials) for the full priority and an environment-variable example.
23
+ **Credential priority**: a model's own credential wins; otherwise Kiki uses the provider's `api_key`, then its explicitly configured `api_key_env` variable. Without `api_key_env`, the existing `[providers.<name>.env]` credential fallback remains unchanged. The `system_one` type provides the TypeSafe default address; its implicit `TYPESAFE_API_KEY` fallback applies only to the `https://api.typesafe.ai` origin. For another service, select its key or environment variable explicitly, or leave credentials unset when it needs none. See [Config overrides: provider credentials](./overrides.md#provider-credentials) for the full priority and an environment-variable example.
24
+
25
+ ### Decision connections
26
+
27
+ A decision connection owns its address, protocol, and credentials, or attaches decision protocols onto an existing chat provider. Permission review and [Memory Advisor](../guides/memory.md#memory-advisor) can reference the same connection while each keeps its own source choice and behavior settings. Use a compatible service's address and remote model name; no local chat model or context size is needed.
28
+
29
+ This example shares one Jev connection, using the server's existing environment variable:
30
+
31
+ ```toml
32
+ [providers.judgment]
33
+ type = "system_one"
34
+ base_url = "https://api.typesafe.ai/v1"
35
+ api_key_env = "TYPESAFE_API_KEY"
36
+ default_model = "jev-latest"
37
+
38
+ [permission.reviewer]
39
+ source = { kind = "connection", connection = "judgment" }
40
+
41
+ [memory.advisor]
42
+ source = { kind = "connection", connection = "judgment" }
43
+ ```
44
+
45
+ When your chat gateway also serves `/v1/decisions`, System One, or a reranker on the same origin, attach `[providers.<name>.decision.<protocol>]` instead of creating a second connection with a duplicate API key:
46
+
47
+ ```toml
48
+ [providers.gateway]
49
+ type = "openai"
50
+ base_url = "https://example.com/v1"
51
+
52
+ [providers.gateway.decision.openai_decisions]
53
+ model = "decisions-model"
54
+
55
+ [permission.reviewer]
56
+ source = { kind = "connection", connection = "gateway", protocol = "openai_decisions" }
57
+
58
+ [memory.advisor]
59
+ source = { kind = "connection", connection = "gateway", protocol = "openai_decisions" }
60
+ ```
61
+
62
+ `default_model` (or `model` inside `[providers.<name>.decision.<protocol>]`) is the name sent to the remote decision service. A source can override it with `model`, or select an existing chat alias with `{ kind = "model", model = "review-model" }`. Changing one consumer's source does not change the other. [Memory Advisor](../guides/memory.md#memory-advisor) uses the source when enabled; saving a source preserves an existing off switch.
63
+
64
+ For a standalone OpenAI Decisions service, use `type = "openai_decisions"` (defaults `base_url` to `https://api.openai.com/v1`). For a reranker, use `type = "pair_score"`, its `base_url`, and its remote `default_model`. Pair scores support memory **Rank**, not **Select** or permission review. By default, requests append `/decisions`, `/systemone`, or `/rerank` to the base path. Set `decision_endpoint` on a standalone connection (or `endpoint` inside `[providers.<name>.decision.<protocol>]`) to a path or complete URL when the service needs another route; it must share the base URL's scheme, host, and port and contain no embedded credentials.
65
+
66
+ Decision services use the existing provider credential fields and custom headers. A service that accepts unauthenticated HTTP requests can leave credentials unset. An explicitly selected `api_key_env` that has no value and no alternative authentication reports an authentication issue; an upstream 401 or 403 does too. Store API keys through the existing connection credential field or `credentials.toml`, not a second consumer-specific key field. The [decision probe](../server/rest-api.md#decision-connections) tests the selected service with synthetic content.
67
+
68
+ Existing Reviewer `backend = "jev"` and advisor `selector` configurations continue working. The explicit [move Reviewer key](../server/rest-api.md#decision-connections) action transfers a saved legacy key on the server, switches the Reviewer source, then clears that old key. A partial result preserves newer settings: refresh and check the connection and Reviewer before retrying. If the Reviewer key has changed while the target connection still holds the old key, choose a new connection name; conflicting connections are never overwritten. Environment-variable connections require no key transfer.
21
69
 
22
70
  ### Model request format overrides
23
71
 
@@ -83,11 +131,11 @@ dictionary = true
83
131
 
84
132
  `dictionary = true` asks the gateway to cache exact request bytes, which can include messages, media, tool results, and signatures. Kiki keeps acknowledged dictionaries only in bounded process memory, for up to ten minutes. A dictionary acknowledgement confirms cached bytes, not completed model generation. Every request is still built from the full local history; a changed or compacted history is never reconstructed from guessed model output.
85
133
 
86
- Only a marked, pre-execution decoding rejection permits an encoding fallback, with at most three attempts. Transport failures and temporary provider errors before any output use the existing [request retry policy](./config-files.md#retry), even when delivery is uncertain. Partial output or observed tool execution prevents resending that generation; completed tool results remain in local history. If a target does not support compression, disable it before starting a new request rather than relying on automatic format probing.
134
+ Only a marked, pre-execution decoding rejection permits an encoding fallback, with at most three attempts. Transport failures and temporary provider errors before any output use the existing [request retry policy](./config-files.md#retry), even when delivery is uncertain. Native agent turns also retry connection interruptions after partial output by default. Other protocols discard the failed attempt's output; Google GenAI keeps visible text and thinking summaries pending, reuses only exact visible prefixes, retracts divergent or prematurely truncated blocks, and uses only a complete continuation token at the latest output checkpoint. Unfinished tool calls are retracted, and tools run only after a complete response. Failed generations may incur additional charges; set `[retry] retry_partial_responses = false` to disable partial-response replay. Completed tool results remain in local history and are not executed again by this retry. If a target does not support compression, disable it before starting a new request rather than relying on automatic format probing.
87
135
 
88
136
  ## Incremental Responses over WebSocket
89
137
 
90
- Responses WebSocket stays off until you configure it. `[responses_web_socket]` applies to every provider that does not set its own table. A provider table replaces that value as a whole. `targets`, when set on the provider, replaces the system list in order and is not added to it. Omit the provider key to inherit. `off = true` keeps that provider on ordinary HTTP even when the system table lists targets. With no system table, only providers that set `responses_web_socket` open a socket. Saving either table applies on the next model request. An idle socket closes immediately; a socket serving an in-flight request stays open until that request completes, fails, or is canceled, then the next request uses a new connection.
138
+ Responses WebSocket stays off until you configure it. `[responses_web_socket]` applies to every provider that does not set its own table. A provider table replaces that value as a whole. `targets`, when set on the provider, replaces the system list in order and is not added to it. Omit the provider key to inherit. `off = true` keeps that provider on ordinary HTTP even when the system table lists targets. With no system table, only providers that set `responses_web_socket` open a socket. Saving either table applies before the next send, including attempts waiting for a request slot or retry backoff. Each attempt checks the current targets and `off` setting after it gets a slot. An idle socket closes immediately; an already-sent request drains until it completes, fails, or is canceled. If the socket retires during the handshake before sending the request, the attempt uses ordinary HTTP. The next attempt uses a fresh connection or ordinary HTTP under the current setting.
91
139
 
92
140
  For a gateway that advertises the version 1 `X-Responses-WebSocket-Capabilities` handshake, opt in to connection-local Responses history:
93
141
 
@@ -103,11 +151,19 @@ base_url = "https://example.com/v1"
103
151
  off = true
104
152
  ```
105
153
 
106
- The target must match the origin and path boundary of the Responses endpoint. A saved target does not skip the handshake. Kiki uses the official OpenAI SDK, keeps one socket per Agent, and sends only new input when the previous completed response still matches the local history. Helper requests, other Agents, and forks do not share that history. Canceling a request closes its socket; model, credentials, policy, and context changes reset the connection or send a full request. Remove the provider table to inherit again, or set `off = true` to keep ordinary HTTP for that provider. Remove the system table to leave every unset provider on ordinary HTTP.
154
+ The target must match the origin and path boundary of the Responses endpoint. A saved target does not skip the handshake. Kiki uses the official OpenAI SDK, keeps one socket per Agent, and sends only new input when the previous completed response still matches the local history. When the gateway also advertises `codex_turn_metadata_per_frame: true`, per-turn Codex turn metadata updates stay on the same socket and incremental history as long as the session, thread, installation, and window identity is unchanged; this saves bytes between Kiki and the gateway while the gateway may still rebuild the full history for its upstream connection. Helper requests, other Agents, and forks do not share that history. Canceling a request closes its socket; model, credentials, policy, and context changes reset the connection or send a full request. Remove the provider table to inherit again, or set `off = true` to keep ordinary HTTP for that provider. Remove the system table to leave every unset provider on ordinary HTTP.
107
155
 
108
156
  The gateway temporarily retains native request and response items on the connection. Unlike HTTP request dictionaries, this state follows completed generation, not dictionary acknowledgements. Unknown output fields are retained in an in-memory sidecar and sent in full rather than used for an incremental request.
109
157
 
110
- If the gateway explicitly reports missing history before execution, Kiki sends the full current history once. A pre-execution unsupported upstream format or prompt policy can fall back to a full HTTP request. The transport does not use this fallback for access denials or partial responses. A connection loss or temporary provider failure with no observed output uses the same request retry policy as HTTP; uncertain delivery alone does not block that recovery. This path supports `response.create` generation only; it does not enable background generation, steering, or `generate:false` warmup.
158
+ If the gateway confirms it did not execute a request because the connection lost its history, Kiki sends the full history once. If the first WebSocket request or that full retry exceeds the gateway's advertised frame limit, Kiki sends the full request over HTTP instead; when `max_frame_bytes` is omitted, the limit is 1 MiB.
159
+
160
+ Before sending, a transport failure or HTTP 408/429/5xx handshake failure falls back to HTTP immediately. Other HTTP 4xx handshake denials retain their original status and do not send an HTTP request, including authentication, permission, and invalid-request failures.
161
+
162
+ Before any response event arrives, an unsupported upstream format or prompt policy, `origin_capability_mismatch`, `origin_handshake_failed`, `websocket_capacity_exceeded`, a trusted `connection_retiring` error, or HTTP 429/502/503/504 can use HTTP when the gateway confirms `execution: not_executed`. HTTP fallback preserves the configured request compression. Confirmed execution, an explicit retry denial, cancellation, or any response event prevents this recovery. This path supports `response.create` generation only; it does not enable background generation, steering, or `generate:false` warmup.
163
+
164
+ Connection interruptions use the [request retry policy](./config-files.md#retry), including closes before the terminal event with code 1000, 1001, 1006, 1012, or no code. A retry retires the old socket and sends the full current history on a new connection; `previous_response_id` is not a continuation cursor for the interrupted response. A `websocket_connection_limit_reached` event or a structured `websocket_close_error` with an eligible close code is a connection interruption even when a gateway forwards it over HTTP streaming (SSE). An error message alone does not qualify. After 55 minutes of connection use, Kiki proactively replaces its socket before the next request without interrupting a response in progress.
165
+
166
+ Native agent turns can discard partial text, thinking (including encrypted thinking), and unfinished local tool calls before resending. Refusals, provider-hosted tool output, explicit non-retryable errors, and cancellation still stop replay. Each retry appears in the UI and logs, with at most five attempts including the first; configuration can lower this limit but cannot raise it. Failure and retry logs include `transport` (`ws` or `sse`), `webSocketCapabilities`, `webSocketCapabilityVersion`, `webSocketConnectionAgeMs`, `webSocketFrameBytes`, `webSocketMaxFrameBytes`, `webSocketFullInputReason`, and `webSocketFallbackReason` for Kiki's local connection; unavailable values are `null` or omitted when not applicable. When the retry budget is exhausted, the final turn error and task failure include the total attempts and configured limit alongside the original provider error. A child task keeps its existing context for `AgentRun` resume.
111
167
 
112
168
  ## `/provider` — interactive provider management
113
169
 
@@ -126,17 +182,17 @@ Two paths when adding:
126
182
 
127
183
  ### Fetching model suggestions
128
184
 
129
- In GUI **Settings → Models & providers**, click **Get models** to fetch suggestions from configured providers. API-key providers and custom registries are fetched only on request, not at startup or on a timer. Fetching these suggestions does not change your providers, configured models, or default model. Choose a suggestion and save it separately to add a model; an upstream removal does not delete an existing model.
185
+ In the GUI, open **[Settings → Models & agents → Models → Connections](../guides/settings.md#connections)**, expand the folded **Maintenance** section at the bottom, and click **Get models** to fetch suggestions from every connection. API-key providers and custom registries are fetched only on request, not at startup or on a timer. Fetching these suggestions does not change your providers, configured models, or default model. Choose a suggestion and save it separately to add a model; an upstream removal does not delete an existing model.
130
186
 
131
187
  Kimi Code account sign-in maintains its managed catalog separately. When that catalog refreshes and no global default is set, Kiki selects a managed model even if the catalog itself has not changed. An unchanged catalog preserves explicit defaults, including a choice made while the refresh was in progress.
132
188
 
133
189
  Suggestions are kept in server memory and disappear when the server restarts. Changing or deleting a provider connection discards its cached suggestions. A failed fetch shows an error while retaining the last successful suggestions; a successful empty response clears them. Models already configured for that provider are excluded even if their local aliases differ from the upstream model IDs.
134
190
 
135
- In the GUI, open **Settings → Models & providers → Providers & accounts**. Under **Connect with an API key**, choose one of five protocol entries (`openai`, `openai_responses`, `anthropic`, `google-genai`, `vertexai`) or search for a service by name. A matching service, including DeepSeek, GLM, Kimi, Ollama, LM Studio, or OpenRouter, fills in its protocol and base URL. If there is no match, choose a protocol and enter the base URL yourself. Then enter the key if required and add a model.
191
+ In the GUI, open **[Settings → Models & agents → Models → Connections](../guides/settings.md#connections)**. Under **Connect with an API key**, choose one of five protocol entries (`openai`, `openai_responses`, `anthropic`, `google-genai`, `vertexai`) or search for a service by name. A matching service, including DeepSeek, GLM, Kimi, Ollama, LM Studio, or OpenRouter, fills in its protocol and base URL. If there is no match, choose a protocol and enter the base URL yourself. Then enter the key if required, use **Add model** inside the connection form, and choose **Save provider**.
136
192
 
137
193
  Ollama and LM Studio use the same API-key path as other OpenAI-compatible services; their local servers may not require a key. The five quick starts are OpenAI, Anthropic, Google Gemini, DeepSeek, and Moonshot (Kimi) — the Kimi shortcut configures the `kimi` provider described below.
138
194
 
139
- **Available models** lists configured models across providers: search by name or ID, inspect context size and capabilities, and star a model to set the global default. The provider and model also retain their own per-provider default and remote ID. A manually entered Kimi API key uses the same suggestion-only flow as other API-key connections; account sign-in provisions its own models.
195
+ **[Connections](../guides/settings.md#connections)** lists configured connections and their **Models** lists. Search by connection name or by the IDs and names of its models; expand a connection to inspect context size and capabilities, then click a model row to open the full editor in a side panel. A model star sets the global new-session default; the **New sessions use** bar above the tabs does the same. **Remove model** is at the bottom of the editor and asks for confirmation. The provider and model also retain their own per-provider default and remote ID. A manually entered Kimi API key uses the same suggestion-only flow as other API-key connections; account sign-in provisions its own models.
140
196
 
141
197
  ::: warning
142
198
  Kimi Code OAuth managed accounts logged in via `/login` do not appear in `/provider`. Use `/login` and `/logout` to manage them.
@@ -327,7 +383,7 @@ To send any of these routes through a custom host, set `base_url` (or `GOOGLE_VE
327
383
 
328
384
  ## OAuth and credential injection
329
385
 
330
- In the GUI **Providers & accounts** tab, **Sign in with an account** offers Kimi Code, GitHub Copilot, and ChatGPT (Codex). Choose the account, open the verification URL, enter its device code, and wait for the connected status. An account needs access to the corresponding subscription or service; available models depend on that account. Sign out from the same row to remove its managed connection and models. These are sign-in methods, not new protocol `type` values: Kimi Code and Copilot use `openai`-compatible requests; ChatGPT Codex uses `openai_responses` against the Codex endpoint. OAuth tokens live in JSON files under `credentials/` (see [Data locations](./data-locations.md)); API keys live in `credentials/credentials.toml`. The CLI `/login` and `/logout` commands continue to manage Kimi Code only.
386
+ In **[Settings → Models & agents → Models → Connections](../guides/settings.md#connections)**, **Sign in with an account** offers Kimi Code, GitHub Copilot, and ChatGPT (Codex). Choose the account, open the verification URL, enter its device code, and wait for the connected status. An account needs access to the corresponding subscription or service; available models depend on that account. Sign out from the same row to remove its managed connection and models. These are sign-in methods, not new protocol `type` values: Kimi Code and Copilot use `openai`-compatible requests; ChatGPT Codex uses `openai_responses` against the Codex endpoint. OAuth tokens live in JSON files under `credentials/` (see [Data locations](./data-locations.md)); API keys live in `credentials/credentials.toml`. The CLI `/login` and `/logout` commands continue to manage Kimi Code only.
331
387
 
332
388
  ## Request identity
333
389
 
@@ -341,13 +397,15 @@ Kiki ships six identities. Built-in identities are read-only; **Duplicate and ed
341
397
 
342
398
  | Identity | preset / identity ID | What it sends |
343
399
  | --- | --- | --- |
344
- | Kimi Code | `kimi_code` / `kimi_code` | Kiki's native client: adds `X-Msh-*` device headers on a Kimi provider |
400
+ | Kimi Code | `kimi_code` / `kimi_code` | Kiki's native client: a stable cache identity per agent session, plus `X-Msh-*` device headers on a Kimi provider |
345
401
  | Codex CLI | `codex_compatible` / `codex` | `codex_cli_rs/{version}` User-Agent and `originator`, OpenAI Responses only |
346
402
  | Claude Code | `claude_code_compatible` / `claude_code` | `claude-cli/{version} (external, cli)` User-Agent, `x-app`, and `X-Stainless-*`, Anthropic Messages only |
347
403
  | Grok Build | `grok_build_compatible` / `grok_build` | `grok-shell/{version}` User-Agent and `x-grok-*` session and turn headers, on Chat Completions, Responses, or Messages |
348
404
  | OpenCode | `opencode_compatible` / `opencode` | `opencode/{version}` User-Agent, `x-opencode-client: cli`, and the dynamic `x-opencode-session` and `x-opencode-request` |
349
405
  | None | `none` / `none` | Sends no Kiki-chosen identity fields: the User-Agent, the reserved identity headers, and the `X-Msh-*` device headers are removed. Fields a provider's authentication protocol requires still go out — OAuth tokens, account headers, the Grok client-version marker — because those belong to the protocol rather than to identity |
350
406
 
407
+ Kimi Code defaults to `lineage.session_scope = "agent_session"`. It sends that agent-session identity as `session_<UUID>` in Responses `prompt_cache_key` and Messages `metadata.user_id`. Different sessions and different agents within one session get different values; the same agent keeps its value across retries, later turns, and resume within the same context window. Compaction can rotate an agent-scoped cache key without changing the shared session identity. This default also applies when selecting `preset = "kimi_code"` or `profile = "kimi_code"` explicitly.
408
+
351
409
  ### OpenCode
352
410
 
353
411
  With the `OpenCode` identity, upstream sees an OpenCode command-line client:
@@ -361,13 +419,13 @@ The identity works over OpenAI Responses, Anthropic Messages, and OpenAI Chat Co
361
419
 
362
420
  ### Where to configure it
363
421
 
364
- GUI **Settings → Models & providers → Identity** is the central page: the left column lists built-in (read-only) and custom identities, the right side previews the headers and body fields that identity actually sends, and three further cards cover client versions, per-layer usage, and recent requests. An identity applies in three layers; the **Default request identity** card on that page sets the global layer, and the provider and model layers are set in **Settings → Models & providers**:
422
+ **[Settings → Advanced → Developer & labs → Request identity](../guides/settings.md#request-identity)** is the central page: the left column lists built-in (read-only) and custom identities, the right side previews the headers and body fields that identity actually sends, and three further cards cover client versions, per-layer usage, and recent requests. An identity applies in three layers; the **Default request identity** card on that page sets the global layer, and the provider and model layers are set in **[Settings → Models & agents → Models → Connections](../guides/settings.md#connections)**:
365
423
 
366
424
  | Layer | GUI | `config.toml` |
367
425
  | --- | --- | --- |
368
- | Global default | Settings → Models & providers → Identity | `[request_identity]` |
369
- | Provider | Settings → Models & providers → provider editor → Request identity | `[providers.<name>.request_identity]` |
370
- | Model | Settings → Models & providers → model editor → Request identity | `[models."<alias>".request_identity]` |
426
+ | Global default | Settings → Advanced → Developer & labs → Request identity | `[request_identity]` |
427
+ | Provider | Settings → Models & agents → Models → Connections → provider editor → Request identity | `[providers.<name>.request_identity]` |
428
+ | Model | Settings → Models & agents → Models → Connections → expand connection → Models → model row → Request identity | `[models."<alias>".request_identity]` |
371
429
 
372
430
  Later layers override earlier ones (global → provider → model). With no layer set, an ordinary API-key connection uses the built-in Kimi Code identity, and a provider authenticated through the Codex or Grok Build OAuth flows uses that provider's default identity. Choosing a compatible preset clears the lower layers first, then applies that layer's optional sparse `overrides` (for example `lineage.format`, `client.user_agent`, `request.logical_id`). Sending one provider's traffic as OpenCode takes only:
373
431
 
@@ -376,6 +434,30 @@ Later layers override earlier ones (global → provider → model). With no laye
376
434
  preset = "opencode_compatible"
377
435
  ```
378
436
 
437
+ For Kimi Code, choose `shared_session` to use the original Kiki session ID as the shared cache identity:
438
+
439
+ ```toml
440
+ [providers.my-gateway.request_identity]
441
+ profile = "kimi_code"
442
+
443
+ [providers.my-gateway.request_identity.overrides.lineage]
444
+ session_scope = "shared_session"
445
+ ```
446
+
447
+ Set `branch_session_scope` in the same `overrides.lineage` table to control Branch forks without changing ordinary subagents:
448
+
449
+ | Value | Branch session identity |
450
+ | --- | --- |
451
+ | `follow_session_scope` (default) | Follows `session_scope`, except Gemini branches use `agent_session` |
452
+ | `shared_session` | Uses the shared session, including on Gemini |
453
+ | `agent_session` | Uses a distinct identity for each branch |
454
+
455
+ Codex branches keep the same shared session and cache key as main, including after compaction, while each branch gets its own thread ID. Gemini detection uses the native `google-genai` protocol, the upstream model name, or `pricing_model`, so it also covers Gemini on a Messages gateway. `session_scope = "none"` always suppresses the session identity.
456
+
457
+ Native Google GenAI `generateContent` does not send a Request Identity session field; the setting affects the local identity and adapters that emit it.
458
+
459
+ Valid `config.toml` edits [reload automatically](./config-files.md#applying-configuration-changes). Request identity is frozen for a turn when its first model request is prepared; changes apply from the next turn, without restarting Kiki.
460
+
379
461
  ### Client versions
380
462
 
381
463
  The client version a built-in identity carries follows the value shipped with Kiki, and the **Client versions** card can check upstream through the npm registry, the locally installed CLI (`opencode --version`), or a manifest URL. A check only stages a candidate version: requests keep using the current one until you apply it. You can also pin the version, or roll back to a previous one.
@@ -30,7 +30,7 @@ The full scope rules and directory list are in [Agent Locations](./agents-and-su
30
30
 
31
31
  ## When changes take effect
32
32
 
33
- Profile files under the user, project and extra-directory roots — plus `$KIKI_HOME/SYSTEM.md` — are watched: additions, edits and deletions reload automatically after roughly 200 ms, and a newly dispatched subagent picks up the reloaded version immediately. An existing session's main agent stays bound to the snapshot taken when the session was created, so use **Rebuild context** to pick up your edit while keeping the conversation. See [Rebuilding a session context](./agents-and-subagents.md#rebuilding-a-session-context).
33
+ Profile files under the user, project and extra-directory roots — plus `$KIKI_HOME/SYSTEM.md` — are watched: additions, edits and deletions reload automatically after roughly 200 ms, and a newly dispatched subagent picks up the reloaded version immediately. Existing agents refresh their snapshot at the next compaction or session recovery by default. Turn off **Auto-update context** to keep an agent's snapshot frozen, or use **Rebuild context** to apply an edit immediately without losing the conversation. See [Rebuilding a session context](./agents-and-subagents.md#rebuilding-a-session-context).
34
34
 
35
35
  ## Main agents and subagents
36
36
 
@@ -95,11 +95,11 @@ For a session's **main agent**, your model choice takes priority over profile co
95
95
 
96
96
  For **subagent bindings** these rules apply in the GUI, the CLI, `AgentRun` and the API alike:
97
97
 
98
- - **An out-of-menu selection is rejected, never downgraded.** It returns `profile.constraint_violation` without falling back to the default. Leaving the model out still selects one through the usual default rules and then validates it against the menu; if that model is outside the menu the binding is rejected rather than replaced by a menu entry you did not choose.
98
+ - **An out-of-menu selection is rejected, never downgraded.** Static selection validates the chosen model against the menu, even when it came from a default. [Automatic selection](../configuration/config-files.md#automatic-model-selection) filters out models outside the menu before selecting.
99
99
  - **Other hard rules still apply.** The menu intersects with every applicable `allowed_models` list, and a `deny_models` match always rejects. `"*"` cannot widen it. A menu equal to an `allowed_models` list is redundant, not an error; differing lists intersect, and neither layer is ignored.
100
100
  - **`when` is a hint, not a gate.** It is text for the caller and is never evaluated, so a missing or apparently unmet hint changes nothing. `preferred_*` and `discouraged_models` stay advice, and menu order is not a fallback chain.
101
101
  - **An empty set permits nothing.** An empty menu with a default restricts binding to that one model; with neither menu nor default, no candidates, or an empty intersection with another hard domain, the binding is rejected.
102
- - **Resuming does not widen anything.** `resume` revalidates the frozen menu and saved hard rules plus the caller and machine rules in force now, and a rejection leaves the saved binding as it was. Changing the model still needs `allow_model_change: true`, which is not permission to leave the menu. Editing the file does not rewrite existing snapshots: a new binding uses the new definition, an existing session needs an explicit rebind or a new session.
102
+ - **Resuming does not widen anything.** `resume` revalidates the frozen menu and saved hard rules plus the caller and machine rules in force now, and a rejection leaves the saved binding as it was. Changing the model needs an explicit [`context_mode`](./agents-and-subagents.md#named-child-agents) or the legacy `allow_model_change: true` / `new_window: true` confirmation; none permits leaving the menu. Editing the file does not rewrite existing snapshots: a new binding uses the new definition, an existing session needs an explicit rebind or a new session.
103
103
 
104
104
  To get past a subagent rejection, pick a menu entry that also satisfies the other hard rules, or edit the profile. A pin, a manual selection, or confirming a model change are not ways around the menu.
105
105