kiki-agent 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +3 -3
  2. package/dist/cpu-worker.mjs +52744 -0
  3. package/dist/docs/en/configuration/config-files.md +121 -46
  4. package/dist/docs/en/configuration/data-locations.md +34 -7
  5. package/dist/docs/en/configuration/env-vars.md +37 -9
  6. package/dist/docs/en/configuration/overrides.md +20 -9
  7. package/dist/docs/en/configuration/providers.md +114 -9
  8. package/dist/docs/en/customization/agent-profiles.md +1 -1
  9. package/dist/docs/en/customization/agents-and-subagents.md +55 -12
  10. package/dist/docs/en/customization/hooks.md +3 -3
  11. package/dist/docs/en/customization/personas.md +36 -2
  12. package/dist/docs/en/customization/plugins.md +56 -3
  13. package/dist/docs/en/customization/prompt-fields.md +65 -5
  14. package/dist/docs/en/customization/recipes.md +77 -0
  15. package/dist/docs/en/customization/skins.md +2 -2
  16. package/dist/docs/en/customization/themes.md +1 -1
  17. package/dist/docs/en/features/agent-workflows.md +8 -8
  18. package/dist/docs/en/features/browser-and-computer.md +40 -0
  19. package/dist/docs/en/features/daily.md +13 -13
  20. package/dist/docs/en/features/ecosystem.md +6 -6
  21. package/dist/docs/en/features/extend.md +11 -10
  22. package/dist/docs/en/features/freedom.md +9 -9
  23. package/dist/docs/en/features/index.md +58 -28
  24. package/dist/docs/en/features/long-work.md +18 -14
  25. package/dist/docs/en/features/look.md +6 -6
  26. package/dist/docs/en/features/people.md +6 -6
  27. package/dist/docs/en/features/phone.md +13 -3
  28. package/dist/docs/en/features/spaces.md +12 -12
  29. package/dist/docs/en/features/workbench.md +8 -8
  30. package/dist/docs/en/getting-started/desktop-app.md +4 -8
  31. package/dist/docs/en/getting-started/first-launch.md +1 -1
  32. package/dist/docs/en/guides/goals.md +4 -2
  33. package/dist/docs/en/guides/interface.md +32 -10
  34. package/dist/docs/en/guides/memory.md +64 -10
  35. package/dist/docs/en/guides/sessions.md +21 -9
  36. package/dist/docs/en/guides/settings.md +64 -40
  37. package/dist/docs/en/index.md +3 -1
  38. package/dist/docs/en/reference/command.md +90 -31
  39. package/dist/docs/en/reference/model-vocabulary.md +2 -2
  40. package/dist/docs/en/reference/slash-commands.md +1 -1
  41. package/dist/docs/en/reference/tools.md +65 -20
  42. package/dist/docs/en/server/acp.md +9 -3
  43. package/dist/docs/en/server/local-server.md +19 -27
  44. package/dist/docs/en/server/mcp.md +9 -5
  45. package/dist/docs/en/server/rest-api.md +350 -22
  46. package/dist/docs/en/server/script-tools.md +268 -0
  47. package/dist/docs/zh/configuration/config-files.md +121 -46
  48. package/dist/docs/zh/configuration/data-locations.md +34 -7
  49. package/dist/docs/zh/configuration/env-vars.md +37 -9
  50. package/dist/docs/zh/configuration/overrides.md +20 -9
  51. package/dist/docs/zh/configuration/providers.md +114 -9
  52. package/dist/docs/zh/customization/agent-profiles.md +1 -1
  53. package/dist/docs/zh/customization/agents-and-subagents.md +55 -12
  54. package/dist/docs/zh/customization/hooks.md +3 -3
  55. package/dist/docs/zh/customization/personas.md +36 -2
  56. package/dist/docs/zh/customization/plugins.md +56 -3
  57. package/dist/docs/zh/customization/prompt-fields.md +65 -5
  58. package/dist/docs/zh/customization/recipes.md +77 -0
  59. package/dist/docs/zh/customization/skins.md +2 -2
  60. package/dist/docs/zh/customization/themes.md +1 -1
  61. package/dist/docs/zh/features/agent-workflows.md +10 -10
  62. package/dist/docs/zh/features/browser-and-computer.md +40 -0
  63. package/dist/docs/zh/features/daily.md +13 -13
  64. package/dist/docs/zh/features/ecosystem.md +6 -6
  65. package/dist/docs/zh/features/extend.md +10 -9
  66. package/dist/docs/zh/features/freedom.md +9 -9
  67. package/dist/docs/zh/features/index.md +58 -28
  68. package/dist/docs/zh/features/long-work.md +17 -13
  69. package/dist/docs/zh/features/look.md +6 -6
  70. package/dist/docs/zh/features/people.md +5 -5
  71. package/dist/docs/zh/features/phone.md +13 -3
  72. package/dist/docs/zh/features/spaces.md +12 -12
  73. package/dist/docs/zh/features/workbench.md +8 -8
  74. package/dist/docs/zh/getting-started/desktop-app.md +4 -8
  75. package/dist/docs/zh/getting-started/first-launch.md +1 -1
  76. package/dist/docs/zh/guides/goals.md +4 -2
  77. package/dist/docs/zh/guides/interface.md +32 -10
  78. package/dist/docs/zh/guides/memory.md +64 -10
  79. package/dist/docs/zh/guides/sessions.md +21 -9
  80. package/dist/docs/zh/guides/settings.md +64 -40
  81. package/dist/docs/zh/index.md +4 -2
  82. package/dist/docs/zh/reference/command.md +90 -31
  83. package/dist/docs/zh/reference/model-vocabulary.md +2 -2
  84. package/dist/docs/zh/reference/slash-commands.md +1 -1
  85. package/dist/docs/zh/reference/tools.md +65 -20
  86. package/dist/docs/zh/server/acp.md +9 -3
  87. package/dist/docs/zh/server/local-server.md +19 -27
  88. package/dist/docs/zh/server/mcp.md +9 -5
  89. package/dist/docs/zh/server/rest-api.md +338 -21
  90. package/dist/docs/zh/server/script-tools.md +268 -0
  91. package/dist/external-harness/agy-cli-acp.mjs +168 -162
  92. package/dist/external-harness/agy-hook-registration.mjs +69 -30
  93. package/dist/external-harness/agy-mcp-plugin.mjs +19 -0
  94. package/dist/external-harness/agy-permission-hook.mjs +29 -2
  95. package/dist/hostRunner.mjs +112 -3
  96. package/dist/mailbox-worker.mjs +403 -0
  97. package/dist/main.mjs +2 -2
  98. package/dist/memory-worker.mjs +1008 -0
  99. package/dist/native/windows-process-helper.exe +0 -0
  100. package/dist/query-store-worker.mjs +487 -0
  101. package/dist/sqlite-indexer.mjs +255 -403
  102. package/dist/sqlite-query-worker.mjs +261 -249
  103. package/dist/usage-parser-worker.mjs +3977 -9
  104. package/dist/usage-read-model-worker.mjs +761 -0
  105. package/dist/web/assets/AppErrorBoundary-B5Fc4f6-.js +1 -0
  106. package/dist/web/assets/NavScopeBoundary-C7MnGQio.js +1 -0
  107. package/dist/web/assets/{arc-DYDCMlOS.js → arc-DGB9OVgQ.js} +1 -1
  108. package/dist/web/assets/{architectureDiagram-3BPJPVTR-C9Y7T0O2.js → architectureDiagram-3BPJPVTR-glnQCMub.js} +1 -1
  109. package/dist/web/assets/{blockDiagram-GPEHLZMM-CdUrp-tD.js → blockDiagram-GPEHLZMM-bM0tnGby.js} +1 -1
  110. package/dist/web/assets/{c4Diagram-AAUBKEIU-PrwvB9IJ.js → c4Diagram-AAUBKEIU-DMf_rTtt.js} +1 -1
  111. package/dist/web/assets/channel-Cj8SKJ38.js +1 -0
  112. package/dist/web/assets/{chunk-2J33WTMH-BL56g_Es.js → chunk-2J33WTMH-mTccJ3tW.js} +1 -1
  113. package/dist/web/assets/{chunk-4BX2VUAB-DvJD5M9M.js → chunk-4BX2VUAB-DhqPYMjY.js} +1 -1
  114. package/dist/web/assets/{chunk-55IACEB6-C8f-nzvx.js → chunk-55IACEB6-BujrYRoO.js} +1 -1
  115. package/dist/web/assets/{chunk-727SXJPM-DOGkWKkV.js → chunk-727SXJPM-ciMmSI4G.js} +1 -1
  116. package/dist/web/assets/{chunk-AQP2D5EJ-fFOuz7g6.js → chunk-AQP2D5EJ-CZW9pKTc.js} +1 -1
  117. package/dist/web/assets/{chunk-FMBD7UC4-BpeXZ9LM.js → chunk-FMBD7UC4-hdALNnnU.js} +1 -1
  118. package/dist/web/assets/{chunk-ND2GUHAM-CRUh76fb.js → chunk-ND2GUHAM-CgKyqUdb.js} +1 -1
  119. package/dist/web/assets/{chunk-QZHKN3VN-uNfxaPk0.js → chunk-QZHKN3VN-B2mmUz_E.js} +1 -1
  120. package/dist/web/assets/classDiagram-4FO5ZUOK-f8V9p-dD.js +1 -0
  121. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-f8V9p-dD.js +1 -0
  122. package/dist/web/assets/client-ClWQBErG.js +3 -0
  123. package/dist/web/assets/connection-C0J3BPgk.js +1 -0
  124. package/dist/web/assets/{cose-bilkent-S5V4N54A-BNkxG-qX.js → cose-bilkent-S5V4N54A-UV3uPjkK.js} +1 -1
  125. package/dist/web/assets/{dagre-BM42HDAG-BerioUei.js → dagre-BM42HDAG-Zjy-gQ6C.js} +1 -1
  126. package/dist/web/assets/{diagram-2AECGRRQ-Czv2SR07.js → diagram-2AECGRRQ-DL-kilIf.js} +1 -1
  127. package/dist/web/assets/{diagram-5GNKFQAL-Uzi1weGK.js → diagram-5GNKFQAL-CjB_xR5B.js} +1 -1
  128. package/dist/web/assets/{diagram-KO2AKTUF-W36h_ff3.js → diagram-KO2AKTUF-CjN4i3b9.js} +1 -1
  129. package/dist/web/assets/{diagram-LMA3HP47-FG4dDk52.js → diagram-LMA3HP47-CPCAMndo.js} +1 -1
  130. package/dist/web/assets/{diagram-OG6HWLK6-CQoEjIAY.js → diagram-OG6HWLK6-DVeBWBKd.js} +1 -1
  131. package/dist/web/assets/{erDiagram-TEJ5UH35-Ck06KVyZ.js → erDiagram-TEJ5UH35-CHKzBHrr.js} +1 -1
  132. package/dist/web/assets/export-CXoWon32.js +2 -0
  133. package/dist/web/assets/{flowDiagram-I6XJVG4X-C5hgxdFZ.js → flowDiagram-I6XJVG4X-C5rQa2pq.js} +1 -1
  134. package/dist/web/assets/{ganttDiagram-6RSMTGT7-BS52Pw5_.js → ganttDiagram-6RSMTGT7-BrLjEsNJ.js} +1 -1
  135. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-DLlQKZHs.js → gitGraphDiagram-PVQCEYII-3DRR5VZj.js} +1 -1
  136. package/dist/web/assets/highlighted-body-OFNGDK62-Bdj5SJfv.js +1 -0
  137. package/dist/web/assets/index-2Vx5mHRn.js +1 -0
  138. package/dist/web/assets/index-B1UXw2C9.js +1 -0
  139. package/dist/web/assets/{index-CM-nNfuV.js → index-BJxtlf4P.js} +4 -4
  140. package/dist/web/assets/{index-DKIysLbI.js → index-BY7jPurv.js} +1 -1
  141. package/dist/web/assets/index-Bq79v-Sa.js +1 -0
  142. package/dist/web/assets/index-BqD3iTIl.js +1 -0
  143. package/dist/web/assets/index-Br3AlBrQ.js +1 -0
  144. package/dist/web/assets/{index-Ca607_hK.js → index-BvRBCpc6.js} +2 -2
  145. package/dist/web/assets/index-BxYCSNg_.js +3 -0
  146. package/dist/web/assets/{index-B2Pu0Iuu.js → index-C62wjCF_.js} +1 -1
  147. package/dist/web/assets/index-CBvwNH_H.js +1 -0
  148. package/dist/web/assets/{index-BNch_a4L.js → index-CG9e6lgq.js} +1 -1
  149. package/dist/web/assets/{index-ByiwExpV.js → index-CPSWYh_R.js} +2 -2
  150. package/dist/web/assets/index-CS4xJLZV.js +1 -0
  151. package/dist/web/assets/index-CjvqtF2I.js +1 -0
  152. package/dist/web/assets/index-CprdjRRk.js +13 -0
  153. package/dist/web/assets/{index-Bg99yVX_.js → index-CypTtrCB.js} +1 -1
  154. package/dist/web/assets/{index-BwcG86o3.js → index-DDJQGcUL.js} +1 -1
  155. package/dist/web/assets/index-DLWzxUOO.js +1 -0
  156. package/dist/web/assets/index-DQxkxZmn.js +7 -0
  157. package/dist/web/assets/index-DRo5Y_9p.js +1 -0
  158. package/dist/web/assets/index-De_LkTZx.js +1 -0
  159. package/dist/web/assets/{index-CZX3qUe2.js → index-DfUpwUTM.js} +2 -2
  160. package/dist/web/assets/{index-BLU8_Um7.js → index-Dkbz748K.js} +2 -2
  161. package/dist/web/assets/index-DmwFFSkV.js +1 -0
  162. package/dist/web/assets/index-DpcWEDhW.js +1 -0
  163. package/dist/web/assets/index-Dqq1RDP4.js +1 -0
  164. package/dist/web/assets/index-H1uMvIoa.css +1 -0
  165. package/dist/web/assets/index-ICHWJ2SM.js +1 -0
  166. package/dist/web/assets/index-O5fSd569.js +229 -0
  167. package/dist/web/assets/index-odjtqLLS.js +1 -0
  168. package/dist/web/assets/index-v_yAQ0Am.js +1 -0
  169. package/dist/web/assets/{infoDiagram-5YYISTIA-CD4XJGFm.js → infoDiagram-5YYISTIA-CCwV4Z0v.js} +1 -1
  170. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-fu5E3_CT.js → ishikawaDiagram-YF4QCWOH-BwwZcGyZ.js} +1 -1
  171. package/dist/web/assets/{journeyDiagram-JHISSGLW-CXcnKBfJ.js → journeyDiagram-JHISSGLW-Dc6WqniQ.js} +1 -1
  172. package/dist/web/assets/{kanban-definition-UN3LZRKU-BawKH6Pl.js → kanban-definition-UN3LZRKU-DVUqULOS.js} +1 -1
  173. package/dist/web/assets/{linear-BplJuXph.js → linear-d6rWsNOU.js} +1 -1
  174. package/dist/web/assets/memoryAdvisor-DBQXJB1o.js +1 -0
  175. package/dist/web/assets/mermaid-GHXKKRXX-Ik6SkVDT.js +642 -0
  176. package/dist/web/assets/{mindmap-definition-RKZ34NQL-DA1SE2uy.js → mindmap-definition-RKZ34NQL-_JHAkhHL.js} +1 -1
  177. package/dist/web/assets/navViewState-DaCMIYWA.js +1 -0
  178. package/dist/web/assets/{pieDiagram-4H26LBE5-6i021QeX.js → pieDiagram-4H26LBE5-BlhlygGy.js} +1 -1
  179. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CcKSZDMT.js → quadrantDiagram-W4KKPZXB-jn6R_C0S.js} +1 -1
  180. package/dist/web/assets/{requirementDiagram-4Y6WPE33-lYVuWRuD.js → requirementDiagram-4Y6WPE33-B9fXCHBr.js} +1 -1
  181. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-4Zfb4_h4.js → sankeyDiagram-5OEKKPKP-fPJwIxkl.js} +1 -1
  182. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DqltKmlY.js → sequenceDiagram-3UESZ5HK-1v1DTNGt.js} +1 -1
  183. package/dist/web/assets/{spaces-CjuXbmxF.js → spaces-CvL2DRZM.js} +1 -1
  184. package/dist/web/assets/{stateDiagram-AJRCARHV-HFdhqxzx.js → stateDiagram-AJRCARHV-CEc_PLov.js} +1 -1
  185. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-iAMctzaT.js +1 -0
  186. package/dist/web/assets/theme-LRSmy8mD.js +1 -0
  187. package/dist/web/assets/{timeline-definition-PNZ67QCA-HNRxaB3t.js → timeline-definition-PNZ67QCA-CEjhuitj.js} +1 -1
  188. package/dist/web/assets/{vennDiagram-CIIHVFJN-DwsCTyaD.js → vennDiagram-CIIHVFJN-CActt9h9.js} +1 -1
  189. package/dist/web/assets/{wardley-L42UT6IY-BWW2wtVO.js → wardley-L42UT6IY-Bp3q2izt.js} +1 -1
  190. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-C-ktKm7v.js → wardleyDiagram-YWT4CUSO-C_zutiQ2.js} +1 -1
  191. package/dist/web/assets/{xychartDiagram-2RQKCTM6-48AxNW9k.js → xychartDiagram-2RQKCTM6-CRafvv33.js} +1 -1
  192. package/dist/web/icons/apple-touch-icon.png +0 -0
  193. package/dist/web/icons/icon-192.png +0 -0
  194. package/dist/web/icons/icon-512.png +0 -0
  195. package/dist/web/icons/maskable-512.png +0 -0
  196. package/dist/web/index.html +12 -2
  197. package/dist/web/manifest.webmanifest +16 -0
  198. package/native/auth-native/prebuilds/linux-arm64/auth-native.node +0 -0
  199. package/native/auth-native/prebuilds/linux-x64/auth-native.node +0 -0
  200. package/native/auth-native/prebuilds/win32-arm64/auth-native.node +0 -0
  201. package/native/auth-native/prebuilds/win32-x64/auth-native.node +0 -0
  202. package/package.json +23 -4
  203. package/dist/search-worker.mjs +0 -14177
  204. package/dist/web/assets/AppErrorBoundary-DiGMUg4r.js +0 -1
  205. package/dist/web/assets/LifeMark-CL6-HWDu.js +0 -1
  206. package/dist/web/assets/NavScopeBoundary-CFCnvZR0.js +0 -1
  207. package/dist/web/assets/channel-Bj_gZ_Lv.js +0 -1
  208. package/dist/web/assets/classDiagram-4FO5ZUOK-ssCwe2R4.js +0 -1
  209. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-ssCwe2R4.js +0 -1
  210. package/dist/web/assets/client-DGj93bGT.js +0 -3
  211. package/dist/web/assets/connection-Bpf-EjrL.js +0 -1
  212. package/dist/web/assets/export-T_izwEkQ.js +0 -2
  213. package/dist/web/assets/highlighted-body-OFNGDK62-Btm6MuZ4.js +0 -1
  214. package/dist/web/assets/index-5_yzg61S.js +0 -1
  215. package/dist/web/assets/index-B-6LiYTY.js +0 -1
  216. package/dist/web/assets/index-B4iu4SJW.js +0 -1
  217. package/dist/web/assets/index-B9MlqF7J.js +0 -1
  218. package/dist/web/assets/index-BECSk4If.js +0 -1
  219. package/dist/web/assets/index-BFcyN2Zw.js +0 -1
  220. package/dist/web/assets/index-BIebkSEI.css +0 -1
  221. package/dist/web/assets/index-BMWid2q9.js +0 -1
  222. package/dist/web/assets/index-BeMvPEXs.js +0 -1
  223. package/dist/web/assets/index-Bezli3SF.js +0 -1
  224. package/dist/web/assets/index-BkPV0psm.js +0 -1
  225. package/dist/web/assets/index-CG8uIlD7.js +0 -1
  226. package/dist/web/assets/index-CJ92kLtO.js +0 -1
  227. package/dist/web/assets/index-CRDDqofN.js +0 -1
  228. package/dist/web/assets/index-Cd62y0wD.js +0 -1
  229. package/dist/web/assets/index-CgcJPsK6.js +0 -3
  230. package/dist/web/assets/index-Cy8C_eFR.js +0 -7
  231. package/dist/web/assets/index-D8z7lcQn.js +0 -166
  232. package/dist/web/assets/index-D_oPSlBL.js +0 -1
  233. package/dist/web/assets/index-Dceu0bqY.js +0 -1
  234. package/dist/web/assets/index-eUyF-8Sq.js +0 -1
  235. package/dist/web/assets/index-hG2s2Spn.js +0 -13
  236. package/dist/web/assets/mermaid-GHXKKRXX-BO9hkP3Z.js +0 -621
  237. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Dx28QuZF.js +0 -1
  238. package/dist/web/assets/theme-beWE_6f8.js +0 -1
@@ -33,10 +33,30 @@ Reloading a file and applying a setting have different timing:
33
33
  | Setting | When it takes effect |
34
34
  | --- | --- |
35
35
  | [`request_governance`](#request-governance) | Re-evaluates waiting requests and agent admissions as soon as the edit is loaded; active work finishes normally |
36
+ | [`cpu_workers`](#cpu-workers) | Next process start; the pool reads the section when the App service is created |
37
+ | [`session_residency`](#session-residency) | The next restore or eviction decision; changing restore limits wakes queued restores, but does not interrupt an active restore. The sweep timer interval is set when the service starts |
38
+ | [`transcript_memory`](#transcript-memory) | The next cache admission, eviction, or residency-maintenance pass; an in-progress read is not canceled |
36
39
  | Session defaults such as `default_model`, `default_permission_mode`, and `default_plan_mode` | New sessions; an existing session keeps its own choices |
37
40
  | [`identity`](#identity) | Next process start |
38
41
  | [`tui.toml`](#tui-toml) | Next start, or `/reload-tui` in the TUI |
39
42
 
43
+ The resource formulas below are resolved from the host hardware when the process starts. Explicit values from `config.toml` or an environment variable override the formula exactly; they are not rewritten to the old upper bounds.
44
+
45
+ ## Hardware-scaled resource defaults
46
+
47
+ When a resource field is omitted, Kiki derives it from the host instead of using one fixed machine size. Let `C = os.availableParallelism()`, `M = floor(totalmem / MiB)`, `H = max(512, floor(M / 64))` MiB, and `W = max(1, min(C - 1, floor(M / 4 / H)))`. The `C - 1` term leaves one parallelism slot for the host, while the minimums keep small machines usable.
48
+
49
+ | Area | Adaptive default | What remains configurable or unchanged |
50
+ | --- | --- | --- |
51
+ | CPU workers | `max_workers = W`; `max_queue = max(128, 16W)`; `max_queued_bytes = max(64, floor(M / 128))` MiB | `KIKI_CPU_MAX_WORKERS`, `KIKI_CPU_MAX_QUEUE`, `KIKI_CPU_MAX_QUEUED_BYTES`, and `KIKI_CPU_TIMEOUT_MS` still override the matching fields. `timeout_ms` remains 30 seconds. The actual pool size is still capped at `C - 1` |
52
+ | Session residency | `max_live_sessions = max(16, floor(M / 128))`; `max_concurrent_restores = W`; `max_queued_restores = max(128, 16C)`; `max_resident_heap_bytes = min(max(256, floor(M / 8)) MiB, 60% of the effective V8 heap)` | Idle and sweep timers remain 10 minutes, 1 minute, and 30 seconds. Explicit session values remain overrides |
53
+ | Worker-backed storage and parsing | SQLite query, mailbox, memory, usage, and kap parser workers use `H` MiB; storage-worker waiting queues default to `max(128, 16C)` | SQLite keeps a single writer; parser backpressure is unchanged |
54
+ | Search | The one query worker uses `H` MiB, keeps 8 active slots, and queues `max(128, 16C)` requests. The indexer child uses `H` MiB with soft RSS `2H + 256` MiB and hard RSS `3H + 256` MiB | Explicit indexer options still win over `KIKI_SEARCH_INDEXER_SOFT_MB` / `KIKI_SEARCH_INDEXER_HARD_MB`, which win over these defaults. Search keeps one writer |
55
+ | Transcript detail | The single-detail cache defaults to `H` MiB | `tail_turns = 20` and `max_agent_bytes = 16` MiB remain unchanged; each single-page read is still independently bounded |
56
+ | Request governance | `max_queue_size = max(1024, 4 × max(128, 16C))` | `rules = []` and the 300-second wait budget remain unchanged. User rules and an explicitly configured queue size still win; this local queue is not a provider rate limit |
57
+
58
+ The resource values in the sections below are explicit override examples, not the hardware defaults. The desktop launcher gives a sidecar an explicit target heap of `max(8192, floor(totalmem / MiB / 4))` MiB. Native SEA profiles use no CLI heap flag and let `NODE_OPTIONS` remain the user's authoritative override. 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 that target and the user has not supplied a heap override. Default interactive `kiki`, resume/continue, `web`, and `serve --ensure/--query/--stop` are daemon clients and do not auto-restart; newly spawned daemons receive their target before launch. Short-lived commands such as `--version`, tool calls, and completion do not restart. Do not assume one fixed V8 heap size across machines.
59
+
40
60
  `/reload` remains available in the TUI to explicitly reload `config.toml` and `tui.toml`. Settings with a turn or session snapshot use the timing documented in their own section; automatic file reload does not replace an in-progress request.
41
61
 
42
62
  ## Complete example
@@ -105,7 +125,7 @@ pattern = "Bash(rm -rf*)"
105
125
  [[hooks]]
106
126
  event = "PreToolUse"
107
127
  matcher = "Bash"
108
- command = "node ~/.kiki/hooks/check-bash.mjs"
128
+ command = "node \"$KIKI_HOME/hooks/check-bash.mjs\""
109
129
  timeout = 5
110
130
  ```
111
131
 
@@ -123,7 +143,11 @@ kiki_context = []
123
143
  allow_kiki_subagents = false
124
144
  ```
125
145
 
126
- Omit model, effort and permission fields to let the harness choose them. `kiki_context` accepts `memory`, `board`, `cron`, `threads`, `history` and `hooks`; `[]` explicitly disables all groups, and `allow_kiki_subagents = false` explicitly disables delegation. An omitted profile field inherits the harness settings in this execution path. Changing settings does not rewrite an existing binding: select the execution again or explicitly rebuild its context to adopt them.
146
+ Omit model, effort and permission fields to let the harness choose them. `kiki_context` accepts `memory`, `board`, `cron`, `threads`, `history` and `hooks`; `[]` explicitly disables all groups, and `allow_kiki_subagents = false` explicitly disables delegation. An omitted profile field inherits the harness settings in this execution path. Named external role profiles also inherit `defaults.permission_mode` when they do not declare a mode. External permission support and rejected Kiki-only restrictions are described under [direct external execution](../customization/agents-and-subagents.md#direct-external-execution). Changing settings does not rewrite an existing binding: select the execution again or explicitly rebuild its context to adopt them.
147
+
148
+ Every non-native executor descriptor also projects a reserved native target named `engine:<executor-id>`, such as `engine:codex-app-server`, `engine:claude-acp`, `engine:agy-cli` or `engine:grok-acp`. `AgentRun` can use that name as its `profile` to start a child with the engine's own configuration; it does not require a Markdown role profile. Ordinary named role profiles keep their existing behavior. For a bare engine target, model selection is explicit `AgentRun` value → `[agent_executor_overrides."<id>".defaults].model_alias` → the vendor's own default. The model ID is not resolved through Kiki's native `[models]` or provider settings.
149
+
150
+ A bare engine target has no Kiki role, system prompt or profile body by default, and being a child does not by itself open the Kiki MCP bridge. Explicit per-engine defaults remain in force: `inject_kiki_mcp`, `kiki_context`, `allow_kiki_subagents` and `executor_prompt` can still request the corresponding bridge, context or prompt behavior when the engine supports it. The bridge itself is still filtered by the existing tool, path and approval rules.
127
151
 
128
152
  `native_agent` selects the vendor's own agent. It is a session override or a value in these defaults, not a profile field. JSON `null` on the session override clears that choice and inherits the defaults value. Omit it, or set `engine-default`, to keep the vendor's default agent; Kiki then does not send a custom agent selection. A newly chosen value must be one the executor has already advertised. Missing discovery keeps an existing choice when the executor, that agent, and the descriptor revision still match; a discovery list that omits the value is rejected and the current binding stays.
129
153
 
@@ -237,18 +261,19 @@ The following sections detail the nested tables listed above.
237
261
 
238
262
  ## `providers`
239
263
 
240
- Each entry in the `providers` table defines an API provider, keyed by a unique name. The provider's `api_key` lives in [`credentials.toml`](#provider-credentials), and the CLI does **not** fall back to shell environment variables automatically. Running `export KIMI_API_KEY` in the terminal does not give any provider its key — write it in `credentials.toml` instead.
264
+ Each entry in the `providers` table defines an API provider, keyed by a unique name. Store an API key in [`credentials.toml`](#provider-credentials), or set `api_key_env` in `config.toml` to read a named environment variable from the Kiki process. Without that explicit reference, exporting a provider key in the shell has no effect.
241
265
 
242
266
  | Field | Type | Required | Description |
243
267
  | --- | --- | --- | --- |
244
268
  | `type` | `string` | Yes | Provider type: `kimi`, `anthropic`, `openai`, `openai_responses`, `google-genai`, `vertexai` |
245
269
  | `api_key` | `string` | No | API key. Stored in `credentials.toml`; a value in `config.toml` is used only when `credentials.toml` has none for that provider |
270
+ | `api_key_env` | `string` | No | Non-empty environment variable name, not a key value. Stored in `config.toml`; consulted only when `api_key` is empty. See [credential priority and example](./overrides.md#provider-credentials) |
246
271
  | `base_url` | `string` | No | API base URL |
247
272
  | `oauth` | `table` | No | OAuth credential reference (`storage` and `key` fields); injected automatically by the login flow — normally no need to write this by hand |
248
- | `env` | `table<string, string>` | No | Fallback source for provider credentials; see below |
273
+ | `env` | `table<string, string>` | No | Provider environment values; see below |
249
274
  | `custom_headers` | `table<string, string>` | No | Custom HTTP headers attached to each request |
250
275
 
251
- **`env` sub-table**: You can write provider-conventional key names (such as `KIMI_API_KEY`) inside `[providers.<name>.env]` as a fallback source for `api_key` / `base_url`. This sub-table is **read only from the config file** and does not modify the shell environment:
276
+ **`env` sub-table**: You can write provider-conventional key names (such as `KIMI_API_KEY`) inside `[providers.<name>.env]` as a fallback source for `api_key` / `base_url`. It also takes priority over the process environment for the variable named by `api_key_env`, including an explicitly empty value. This sub-table is **read only from the config file** and does not modify the shell environment:
252
277
 
253
278
  ```toml
254
279
  [providers.kimi.env]
@@ -256,7 +281,7 @@ KIMI_API_KEY = "sk-xxx"
256
281
  KIMI_BASE_URL = "https://api.moonshot.ai/v1"
257
282
  ```
258
283
 
259
- Priority: `api_key` field > `env` sub-table key > if both are absent, startup fails with an error. `type = "vertexai"` can omit `api_key` when the env sub-table sets both `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`. An `api_key` set alongside those coordinates is still sent. See [Vertex AI](./providers.md#vertexai).
284
+ If the variable named by `api_key_env` is missing or empty, Kiki does not fall back to another credential variable. See [Config overrides](./overrides.md#provider-credentials) for the full resolution order. `type = "vertexai"` can omit `api_key` when the env sub-table sets both `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`. An API key set alongside those coordinates is still sent. See [Vertex AI](./providers.md#vertexai).
260
285
 
261
286
  ## `models`
262
287
 
@@ -300,7 +325,7 @@ max_context_size = 1048576
300
325
 
301
326
  ### Legacy model parameter migration
302
327
 
303
- Older configurations put `temperature` / `top_p` and `max_completion_tokens` / `service_tier` in different places. **Settings → Models & providers → Available models → Legacy model parameter migration** can copy them into a model's `parameters` table.
328
+ Older configurations put `temperature` / `top_p` and `max_completion_tokens` / `service_tier` in different places. **Settings → Models & providers → Providers & accounts → Maintenance → Legacy model parameter migration** can copy them into a model's `parameters` table.
304
329
 
305
330
  **Preview migration** first, which lists the model aliases, parameter names, review reasons, a revision and the backup name it would use, and writes nothing. Unambiguous values are copied; ambiguous or conflicting ones are left for you to decide. Your existing fields are not removed, so read the preview instead of assuming anything changed.
306
331
 
@@ -536,6 +561,8 @@ A partial update changes only the fields you send. `POST /api/config` with `{ "m
536
561
  | --- | --- | --- | --- |
537
562
  | `max_steps_per_turn` | `integer` | — | Maximum steps per turn; unset or `0` means unlimited |
538
563
  | `max_attempts_per_step` | `integer` | `5` | Maximum total attempts for a failing step, including the initial attempt |
564
+ | `thinking_only_continuation` | `boolean` | `true` | Send one explicit `Continue.` user message when a model ends normally with only non-empty thinking |
565
+ | `zero_output_continuation` | `boolean` | `false` | Send one explicit `Continue.` user message when a normal completion has no thinking text, visible text, or tool call |
539
566
  | `reserved_context_size` | `integer` | `50000` | Tokens reserved above the automatic compaction point for model output |
540
567
  | `auto_compact` | `string` | — | Global default compaction point as a percentage of the model's usable context (e.g. `"85%"`). This layer does not accept token counts; model, profile, and session settings use positive integer tokens |
541
568
  | `compaction_trigger_ratio` | `number` | `0.85` | Legacy trigger ratio, used only when no `auto_compact` is set at any layer |
@@ -546,7 +573,13 @@ The compaction point resolves in this order: the session's per-model token overr
546
573
 
547
574
  `max_steps_per_turn` can be overridden by the `KIKI_LOOP_MAX_STEPS_PER_TURN` environment variable, and `max_attempts_per_step` by `KIKI_LOOP_MAX_ATTEMPTS_PER_STEP`; both take higher priority than the config file.
548
575
 
549
- Retries only apply to transient failures — connection errors, timeouts, HTTP 429 rate limits, and all HTTP 500–599 server errors. A 429 caused by an exhausted quota or insufficient account balance is not retried and fails immediately, since it cannot succeed until the account is recharged.
576
+ Retries apply to transient failures — connection errors, timeouts, HTTP 429 rate limits, and eligible HTTP 500–599 server errors. Partial output normally stops rather than replaying the request; for native agent turns, a connection interruption after output can be retried when `[retry].retry_partial_responses` is `true` (the default). HTTP 429 or 500–599 failures after output, safety refusals, and exhausted quota still stop without replaying the request.
577
+
578
+ When a provider confirms a normal end with non-empty thinking but no answer, tool call, or refusal, Kiki keeps the thinking and its signature and sends a `Continue.` user message at most once per turn. A gateway's exact `antigravity_thinking_only` event can also qualify, but only when Kiki retained the actual thinking and confirmed that no other output, grounding, or refusal occurred. Cancellation, missing terminal events, interrupted streams, and token-limit stops do not qualify. The follow-up counts as a real model request with its own usage. A second empty response or failure stops the turn—even HTTP 429 or a temporary server error is not retried for this follow-up.
579
+
580
+ Set `[loop_control] thinking_only_continuation = false` to disable this automatic message. Changes apply at the next step boundary. Google models that reject a trailing model turn keep their existing original-snapshot retry; it shares the same one-recovery-per-turn budget and is not disabled by this setting. Google `CONTINUATION` stops still require a continuation token that this SDK cannot send.
581
+
582
+ `zero_output_continuation` stays off when omitted or set to `false`. Set `[loop_control] zero_output_continuation = true` to send one `Continue.` user message after a provider confirms a normal completion whose thinking text, visible answer, and tool calls are all empty. A signature attached to empty thinking is not thinking content and stays in the conversation. Non-empty redacted thinking data is output. Non-empty thinking text still uses `thinking_only_continuation`. A child agent uses the same rule; while the switch is off, a child completion with no content still fails, and a second empty completion stops the turn. Token counts do not decide this. The choice applies at the next step boundary. That follow-up is one model request in the same turn and is not retried as a connection or rate-limit error. Cancellation, provider errors, and a stream that ends without a normal stop stay on their existing paths.
550
583
 
551
584
  ### Continuity reminder settings
552
585
 
@@ -590,38 +623,60 @@ New sessions keep changing date, directory listings, workspace instructions and
590
623
 
591
624
  ## `retry`
592
625
 
593
- `retry` customizes the total attempt budget and fixed backoff for selected step errors. By default, a retryable step gets five total attempts, with waits of 2, 4, 8, and 16 seconds plus up to 25% jitter (30–37.5 seconds in total). A provider `Retry-After` value or a matching policy's fixed `backoff` replaces the corresponding default wait. The section and each policy are strict: an unknown field is rejected rather than silently ignored.
626
+ `retry` customizes the total attempt budget and fixed backoff for selected step errors, Output Layer transformations, and session title requests. By default, each retryable operation gets five total attempts, with waits of 2, 4, 8, and 16 seconds plus up to 25% jitter (30–37.5 seconds in total). A provider `Retry-After` value or a matching policy's fixed `backoff` replaces the corresponding default wait. Policies can also target exact model and provider configuration keys, so one provider's temporary failures do not change retry behavior elsewhere. The section and each policy are strict: an unknown field is rejected rather than silently ignored.
627
+
628
+ `retry_partial_responses` defaults to `true`. Set it to `false` to disable only native agent turn retries after partial output; failures before the first token keep the existing bounded retry budget. Eligible connection retries are capped at five total attempts, including the initial request; `max_attempts` or a matching policy can lower that cap. A retry discards partial output, runs tools only after a complete response, and may incur additional charges.
594
629
 
595
630
  | Field | Type | Default | Description |
596
631
  | --- | --- | --- | --- |
597
- | `max_attempts` | `integer` | — | Maximum total attempts for a failing step, including the initial attempt; overrides `loop_control.max_attempts_per_step` |
632
+ | `max_attempts` | `integer` | — | Maximum total attempts, including the initial attempt; for agent steps, overrides `loop_control.max_attempts_per_step` |
633
+ | `retry_partial_responses` | `boolean` | `true` | Whether an eligible native agent turn with partial output may be retried; post-output connection retries are capped at five total attempts including the initial request, and `false` disables only those retries |
598
634
  | `policies` | `array<table>` | — | Ordered per-error policies written as `[[retry.policies]]`; the first matching policy applies |
599
635
 
600
636
  Each `[[retry.policies]]` entry has these fields:
601
637
 
602
638
  | Field | Type | Required | Description |
603
639
  | --- | --- | --- | --- |
604
- | `match` | `string` | Yes | Regular expression matched against the error code and error name |
640
+ | `match` | `string` | Yes | JavaScript regular expression matched against the error code and error name; inline modifiers such as `(?i)` are invalid and cause the policy to be ignored with a configuration warning |
641
+ | `models` | `array<string>` | No | Exact canonical `[models]` keys; the policy applies only when the bound model is listed |
642
+ | `providers` | `array<string>` | No | Exact `[providers]` keys; the policy applies only when the bound provider is listed |
605
643
  | `max_attempts` | `integer` | No | Total attempts for matching errors, including the initial attempt; overrides the section-level budget |
606
644
  | `backoff` | `integer` | No | Fixed delay in milliseconds before each retry; a provider retry-after hint still takes precedence |
607
645
  | `retry` | `boolean` | No | Defaults to `true`. `false` can suppress an error that Kiki normally considers retryable; `true` cannot force retries for an error classified as non-retryable |
608
646
 
609
- Policies are checked from top to bottom, so put specific regular expressions before broader ones:
647
+ Policies are checked from top to bottom. A policy whose `models` or `providers` selector does not contain the current binding is skipped; the first remaining policy whose `match` expression matches the error applies. If both selectors are present, both must match. Omitting both selectors preserves the earlier global per-error behavior.
610
648
 
611
- ```toml
612
- [retry]
613
- max_attempts = 4
649
+ This example keeps the ordinary five-attempt default for every other model and provider, but gives one native Google GenAI Argon binding up to 20 total attempts for HTTP 429 rate limits:
614
650
 
651
+ ```toml
615
652
  [[retry.policies]]
616
653
  match = '^provider\.rate_limit$'
617
- max_attempts = 6
618
- backoff = 1000
619
-
620
- [[retry.policies]]
621
- match = '^provider\.'
622
- retry = false
654
+ models = ['gemini-4-argon']
655
+ providers = ['google-native']
656
+ max_attempts = 20
657
+ backoff = 15000
623
658
  ```
624
659
 
660
+ Replace `gemini-4-argon` and `google-native` with the exact keys used in your `[models]` and `[providers]` tables. The `backoff` applies only when the provider does not send `Retry-After`. A model stream that ends without its protocol's completion event is a connection failure, not a successful partial answer. With partial output, only an eligible connection interruption can be retried; HTTP 429 or 500–599 failures after output and other provider failures are not made retryable by this setting. Each eligible retry discards the failed attempt's output, and native tools run only after a complete response; the failed generation may incur additional charges. The policy does not make HTTP 400, exhausted quota, or already-executed failures retryable; `retry = true` never overrides Kiki's non-retryable classification.
661
+
662
+ ## `session_residency`
663
+
664
+ Session restoration uses a process-wide queue, shared across workspaces. Empty sessions without an agent or main wire bypass this queue. Idle-session reclamation runs before acquiring a restore slot, so unloading a slow session does not occupy one.
665
+
666
+ | Field | Type | Default | Description |
667
+ | --- | --- | --- | --- |
668
+ | `idle_ttl_ms` | integer, 0–2147483647 | `600000` (10 minutes) | Minimum idle age before the periodic sweep can unload a session when the live-session capacity is not under pressure |
669
+ | `max_live_sessions` | positive integer | `max(16, floor(M / 128))` | Live-session capacity. When the process is at or above this capacity, idle sessions use `min_idle_ms` as the quicker reclamation threshold |
670
+ | `min_idle_ms` | integer, 0–2147483647 | `60000` (1 minute) | Minimum idle age used while live-session capacity or heap pressure requires reclamation |
671
+ | `sweep_interval_ms` | integer, 1000–2147483647 | `30000` (30 seconds) | Periodic eviction check interval |
672
+ | `max_concurrent_restores` | positive integer | `W` | Concurrent cold-session restores. Raising it takes effect without restarting and immediately wakes queued restores. Lowering it leaves current restores running |
673
+ | `max_queued_restores` | non-negative integer | `max(128, 16C)` | Maximum waiting restores; additional requests fail with a queue-full error |
674
+ | `max_resident_heap_bytes` | non-negative integer | `min(max(256, floor(M / 8)) MiB, 60% of the effective V8 heap)` | Heap-pressure threshold for idle-session reclamation. `0` disables this heap trigger, but capacity and idle-time rules still apply |
675
+
676
+ The timer fields use Node's maximum timer delay of `2147483647` milliseconds. Explicit values are not capped at the former `64`-session, `4`-restore, or `64`-queued-restore schema limits.
677
+
678
+ Each restore has a 60-second deadline, including its queue wait. A timed-out restore releases its slot; a saved message remains available for retry or cancellation. See [durable prompt recovery](../server/rest-api.md#prompts) for message state and GUI recovery actions.
679
+
625
680
  ## `transcript_memory`
626
681
 
627
682
  `transcript_memory` controls how much transcript history the server keeps in memory. All three fields are optional: an omitted field uses its default.
@@ -630,9 +685,9 @@ retry = false
630
685
  | --- | --- | --- | --- |
631
686
  | `tail_turns` | positive integer | `20` | How many finished turns stay resident per agent |
632
687
  | `max_agent_bytes` | positive integer | `16777216` (16 MiB) | Per-agent resident byte budget — what stays in memory. Older turns are read from disk on demand |
633
- | `max_detail_cache_bytes` | non-negative safe integer | `268435456` (256 MiB) | Largest single full-detail read cached at once. `0` turns that extra slot off, leaving the content to be read without being held in that cache. A changed value takes effect at the next cache admission or eviction; lowering it evicts what no longer fits, and does not cancel a read already in progress |
688
+ | `max_detail_cache_bytes` | non-negative safe integer | `H` MiB | Largest single full-detail read cached at once. `0` turns that extra slot off, leaving the content to be read without being held in that cache. A changed value takes effect at the next cache admission or eviction; lowering it evicts what no longer fits, and does not cancel a read already in progress |
634
689
 
635
- These are server-side memory budgets, not read limits. Lowering them reduces memory use and may mean reading the same content from disk again.
690
+ `H` is the hardware-derived worker heap from [hardware-scaled resource defaults](#hardware-scaled-resource-defaults). These are server-side memory budgets, not read limits. Lowering them reduces memory use and may mean reading the same content from disk again.
636
691
 
637
692
  ## `token_counting`
638
693
 
@@ -666,7 +721,7 @@ In print mode (`kiki -p "<prompt>"`), Kiki stays alive after the main agent's tu
666
721
 
667
722
  ## `subagent`
668
723
 
669
- `subagent` controls how spawned subagents (`AgentRun`) run. Role selection uses the profile's [`can_spawn_subagents`, `allowed_subagents`, `preferred_subagents`, and `deny_subagents`](../customization/agents-and-subagents.md#agent-file-format); the former host dispatch-policy settings are removed.
724
+ `subagent` controls how spawned subagents (`AgentRun`) run. Role selection uses the profile's [`can_spawn_subagents`, `allowed_subagents`, `preferred_subagents`, and `deny_subagents`](../customization/agents-and-subagents.md#agent-file-format); the former host dispatch-policy settings are removed. Reserved native engine targets such as `engine:claude-acp` are ordinary stable target names for these checks: an explicit `allowed_subagents` list must include the exact `engine:<executor-id>` name to permit that child. Projecting a target from an executor descriptor never widens an existing allowlist.
670
725
 
671
726
  | Field | Type | Default | Description |
672
727
  | --- | --- | --- | --- |
@@ -802,6 +857,29 @@ Like the `tools` / `disallowedTools` fields of an agent file, this section shape
802
857
 
803
858
  Which image formats reach the model depends on the provider the request resolves to. Every provider accepts PNG, JPEG, GIF, and WebP; the Kimi provider additionally accepts BMP, HEIC, and HEIF, so an iPhone photo needs no conversion first. Any other image is replaced by a text notice that names the formats the current provider accepts.
804
859
 
860
+ ## `cpu_workers`
861
+
862
+ `cpu_workers` controls the App-scoped pool for CPU-bound work. Its first landed consumer is the initial image decode used to validate image data; it does not change the image size or format limits in [`image`](#image). The pool creates worker threads lazily on the first request and closes them during App teardown.
863
+
864
+ The values below are an explicit override example, not the defaults:
865
+
866
+ ```toml
867
+ [cpu_workers]
868
+ max_workers = 4
869
+ max_queue = 64
870
+ max_queued_bytes = 67108864
871
+ timeout_ms = 30000
872
+ ```
873
+
874
+ | Field | Type | Default | Environment variable | Description |
875
+ | --- | --- | --- | --- | --- |
876
+ | `max_workers` | positive integer | `W` | `KIKI_CPU_MAX_WORKERS` | The pool size is `max(1, min(os.availableParallelism() - 1, max_workers))`; the schema no longer imposes a `64` upper bound |
877
+ | `max_queue` | positive integer | `max(128, 16W)` | `KIKI_CPU_MAX_QUEUE` | Maximum number of requests waiting for a worker, not counting active requests; the schema no longer imposes a `1024` upper bound |
878
+ | `max_queued_bytes` | positive integer | `max(64, floor(M / 128))` MiB | `KIKI_CPU_MAX_QUEUED_BYTES` | Maximum total bytes declared by queued requests |
879
+ | `timeout_ms` | positive integer, up to `2147483647` | `30000` (30 seconds) | `KIKI_CPU_TIMEOUT_MS` | Request timeout in milliseconds, including time spent waiting in the queue |
880
+
881
+ `C`, `M`, `W`, and `H` are defined in [hardware-scaled resource defaults](#hardware-scaled-resource-defaults). Environment variables take precedence over `config.toml` and are read at startup. The queue is bounded by both `max_queue` and `max_queued_bytes`; when either limit is reached, new requests are rejected with `CPU_QUEUE_FULL` rather than waiting. If an active request is canceled or times out, its worker is terminated and the next request starts on a replacement; the failed work is not replayed.
882
+
805
883
  ## `session_title`
806
884
 
807
885
  `session_title` chooses how AI session titles are written.
@@ -814,7 +892,7 @@ Which image formats reach the model depends on the provider the request resolves
814
892
 
815
893
  The built-in prompt asks for a recognizable title based on the current purpose and concrete subject, keeping useful names and identifiers without claiming unproven success. Changing `prompt` takes effect on the next title request, including in an open session, without restarting. Saving or removing the override does not rename existing sessions or send a title request.
816
894
 
817
- A model you picked is used as-is, under the same excerpt budgets. Automatic titling never overwrites a title you typed yourself, and neither does an ordinary on-demand request. Only a forced request replaces a title you set by hand.
895
+ A model you picked is used as-is, under the same excerpt budgets. Zero-output transient failures follow [`retry`](#retry); a missing model or invalid configuration fails once, and observed model output is never replayed. Automatic titling never overwrites a title you typed yourself, including during retry backoff, and neither does an ordinary on-demand request. Only a forced request replaces a title you set by hand.
818
896
 
819
897
  `GET /api/config` and successful `POST /api/config` responses include `session_title.default_prompt` and `prompt_source` (`default` or `custom`). These are read-only fields; `prompt` is returned only for a nonblank override. Save with `{ "session_title": { "prompt": "Your title instructions" } }`, or remove the override with `{ "session_title": { "prompt": null } }`. Omitted fields stay unchanged, so these patches preserve `model` and `triggers`. Use `model: null` to remove the model without erasing the prompt or selected moments; do not use `replace_domains` for a single-field edit.
820
898
 
@@ -836,16 +914,19 @@ Any registered flag can be overridden here by id, with a boolean value. Every bu
836
914
 
837
915
  ## `browser_control`
838
916
 
839
- `browser_control` holds the browser connections managed by [Browser control](../guides/settings.md#browser-control) and the default used for new sessions. The settings page is the supported editor: it saves one entry per connection, reads it back before showing the result, and saving never starts a browser.
917
+ `browser_control` holds the browser connections managed by [Browser control](../guides/settings.md#browser-control) and the default used for new sessions. The settings page is the supported editor: it saves one entry per connection, reads it back before showing the result, and saving never starts a browser. To add an HTTP bridge connection, choose **Add browser** and set **Connection style** to **Kimi WebBridge**.
840
918
 
841
919
  | Field | Type | Description |
842
920
  | --- | --- | --- |
843
921
  | `default_browser` | `string` | Connection id used for sessions created afterwards; unset means a call has to name a connection |
844
922
  | `allowed_browsers` | `string[]` | Connection ids an agent may use. Omit it to keep the previous default. An empty list still allows listing and discovery |
845
923
  | `disabled_sources` | `string[]` | Sources that are off: `kimi-webbridge`, `independent-browser`, `codex-browser`, `ego-lite`. Turning a source off does not clear `allowed_browsers` |
924
+ | `webbridge_preset_route` | `boolean` | Defaults to `true`: route the legacy `kimi-webbridge` id stored as `agent-browser-cdp` through the Kimi HTTP bridge. Set `false` to keep that entry on the CDP driver |
846
925
  | `connections` | `table` | One entry per connection, keyed by the connection's fixed id |
847
926
 
848
- Each entry describes one connection through its `type` (`agent-browser-profile` or `agent-browser-cdp`), `name`, `enabled`, and the fields that style needs; the settings page shows the fields for each style. An entry whose fields do not match its style is rejected and the saved file is left unchanged. A stored CDP address counts as a credential: the page masks it and reveals it only when asked.
927
+ Each entry has `name`, `enabled`, and a `type`: `agent-browser-profile`, `agent-browser-cdp`, `codex-extension`, `ego-lite`, `kimi-webbridge`, or `webbridge-command`. The [browser connection API](../server/rest-api.md#browser-connections) describes each type's fields. Fields that do not match the type are rejected without changing the saved file. A stored CDP address counts as a credential: the page masks it and reveals it only when asked. `webbridge-command` takes only `name` and `enabled`, uses the fixed local command bridge, and belongs to the `kimi-webbridge` source switch. It has no endpoint or driver path; a CDP row is not converted into this type.
928
+
929
+ The `kimi-webbridge` type uses the server's local HTTP daemon at `http://127.0.0.1:10086` and takes no endpoint. This is not a CDP address. The legacy-id routing above does not rewrite the saved entry and does not affect other CDP ids; an explicit `kimi-webbridge` type always uses HTTP, even when `webbridge_preset_route` is `false`.
849
930
 
850
931
  ## `computer_control`
851
932
 
@@ -868,6 +949,8 @@ Computer tools from the recognized cua-driver MCP default to the main agent of e
868
949
 
869
950
  The default `WebSearch` lane is `duckduckgo.search`, which searches the general web without registration, credentials or configuration. Its public HTML endpoint may issue a challenge or rate limit; wait before retrying, or explicitly choose another configured source. These failures are errors, not empty results, and never trigger a silent switch to a paid provider. Configured defaults and explicit lane selections take precedence. For repository search or library documentation, choose `github.repositories` or `context7.docs` explicitly; the latter returns typed context and cannot be combined with result lanes. Field names and merge behavior follow the module's canonical configuration contract, shared with the standalone nb-search CLI, so an existing nb-search configuration file applies without translation.
870
951
 
952
+ Search memory and queue defaults follow the same hardware formula: the single query worker uses `H` MiB, keeps 8 active slots, and queues `max(128, 16C)` requests. The indexer child uses `H` MiB, with soft RSS `2H + 256` MiB and hard RSS `3H + 256` MiB. Explicit host options override `KIKI_SEARCH_INDEXER_SOFT_MB` and `KIKI_SEARCH_INDEXER_HARD_MB`, which override these defaults; writer election remains single-writer. These are local resource budgets, not provider rate limits.
953
+
871
954
  | Field | Type | Required | Description |
872
955
  | --- | --- | --- | --- |
873
956
  | `provider_instances` | `table` | No | Named provider instances with `provider_id`, `enabled`, optional `credential_slot_id` / `base_url`, `key_strategy` (`round-robin` or `priority`), `balance_ttl_ms` (60,000–86,400,000), and provider-specific `options` |
@@ -1009,37 +1092,29 @@ dangerous_bash = "default"
1009
1092
 
1010
1093
  `review` ("Approve for me") keeps Auto's routine approvals but sends policy-generated approval requests to a reviewer first. An explicit configured `deny` rule always blocks the call; an exact "approve for session" match is approved before configured `ask` rules and protected-path checks. Otherwise, an explicit configured `ask` rule prompts you. A confident reviewer approval proceeds without a user prompt; a confident denial stops the tool. Uncertain answers, invalid responses, timeouts, missing credentials, and unavailable reviewers ask you instead. After three consecutive reviewer denials in one turn, later requests in that turn go directly to you. Reviewer decisions do not create an "approve for session" rule.
1011
1094
 
1012
- Both reviewer backends receive up to three recent user-origin text messages, the complete Bash command or resolved file paths and operations, the policy name and reason, and the workspace directory. For reviewed `Write` and `Edit` calls, they also receive byte sizes and SHA-256 digests of the submitted content (including both sides of an edit), never file contents or raw diffs. Writes and edits to sensitive files go directly to you because the reviewer cannot verify unseen content. PEM private keys and common API-key formats are redacted from text fields. When the input exceeds its size limit, user-message text is trimmed; the action, policy and directory are never truncated. Assistant messages and tool output are not sent. Commands or target lists beyond their input bounds, fixed action/policy data beyond the size limit, actions without an exact command or resolved file target, and cases where unseen content is needed to judge safety go to user approval instead. Choose a configured model alias for the model backend:
1095
+ Reviewers receive up to three recent user-origin text messages, the complete Bash command or resolved file paths and operations, the policy name and reason, and the workspace directory. For reviewed `Write` and `Edit` calls, they also receive byte sizes and SHA-256 digests of the submitted content (including both sides of an edit), never file contents or raw diffs. Writes and edits to sensitive files go directly to you because the reviewer cannot verify unseen content. PEM private keys and common API-key formats are redacted from text fields. When the input exceeds its size limit, user-message text is trimmed; the action, policy and directory are never truncated. Assistant messages and tool output are not sent. Commands or target lists beyond their input bounds, fixed action/policy data beyond the size limit, actions without an exact command or resolved file target, and cases where unseen content is needed to judge safety go to user approval instead. Choose an existing chat model or [decision connection](./providers.md#decision-connections):
1013
1096
 
1014
1097
  ```toml
1015
1098
  # ~/.kiki/config.toml
1016
1099
  default_permission_mode = "review"
1017
1100
 
1018
1101
  [permission.reviewer]
1019
- backend = "model"
1020
- model = "k3-review"
1102
+ source = { kind = "model", model = "review-model" }
1021
1103
  allow_threshold = 0.9
1022
1104
  deny_threshold = 0.9
1023
1105
  timeout_ms = 8000
1024
1106
  categories = ["policy_compliance", "no_secret_egress", "no_irreversible_damage", "no_outward_effect", "prompt_injection_absent"]
1025
1107
  ```
1026
1108
 
1027
- `backend` accepts `model` or `jev`; the model backend requires `model`. `allow_threshold` and `deny_threshold` each accept 0.5–1; lower confidence asks you. `categories` selects Jev yes/no checks from the five names above. The default timeout is 8 seconds for a model and 4 seconds for Jev (`timeout_ms` overrides either; accepted range 100–30,000). To use TypeSafe Jev, select it as the backend and store the key separately. Choosing `backend = "jev"` is the consent to send this limited reviewer input to TypeSafe; there is no separate consent flag (an old `jev_consent` key is ignored):
1109
+ For a decision service, set `source = { kind = "connection", connection = "judgment" }`. It uses that connection's existing credentials and remote `default_model`; add `model` to the source to override the remote name. Reviewer accepts `system_one`, while `pair_score` is only for memory ranking. Choosing a source permits the limited reviewer input above to be sent to it; Memory Advisor keeps its own source and enable switch. In **Settings → Models & providers → Defaults → Who decides**, select the two sources independently. The permission settings keep the review thresholds and timeout.
1028
1110
 
1029
- ```toml
1030
- # ~/.kiki/config.toml
1031
- [permission.reviewer]
1032
- backend = "jev"
1033
- model = "jev-latest"
1034
- ```
1111
+ `allow_threshold` and `deny_threshold` each accept 0.5–1; lower confidence asks you. `categories` selects the System One yes/no checks from the five names above. `timeout_ms` accepts 100–30,000 milliseconds. Without an override, the existing `backend` setting supplies the timeout default: 8 seconds for `model` (the default), 4 seconds for `jev`.
1035
1112
 
1036
- ```toml
1037
- # ~/.kiki/credentials/credentials.toml
1038
- [permission.reviewer]
1039
- api_key = "YOUR_TYPESAFE_API_KEY"
1040
- ```
1113
+ Memory Advisor has its own `[memory.advisor] first_step_wait_ms` (0–5000 milliseconds). When it is not set, the first step waits up to 3000 ms for a `system_one` or `pair_score` source and 1500 ms for a chat model, following the current source. An explicit value always wins. See [Memory Advisor](../guides/memory.md#memory-advisor).
1114
+
1115
+ Existing configurations without `source` keep using `backend = "model"` with a model alias, or `backend = "jev"` with an optional remote model name (default `jev-latest`). Legacy Jev reads `[permission.reviewer].api_key` from `credentials.toml`, then the server's `TYPESAFE_API_KEY`; without either, approval goes to you. Choosing legacy `backend = "jev"` permits this reviewer input to TypeSafe, and an old `jev_consent` key is ignored. A new `source` takes precedence. API `source: null` clears it and the old model choice and resets `backend` to `model`, leaving the Reviewer unconfigured.
1041
1116
 
1042
- The config writer keeps `api_key` in `credentials.toml` rather than `config.toml`; `TYPESAFE_API_KEY` in the server environment is a fallback when no stored key is present. Without an available key, Jev is not called and approval goes to you. In **Settings → Permissions → Reviewer** a saved key stays masked but is not write-only: you can explicitly reveal, copy, edit, or clear it, and a key taken from the environment shows its source and can be overridden with a value saved in Kiki. Anyone holding the Kiki bearer token can reveal the stored key.
1117
+ If a legacy Reviewer key is saved, **Move to a connection** transfers it on the server; the browser never reads it for this operation. A partial result preserves concurrent changes: refresh and check settings before retrying, and choose a new connection name if the saved connection holds a different key. Afterward, reveal, copy, edit and clear credentials through the existing connection editor. Anyone holding the Kiki bearer token can reveal keys through the authenticated secret API.
1043
1118
 
1044
1119
  ::: tip
1045
1120
  MCP server declarations are configured in `~/.kiki/mcp.json` or the project-local `.kiki/mcp.json`, not in `config.toml`. The legacy `.kimi-code/mcp.json` path is not read. The interactive configuration entry point is the built-in `kiki-ops` skill (Kiki's product-usage and configuration Skill): type `/kiki-ops help me configure MCP`; see [Model Context Protocol](../server/mcp.md).
@@ -1130,13 +1205,13 @@ In the desktop GUI, open **Settings → Agents → Prompt fields** to edit this
1130
1205
 
1131
1206
  ## `[request_governance]`
1132
1207
 
1133
- `request_governance` limits either native model requests (`resource = "model_request"`) or running agents (`resource = "agent_execution"`). No rule means no concurrency cap; existing rules without `resource` remain model-request rules. In the GUI, **Usage → Live** shows running and queued requests and includes **Concurrency limits** to add, edit, pause, or delete rules. **History**, the default tab, shows token usage and estimated cost. See [Usage](../guides/settings.md#usage) for the diagnostic workflow.
1208
+ `request_governance` limits either native model requests (`resource = "model_request"`) or running agents (`resource = "agent_execution"`). No rule means no concurrency cap; existing rules without `resource` remain model-request rules. In the GUI, **Usage → Live** shows running and queued requests and includes **Concurrency limits** to add, edit, pause, or delete rules. **History** shows token usage and estimated cost, and **Live** is the tab that opens by default. See [Usage](../guides/settings.md#usage) for the diagnostic workflow.
1134
1209
 
1135
1210
  A `global` rule shares capacity across sessions in the same Kiki service process. An `each_session` rule gives each session its own bucket. These limits do not span independent Kiki processes, set requests-per-minute, or impose token or spending budgets. For search and fetch calls, use [`nb_search.execution`](#nb-search).
1136
1211
 
1137
1212
  Model-request rules count provider generation attempts, including compaction and OAuth replay. External harness requests are unmanaged, not zero. Agent-execution rules cover both Kiki and external executors launched through Kiki, including main agents, subagents, and externally delegated independent agents. One agent holds one slot throughout its execution, including tool work, approval waits, cancellation cleanup, and finalization. Idle agents, background shell tasks, and child task receipts do not add agent slots. External model identities remain unknown when the harness has not supplied a binding; Kiki never substitutes its native default model.
1138
1213
 
1139
- For example, cap all models using one provider at two simultaneous requests across sessions. Replace `example-provider` with the exact key from `[providers]`:
1214
+ For example, cap all models using one provider at two simultaneous requests across sessions. Replace `example-provider` with the exact key from `[providers]`. The `max_queue_size = 1024` line is an explicit override example; when omitted, the hardware-scaled default is `max(1024, 4 × max(128, 16C))`.
1140
1215
 
1141
1216
  ```toml
1142
1217
  [request_governance]
@@ -1183,7 +1258,7 @@ overflow = "queue"
1183
1258
  | --- | --- | --- | --- |
1184
1259
  | `schema_version` | `integer` | `1` | Configuration version; only `1` is accepted |
1185
1260
  | `max_wait_ms` | `integer` | `300000` | Positive local waiting budget in milliseconds; cumulative across model-request retries, or per agent admission |
1186
- | `max_queue_size` | `integer` | `1024` | Positive maximum number of pending admissions across both resources |
1261
+ | `max_queue_size` | positive integer | `max(1024, 4 × max(128, 16C))` | Positive maximum number of pending admissions across both resources; an explicit value remains an override |
1187
1262
  | `rules` | `array<table>` | `[]` | Concurrency rules, written as `[[request_governance.rules]]` |
1188
1263
  | Rule `id` | `string` | Required | Nonempty, unique rule identifier |
1189
1264
  | Rule `resource` | `string` | `model_request` | `model_request` or `agent_execution`; counts requests or agents, respectively |
@@ -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
@@ -54,6 +54,8 @@ $KIKI_HOME (default: ~/.kiki)
54
54
  │ └── <key>-<suffix>.json
55
55
  ├── sessions/ # Session data (see below)
56
56
  │ └── <workDirKey>/<sessionId>/
57
+ ├── store/
58
+ │ └── thread-mailbox-sqlite-v1/ # Canonical mailbox and upgrade recovery copies
57
59
  ├── server/
58
60
  │ └── events/ # Bounded client event replay journals
59
61
  ├── bin/
@@ -76,7 +78,7 @@ Each file under the data root serves a specific purpose; most are managed automa
76
78
  - **`mcp.json`**: user-level MCP server declarations, merged with the project-local `.kiki/mcp.json` on startup. See [MCP](../server/mcp.md).
77
79
  - **`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).
78
80
  - **`cognition/`**: prompt files referenced by `[models."<alias>".cognition]`; paths are relative to the data root. See [Model cognition](./config-files.md#model-cognition).
79
- - **`hooks/`**: script files referenced by `[[hooks]]` command paths (for example `node ~/.kiki/hooks/check-bash.mjs`). See [Hooks](../customization/hooks.md).
81
+ - **`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).
80
82
  - **`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).
81
83
  - **`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.
82
84
  - **`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/`.
@@ -89,7 +91,7 @@ Inside each session directory:
89
91
 
90
92
  - **`state.json`**: session metadata including title, `lastPrompt`, creation/update timestamps, and `forkedFrom`.
91
93
  - **`upcoming-goals.json`**: the TUI-only queue created by `/goal next <objective>`. It is not part of the agent conversation until a queued goal is promoted after the current goal completes.
92
- - **`agents/main/wire.jsonl`**: the main Agent's complete communication record, used for session resumption and replay.
94
+ - **`agents/main/wire.jsonl`**: the main Agent's complete communication record, used for session resumption and replay. [`kiki session seal`](../reference/command.md#kiki-session) leaves this file in place, so its size does not drop; [`kiki session unseal`](../reference/command.md#kiki-session) removes the seal without modifying the file.
93
95
  - **`agents/main/plans/`**: plan files written in Plan mode, named by plan id (`<id>.md`).
94
96
  - **`agents/agent-0/` etc.**: sub-Agent instance directories, each containing their own `wire.jsonl`.
95
97
  - **`logs/kimi-code.log`**: diagnostic log for this session; only present when a diagnostic event occurs.
@@ -104,6 +106,26 @@ Older journals shrink when the new writer first appends to them. Browsing a cold
104
106
 
105
107
  This retention does not remove `sessions/`, agent `wire.jsonl` files, or saved media. Clients whose cursor is no longer covered recover through a snapshot/reset rather than replaying the old event sequence; see [Reconnect and recovery](../server/rest-api.md#reconnect-and-recovery). If you need to clear old journals manually, first stop every Kiki server using this data root, then clear only `server/events/` and restart. Never delete or truncate these journals while a writer is running.
106
108
 
109
+ ## Canonical mailbox
110
+
111
+ `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
+ 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
+ ## Session and usage query cache
116
+
117
+ `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`. 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
+ 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. 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
+ ## Content search index
122
+
123
+ Content search uses SQLite at `search-index-v2/index.sqlite`. Kiki reuses a compatible index or rebuilds an older recognized search schema from session metadata and conversation history; results may be incomplete while rebuilding. This cache rebuild does not change the source history. The older MiniDb `search-index/` directory is left intact and is neither imported nor used as a fallback. Keep `sessions/` and `store/`: rebuilding a search cache does not replace the separate mailbox storage upgrade.
124
+
125
+ In the 0.5 migration series, an explicit `search_backend = "minidb"` in `config.toml` or `KIKI_SEARCH_BACKEND=minidb` is a deprecated alias for SQLite and produces a migration warning. Remove the old setting, or change it to `sqlite`, before upgrading to 0.6, which retires that value. Environment selection takes precedence over `search_backend`; Kiki does not rewrite either setting. The old `search_worker` experimental switch has been removed because SQLite always isolates database work in its writer process and query worker.
126
+
127
+ Search is available by default. `[search] enabled = false`, `KIKI_SEARCH_DISABLED=1`, or an explicit desktop `desktop_search = false` keeps it off; the migration alias does not start a worker or rebuild the cache when search is disabled. Set `[search] index_subagents = true` to include subagent content; it is off by default. These settings take effect after restarting Kiki. Search matches user and assistant text and session titles by default; tool-result output is included only when explicitly requested. Thinking, tool names, and tool-call arguments stay excluded.
128
+
107
129
  ## Built-in tool cache
108
130
 
109
131
  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.
@@ -112,6 +134,11 @@ The first time the `Grep` tool needs ripgrep, the CLI can automatically download
112
134
 
113
135
  - **`logs/kimi-code.log`** (global): records startup, login, export, and other cross-session events.
114
136
  - **`<sessionDir>/logs/kimi-code.log`** (session-level): records diagnostic events within a single session.
137
+ - **`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.
138
+ - **`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.
139
+ - **`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.
140
+
141
+ When investigating a daemon restart, keep `server-runtime.log`, `desktop-backend.log`, their backups and any matching report. A forced process termination can prevent the daemon's final record; the desktop owner's exit record is the next source of evidence.
115
142
 
116
143
  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.
117
144