@bastani/atomic 0.10.9-alpha.1 → 0.10.10-alpha.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 (401) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +211 -155
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  10. package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
  11. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  12. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
  13. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
  14. package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  16. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  17. package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
  18. package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
  19. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  20. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  21. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
  22. package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
  23. package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
  24. package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
  25. package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
  26. package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
  27. package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
  28. package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
  29. package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
  30. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
  31. package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
  32. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
  33. package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
  34. package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
  35. package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
  36. package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
  37. package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
  38. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
  39. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  40. package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
  41. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  42. package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
  43. package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
  44. package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
  45. package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  48. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  49. package/dist/builtin/intercom/README.md +85 -114
  50. package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
  51. package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
  52. package/dist/builtin/intercom/group.ts +7 -3
  53. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  54. package/dist/builtin/intercom/package.json +1 -1
  55. package/dist/builtin/mcp/README.md +37 -27
  56. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  57. package/dist/builtin/mcp/package.json +1 -1
  58. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  59. package/dist/builtin/subagents/README.md +71 -138
  60. package/dist/builtin/subagents/package.json +1 -1
  61. package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
  62. package/dist/builtin/web-access/CHANGELOG.md +9 -0
  63. package/dist/builtin/web-access/README.md +60 -87
  64. package/dist/builtin/web-access/index.bundle.mjs +387 -351
  65. package/dist/builtin/web-access/package.json +1 -1
  66. package/dist/cli/args.js +2 -2
  67. package/dist/cli/auth-cli.code.js +4 -4
  68. package/dist/cli/auth-cli.impl.js +3 -3
  69. package/dist/cli/auth-cli.js +3 -3
  70. package/dist/cli/blueprint-command.code.js +2 -2
  71. package/dist/cli/blueprint-command.impl.js +3 -3
  72. package/dist/cli/blueprint-command.js +3 -3
  73. package/dist/cli/intercom-command.code.js +3 -3
  74. package/dist/cli/intercom-command.impl.js +3 -3
  75. package/dist/cli/intercom-command.js +3 -3
  76. package/dist/cli/list-models.code.js +3 -3
  77. package/dist/cli/list-models.impl.js +3 -3
  78. package/dist/cli/list-models.js +3 -3
  79. package/dist/cli/session-picker.code.js +2 -2
  80. package/dist/cli/session-picker.impl.js +3 -3
  81. package/dist/cli/session-picker.js +3 -3
  82. package/dist/cli/startup-ui.code.js +2 -2
  83. package/dist/cli/startup-ui.impl.js +3 -3
  84. package/dist/cli/startup-ui.js +3 -3
  85. package/dist/cli/storage-command.impl.js +3 -3
  86. package/dist/cli/storage-command.js +3 -3
  87. package/dist/cli/storage-search-session.code.js +2 -2
  88. package/dist/cli/storage-search-session.impl.js +3 -3
  89. package/dist/cli/storage-search-session.js +3 -3
  90. package/dist/cli/team-command.code.js +2 -2
  91. package/dist/cli/team-command.impl.js +3 -3
  92. package/dist/cli/team-command.js +3 -3
  93. package/dist/cli.js +2 -2
  94. package/dist/core/agent-session-methods.d.ts +4 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +3 -0
  97. package/dist/core/compaction/compactor.d.ts +20 -14
  98. package/dist/core/compaction/errors.d.ts +120 -0
  99. package/dist/core/compaction/index.d.ts +1 -0
  100. package/dist/core/compaction/model-resolver.d.ts +2 -2
  101. package/dist/core/debug.impl.js +3 -3
  102. package/dist/core/debug.js +3 -3
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  111. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  112. package/dist/core/export-html/tool-renderer.code.js +1 -1
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/api-types.d.ts +1 -1
  116. package/dist/core/extensions/api-types.js.map +1 -1
  117. package/dist/core/extensions/index.d.ts +1 -1
  118. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  119. package/dist/core/extensions/jiti-loader.js +3 -3
  120. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  121. package/dist/core/extensions/jiti-static-loader.js +3 -3
  122. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  123. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  124. package/dist/core/extensions/loader-host-modules.js +3 -3
  125. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  126. package/dist/core/extensions/provider-types.d.ts +18 -6
  127. package/dist/core/extensions/provider-types.js.map +1 -1
  128. package/dist/core/extensions/runner-context.js +1 -1
  129. package/dist/core/intercom-broker-control-host.code.js +1 -1
  130. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  131. package/dist/core/intercom-broker-control-host.js +3 -3
  132. package/dist/core/intercom-broker-control.code.js +3 -3
  133. package/dist/core/intercom-broker-control.impl.js +3 -3
  134. package/dist/core/intercom-broker-control.js +3 -3
  135. package/dist/core/model-config.d.ts +40 -0
  136. package/dist/core/model-registry.js +1 -1
  137. package/dist/core/model-resolver-scope.d.ts +4 -4
  138. package/dist/core/model-runtime.d.ts +1 -1
  139. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  140. package/dist/core/package-manager-storage-adapters.js +3 -3
  141. package/dist/core/provider-composer-internal.d.ts +11 -2
  142. package/dist/core/sdk.code.js +3 -3
  143. package/dist/core/sdk.impl.js +3 -3
  144. package/dist/core/sdk.js +3 -3
  145. package/dist/core/session-manager-core.js +5 -5
  146. package/dist/core/session-manager-list.impl.js +3 -3
  147. package/dist/core/session-manager-list.js +3 -3
  148. package/dist/core/session-manager.code.js +1 -1
  149. package/dist/core/session-manager.impl.js +3 -3
  150. package/dist/core/session-manager.js +3 -3
  151. package/dist/core/session-storage.impl.js +3 -3
  152. package/dist/core/session-storage.js +3 -3
  153. package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
  154. package/dist/core/storage/index.js +2 -2
  155. package/dist/core/storage/node-sqlite-thread.js +2 -2
  156. package/dist/core/storage/node-sqlite.js +2 -2
  157. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  158. package/dist/core/storage/offline-snapshot-file.js +3 -3
  159. package/dist/core/storage/provider.js +2 -2
  160. package/dist/core/storage/selection.js +2 -2
  161. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  162. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  163. package/dist/core/storage/session/branch-fork-source.js +3 -3
  164. package/dist/core/storage/session/card-view.impl.js +3 -3
  165. package/dist/core/storage/session/card-view.js +3 -3
  166. package/dist/core/storage/session/child-reader.code.js +3 -3
  167. package/dist/core/storage/session/child-reader.impl.js +3 -3
  168. package/dist/core/storage/session/child-reader.js +3 -3
  169. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  170. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  171. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  172. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  173. package/dist/core/storage/session/expanded-child-details.js +3 -3
  174. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  175. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  176. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  177. package/dist/core/storage/session/fork-row-index.js +3 -3
  178. package/dist/core/storage/session/fork-staging.code.js +2 -2
  179. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  180. package/dist/core/storage/session/fork-staging.js +3 -3
  181. package/dist/core/storage/session/fork-window.code.js +3 -3
  182. package/dist/core/storage/session/fork-window.impl.js +3 -3
  183. package/dist/core/storage/session/fork-window.js +3 -3
  184. package/dist/core/storage/session/history-pages.impl.js +3 -3
  185. package/dist/core/storage/session/history-pages.js +3 -3
  186. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  187. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  188. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  189. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  190. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  191. package/dist/core/storage/session/memory-session-store.js +3 -3
  192. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  193. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  194. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  195. package/dist/core/storage/session/released-history-files.code.js +3 -3
  196. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  197. package/dist/core/storage/session/released-history-files.js +3 -3
  198. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  199. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  200. package/dist/core/storage/session/session-resume.impl.js +3 -3
  201. package/dist/core/storage/session/session-resume.js +3 -3
  202. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  203. package/dist/core/storage/session/snapshot-cut.js +3 -3
  204. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  205. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  206. package/dist/core/storage/session/snapshot-history.js +3 -3
  207. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  208. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  209. package/dist/core/storage/session/sql-session-store.js +3 -3
  210. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  211. package/dist/core/storage/session/tree-outline.js +3 -3
  212. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  213. package/dist/core/storage/session/tree-presentation.js +3 -3
  214. package/dist/core/storage/storage-status.impl.js +3 -3
  215. package/dist/core/storage/storage-status.js +3 -3
  216. package/dist/core/storage/team.impl.js +3 -3
  217. package/dist/core/storage/team.js +3 -3
  218. package/dist/core/structured-output/index.code.js +1 -1
  219. package/dist/core/structured-output/index.impl.js +3 -3
  220. package/dist/core/structured-output/index.js +3 -3
  221. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  222. package/dist/core/tasks/task-completion-entry.js +3 -3
  223. package/dist/core/tasks/task-file-history.code.js +3 -3
  224. package/dist/core/tasks/task-file-history.impl.js +3 -3
  225. package/dist/core/tasks/task-file-history.js +3 -3
  226. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  227. package/dist/core/tasks/task-reference-archive.js +3 -3
  228. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  229. package/dist/core/tasks/task-reference-identity.js +3 -3
  230. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  231. package/dist/core/tasks/task-reference-stream.js +3 -3
  232. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  233. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  234. package/dist/core/tasks/task-view-source.impl.js +3 -3
  235. package/dist/core/tasks/task-view-source.js +3 -3
  236. package/dist/core/tools/read-url.code.js +2 -2
  237. package/dist/core/tools/read-url.impl.js +3 -3
  238. package/dist/core/tools/read-url.js +3 -3
  239. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  240. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  241. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  242. package/dist/core/worktree-snapshot/errors.js +3 -3
  243. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  244. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  245. package/dist/extensions/codemode/execute.code.js +1 -1
  246. package/dist/extensions/codemode/execute.impl.js +3 -3
  247. package/dist/extensions/codemode/execute.js +3 -3
  248. package/dist/extensions/codemode/renderer.code.js +2 -2
  249. package/dist/extensions/codemode/renderer.impl.js +3 -3
  250. package/dist/extensions/codemode/renderer.js +3 -3
  251. package/dist/extensions/mcp/cli.code.js +2 -2
  252. package/dist/extensions/mcp/cli.impl.js +3 -3
  253. package/dist/extensions/mcp/cli.js +3 -3
  254. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  255. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  256. package/dist/extensions/mcp/cli.lazy.js +3 -3
  257. package/dist/extensions/mcp/runtime.code.js +1 -1
  258. package/dist/extensions/mcp/runtime.impl.js +3 -3
  259. package/dist/extensions/mcp/runtime.js +3 -3
  260. package/dist/index-extensions.d.ts +1 -1
  261. package/dist/index.d.ts +8 -1
  262. package/dist/index.js +7 -7
  263. package/dist/main-first-time-setup.code.js +2 -2
  264. package/dist/main-first-time-setup.impl.js +3 -3
  265. package/dist/main-first-time-setup.js +3 -3
  266. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
  267. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  268. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  269. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  270. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  271. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  272. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  273. package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
  274. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  275. package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
  276. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  277. package/dist/modes/print-mode.js +1 -1
  278. package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
  279. package/dist/modes/rpc/rpc-types.d.ts +29 -2
  280. package/dist/package-manager-cli.code.js +5 -5
  281. package/dist/package-manager-cli.impl.js +3 -3
  282. package/dist/package-manager-cli.js +3 -3
  283. package/dist/rpc-entry.js +1 -1
  284. package/dist/startup-files.json +1 -1
  285. package/dist/startup-stages/5.js +1 -1
  286. package/dist/startup-stages/7.js +1 -1
  287. package/dist/startup-stages/8.js +1 -2
  288. package/dist/startup-stages/9.js +2 -1
  289. package/dist/utils/native-module.d.ts +44 -0
  290. package/dist/utils/startup-database-spare.code.js +3 -3
  291. package/dist/utils/startup-database-spare.impl.js +3 -3
  292. package/dist/utils/startup-database-spare.js +3 -3
  293. package/dist/utils/tools-manager.code.js +1 -1
  294. package/dist/utils/tools-manager.impl.js +3 -3
  295. package/dist/utils/tools-manager.js +3 -3
  296. package/docs/background-tasks.md +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
@@ -1,20 +1,15 @@
1
1
  ---
2
2
  title: "Context and compaction"
3
- description: "How compaction clears or compacts the context window, how the agent recovers earlier work from session history, and branch summarization."
3
+ sidebarTitle: "Compaction"
4
+ description: "Clear or compact long conversations, recover earlier details from session history, and summarize abandoned branches."
4
5
  ---
5
6
 
6
- # Compaction and branch summarization
7
-
8
7
  LLMs have finite context windows. When a session nears its limit, Atomic compacts the context window in one of two ways:
9
8
 
10
9
  - **Context cleared (default).** No model is called. Atomic clears the context window, and the agent recovers what it needs from session history using its own tools.
11
10
  - **Context compacted.** When `compactionModel` names a compactor model, Atomic sends the conversation to that compactor once and replaces the context with its output.
12
11
 
13
- In both modes, the full conversation stays in session history and the boundary message tells the agent where to find it. Branch summarization is a separate, lossy summary offered when you navigate away from a branch with `/tree`.
14
-
15
- ## On this page and its reference
16
-
17
- This page covers how compaction and branch summarization work in everyday use. Parameters, saved entry formats, extension hooks, exports, and settings live in the [Compaction reference](/compaction/reference).
12
+ In both modes, the full conversation stays in session history and the boundary message tells the agent where to find it. Branch summarization is a separate, lossy summary offered when you navigate away from a branch with `/tree`. For parameters, saved boundary fields, extension hooks, SDK concurrency rules, and settings, see [Compaction reference](/compaction/reference).
18
13
 
19
14
  ## Overview
20
15
 
@@ -22,7 +17,7 @@ This page covers how compaction and branch summarization work in everyday use. P
22
17
  | --- | --- | --- | --- |
23
18
  | Context cleared | `compactionModel` is `auto` or empty, or the compactor failed | None | The system prompt and one `Context cleared` message |
24
19
  | Context compacted | `compactionModel` names a compactor model, or an extension supplied replacement text | One compactor request | The system prompt and one `Context compacted` message holding the compacted text |
25
- | Branch summarization | Optional, when `/tree` leaves a branch | One summary request | A `BranchSummaryEntry` at the new branch position |
20
+ | Branch summarization | Optional, when `/tree` leaves a branch | One summary request | A branch summary at the new branch position |
26
21
 
27
22
  ## When compaction runs
28
23
 
@@ -31,30 +26,22 @@ Atomic triggers compaction in five situations:
31
26
  - **Automatic threshold.** Estimated context usage exceeds the model's context window minus `compaction.reserveTokens`. Atomic checks after tool results arrive, before follow-up requests, and before every new request. A completed answer that finishes over the threshold stays as the session's last answer so `prompt()`, RPC `get_last_assistant_text`, and `/copy` can read it; Atomic clears the context right before the next request. When a provider reports all-zero usage, Atomic estimates visible message size instead of skipping the check.
32
27
  - **Resumed near the window.** On a Claude model with a fixed thinking budget, the first prompt after resume clears earlier conversation when newly added resume context (changed `AGENTS.md` or prompt files, blueprint context, or recovery notices) would crowd out the thinking budget. The resume additions stay in context after the boundary. When automatic compaction is off, or clearing does not run, Atomic shrinks the thinking budget to fit instead.
33
28
  - **Overflow.** On a provider context-overflow error, Atomic compacts and retries the interrupted turn once per turn.
34
- - **Truncated response.** When a response stops with `length` before the requested output cap, Atomic runs one compact-and-retry. If nothing can be compacted, Atomic attempts at most one direct continuation instead.
29
+ - **Truncated response.** When a response stops with `length` before the requested output cap, Atomic runs one compact-and-retry (or at most one direct continuation if nothing can be compacted). When a response hits the requested output cap, Atomic runs up to 3 direct continuations; on an output-budget error, Atomic runs at most 1 direct continuation.
35
30
  - **Manual.** Run `/compact [instructions]`, call `ctx.compact()` or `session.compact()`, or send RPC `{ "type": "compact" }`.
36
31
 
37
- ### Boundaries, cancellation, and concurrency
38
-
39
- A boundary never lands mid-stream or between a tool call and its result. Manual compaction stops the active run before starting. While a tool call waits for its result, no boundary is written; automatic compaction clears context before the next request with the result, and `/compact` reports that a tool call is waiting.
32
+ ### Safety, backups, and cancellation
40
33
 
41
- When nothing new has entered context since the last boundary, compaction does nothing and `/compact` reports `Nothing to compact`. Automatic compaction also skips when the system prompt and boundary message alone would still exceed the trigger, so [`fallbackModels`](/settings#fallbackmodels) handles any provider overflow.
34
+ A compaction boundary never lands mid-stream or between a tool call and its result. Manual compaction stops the active run before starting. While a tool call waits for its result, no boundary is written: automatic compaction clears context before the next request with the result, and `/compact` reports that a tool call is waiting.
42
35
 
43
- Atomic saves a best-effort backup before writing a boundary. If the backup cannot be written, such as on a full disk, Atomic still writes the boundary without `backupPath`.
36
+ When nothing new has entered context since the last boundary, compaction does nothing and `/compact` reports `Nothing to compact`. Automatic compaction also skips when the system prompt and boundary message together would reach or exceed the automatic trigger (`systemPrompt + boundary >= trigger`), letting [`fallbackModels`](/settings#fallbackmodels) handle any provider overflow.
44
37
 
45
- Pressing `Escape` cancels compaction before the boundary commits and leaves the session unchanged. If a compactor request is running, `Escape` stops that request and clears the context instead. Queued input resumes automatically once the active run becomes idle.
38
+ **Pre-compaction backups (JSONL stores only).** Before writing a boundary in a JSONL session store, Atomic saves a best-effort backup alongside the session file at `<sessionFile>.<timestamp>.<label>.bak`. These backup files are not deleted automatically. If a backup cannot be written (for example on a full disk), Atomic still writes the boundary without `backupPath`. SQLite, libSQL, PostgreSQL, and in-memory stores do not write separate backup files.
46
39
 
47
- Automatic continuations belong to the original prompt, including output-cap continuations. The prompt and `agent_settled` finish only after the chain completes, so status monitors such as [Herdr](/herdr) remain active across continuations.
40
+ **Cancellation and queuing.** Pressing `Escape` cancels compaction before the boundary commits and leaves the session unchanged. If a compactor request is already running, `Escape` stops that request and clears the context instead. Queued user messages wait in arrival order and resume automatically once compaction ends.
48
41
 
49
- Concurrent manual SDK compaction calls share one run and result. Calling `abortCompaction()` cancels the run for all waiters, or falls back to clearing context if a compactor request is already in flight. A manual request during automatic compaction cancels the automatic work and its continuation, then runs after the active work settles (or follows the automatic boundary if it already committed).
42
+ Automatic continuations remain part of the original prompt until the chain finishes, so status monitors such as [Herdr](/herdr) stay active across continuations. In the TUI, `/compact` takes over automatic compaction, refuses a second manual compaction or branch summary, lets non-prompt commands (`/settings`, `/tasks`) run immediately, and lets session-switching commands (`/new`) cancel compaction immediately.
50
43
 
51
- In the TUI, `/compact` takes over automatic compaction, refuses a second manual compaction or branch summary, and lets non-prompt commands such as `/settings` and `/tasks` run immediately. Session commands such as `/new` run immediately and cancel compaction.
52
-
53
- User messages arriving during compaction (from typed input, prompt templates, skills, SDK `prompt()`, RPC `prompt`, or extension `sendUserMessage()`) wait in arrival order until compaction ends, then run once. If an earlier waiting message has already started a turn, later messages without `streamingBehavior` or `deliverAs` queue behind it as steering.
54
-
55
- Waiting messages appear in `getSteeringMessages()`, `getFollowUpMessages()`, and `queue_update`, and `clearQueue()` returns them without sending them. Before the TUI runs an extension command during compaction, it hands already-typed messages to the session so messages sent by the command run after them.
56
-
57
- SDK `prepareNextTurn` and `prepareNextTurnWithContext` callbacks receive the rebuilt context after mid-turn compaction. Returning `{ action: "end" }` from `finishTurn` keeps queued input pending until an explicit prompt or continuation, while mid-turn compaction resumes streaming automatically.
44
+ For SDK concurrency, `abortCompaction()`, message queuing callbacks, and turn hooks during compaction, see [SDK concurrency and message queuing](/compaction/reference#sdk-concurrency-and-message-queuing).
58
45
 
59
46
  ### Compaction instructions
60
47
 
@@ -74,14 +61,14 @@ With the default `compactionModel`, compaction makes no model call. After the bo
74
61
  The agent recovers details with `read` and `search` in its next turn. An abbreviated boundary message looks like this:
75
62
 
76
63
  ```text
77
- Context cleared. Your earlier conversation (182,340 tokens) is no longer in your context window. It is stored verbatim in this session's history at history://sessions/019f6a2e-…: entries 1-4210 hold the earlier conversation, this boundary is entry 4211, and the history has 4211 entries now. Before you continue, recover what the task needs from there.
64
+ Context cleared. Your earlier conversation (182,340 tokens) is no longer in your context window. It is stored verbatim in this session's history at history://sessions/019f6a2e-...: entries 1-4210 hold the earlier conversation, this boundary is entry 4211, and the history has 4211 entries now. Before you continue, recover what the task needs from there.
78
65
 
79
66
  Recover what you need, in this order:
80
- 1. Every <keepContext> span, verbatim and whole: search history://sessions/019f6a2e-… for "keepContext". …
81
- 2. The user's objectives and latest requests; constraints and prohibitions …
67
+ 1. Every <keepContext> span, verbatim and whole: search history://sessions/019f6a2e-... for "keepContext". ...
68
+ 2. The user's objectives and latest requests; constraints and prohibitions ...
82
69
 
83
70
  How to recover:
84
- - Search first …
71
+ - Search first ...
85
72
 
86
73
  Then continue the task.
87
74
  ```
@@ -92,29 +79,47 @@ See [Recalling earlier work](/sessions#recalling-earlier-work) for how `history:
92
79
 
93
80
  Agents whose tool allowlist omits `read` or `search`, such as restricted subagents, receive one read-only tool named `session_history` after their first context clear (or on resume whenever `read` or `search` is absent).
94
81
 
95
- Pass `{"pattern": "<regex>"}` to search the session's own history, and pass `{"lines": "N-M"}` to read a saved-entry range (despite the parameter name). Continue a bounded read with `{"lines": "<continuation URL>"}`, or continue a search with `{"pattern": "<same regex>", "lines": "<continuation URL>"}`. The tool cannot access any other session, file, or project, and leaves the agent's other tools unchanged.
82
+ - **Search the session:** pass `{"pattern": "<regex>"}` to run a **case-sensitive regular expression** search with 0 surrounding context lines.
83
+ - **Search within a range:** combine `pattern` and `lines`, such as `{"pattern": "TODO", "lines": "100-300"}`, to search only within those saved entries.
84
+ - **Read entries:** pass `{"lines": "N-M"}` to read a saved-entry range (despite the parameter name, numbers refer to saved entries). Reads silently clamp to at most **400 entries** per call, and output truncates at **50,000 characters**.
85
+ - **Continue truncated calls:** pass `{"lines": "<continuation URL>"}` to continue a read, or `{"pattern": "<same regex>", "lines": "<continuation URL>"}` to continue a search.
86
+
87
+ `session_history` cannot access any other session, file, or project, and leaves the agent's other tools unchanged.
96
88
 
97
89
  ## Context compacted
98
90
 
99
- When `compactionModel` names a registered compactor model (currently `morph/morph-compactor`), compaction sends the active context to that compactor once. Atomic frames previous compacted text first, followed by role-labelled user messages, assistant text, tool calls with arguments, tool results (marked when errors), shell commands with exit codes, and extension messages.
91
+ When `compactionModel` names a registered compactor model (built-in `morph/morph-compactor`, or a custom remote compactor configured in `models.json` or an extension), compaction sends the active context to that compactor once. Atomic frames previous compacted text first, followed by role-labelled user messages, assistant text, tool calls with arguments, tool results (marked when errors), shell commands with exit codes, and extension messages.
100
92
 
101
- Images are replaced with an omission marker, thinking blocks are omitted, and long lines are wrapped. Messages excluded from model context, such as `!!` shell commands and extension messages with `excludeFromContext`, are not sent.
93
+ Images are replaced with an omission marker, thinking blocks are omitted, long lines wrap at 2,000 characters, and role headers are wrapped in `<keepContext>` tags automatically. Messages excluded from model context, such as `!!` shell commands and extension messages with `excludeFromContext`, are not sent.
102
94
 
103
- The request uses your `/compact` instructions as its query, or your latest request if none were given. It asks the compactor to keep about half of the conversation (a fixed ratio, not configurable) and times out after 120 seconds.
95
+ The request uses your `/compact` instructions as its query, or your latest user request if none were given. Atomic sends `{ messages, query, model }` plus any optional `compactionParams` configured on that compactor model, letting the remote API apply its own server defaults when `compactionParams` is omitted. You can customize endpoint parameters (`compactionParams`), request path (`endpointPath`), timeout (`timeoutMs`, default 120 seconds), headers (`headers`), and output token cap (`maxTokens`, default 32,000) per compactor model in `models.json` or an extension.
104
96
 
105
97
  The compactor's output replaces the context inside a `<compacted-context>` block, followed by the same recovery instructions used by context clearing so the agent can retrieve omitted details from history.
106
98
 
107
- Output longer than 32,000 estimated tokens fails. On small context windows, the limit drops to half of the automatic trigger budget. Output also fails if the compacted text, system prompt, and recovery instructions together would exceed the automatic trigger. If an endpoint echoes your API key, Atomic replaces it with `[redacted]` before storing or displaying the output.
99
+ By default, output longer than 32,000 estimated tokens fails (estimated at 4 ASCII characters per token and 1 token per non-ASCII character, so non-English or emoji-heavy output reaches the cap roughly 4 times sooner than ASCII text). Setting `maxTokens` on the compactor model overrides the 32,000-token ceiling, while small context windows always stay capped at half of the automatic trigger budget. Output also fails if the system prompt and boundary message together would reach or exceed the automatic trigger (`systemPrompt + boundary >= trigger`). If an endpoint echoes your API key or sensitive auth header, Atomic replaces it with `[redacted]` before storing or displaying the output.
108
100
 
109
101
  ### When the compactor fails
110
102
 
111
- Any compactor failure falls back to clearing the context instead. This covers missing credentials, HTTP errors, empty or malformed output, timeouts, and oversized output.
103
+ Every compactor failure falls back automatically to **Automatic** (clearing the context instead) so a broken, unauthenticated, or slow remote compactor never blocks compaction:
112
104
 
113
- Atomic prints a one-line notice (`Compaction model not used (<reason>); context cleared instead`) without exposing your API key. Pressing `Escape` or calling `abortCompaction()` during a compactor request also clears the context with reason `request aborted`. A takeover by `/compact`, closing the session, or an extension returning `{ cancel: true }` cancels compaction completely.
105
+ ```text
106
+ Compaction starts
107
+ ├─ session_before_compact returns { cancel: true } or session closes -> Cancelled (context unchanged)
108
+ ├─ session_before_compact returns valid { compactedText } -> Context compacted (extension)
109
+ │ └─ oversized or overflows trigger -> Automatic fallback (Context cleared)
110
+ ├─ compactionModel is "" / "auto" -> Automatic (Context cleared)
111
+ ├─ compactionModel is unknown / chat / classifier -> Automatic fallback (Context cleared)
112
+ └─ compactionModel is a registered compactor
113
+ ├─ success and fits within maxTokens and trigger budget -> Context compacted (compactor)
114
+ └─ missing auth / HTTP or network error / timeout / Esc /
115
+ malformed or empty output / oversized / overflows trigger -> Automatic fallback (Context cleared)
116
+ ```
117
+
118
+ Atomic prints a one-line notice (`Compaction model not used (<reason>); context cleared instead`) without exposing your API key or sensitive headers. Pressing `Escape` or calling `abortCompaction()` during a compactor request also clears the context with reason `request aborted`. A takeover by `/compact`, closing the session, or an extension returning `{ cancel: true }` cancels compaction completely.
114
119
 
115
120
  ## Compaction model
116
121
 
117
- Open `/settings` and select **Compaction model** to choose **Auto (clear and recover)** or a registered compactor model. The selector updates project settings when a project override already exists, and global settings otherwise. You can also edit `compactionModel` in `~/.atomic/agent/settings.json` or a trusted project's `.atomic/settings.json`:
122
+ Open `/settings` and select **Compaction model** to choose **Automatic** or any registered compactor model. Changes made in `/settings` (or via `session.setCompactionModel()` / RPC `set_compaction_model`) take effect immediately in your active session without running `/reload` or restarting Atomic. Both built-in `morph/morph-compactor` and any custom remote compactor models you define in `~/.atomic/agent/models.json` or an extension appear in this searchable list automatically, matching the **Decision model** and `/model` pickers (authenticated models appear first; unauthenticated ones show `requires /login <provider>`). The selector updates project settings when a project override already exists, and global settings otherwise. You can also edit `compactionModel` in `~/.atomic/agent/settings.json` or a trusted project's `.atomic/settings.json`:
118
123
 
119
124
  ```json
120
125
  {
@@ -122,11 +127,73 @@ Open `/settings` and select **Compaction model** to choose **Auto (clear and rec
122
127
  }
123
128
  ```
124
129
 
125
- `auto` or an empty string clears the context by default. An exact registered compactor ID compacts with that model. For Morph, authenticate with `/login morph` or set `MORPH_API_KEY`. Without credentials, the selector labels it `requires /login morph` and compaction falls back to context clearing with a notice. Morph is not a chat model and does not appear in `/model`.
130
+ `"auto"` (lowercase) or an empty string clears the context by default. A registered compactor ID must match `provider/model` **case-sensitively** (leading and trailing whitespace is trimmed). For Morph, authenticate with `/login morph` or set `MORPH_API_KEY`. Compactor models are excluded from `/model` and never run as chat models.
131
+
132
+ ### Customize Morph or add a remote compactor
133
+
134
+ Keep default compaction clean in `settings.json` and configure endpoint-specific parameters directly on the compactor model in `~/.atomic/agent/models.json`.
135
+
136
+ **Override built-in Morph parameters:**
137
+
138
+ ```json
139
+ {
140
+ "providers": {
141
+ "morph": {
142
+ "modelOverrides": {
143
+ "morph-compactor": {
144
+ "compactionParams": {
145
+ "compression_ratio": 0.35,
146
+ "preserve_recent": 2
147
+ },
148
+ "timeoutMs": 180000,
149
+ "maxTokens": 48000
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ **Add a custom remote compactor model:**
126
158
 
127
- A compactor receives your in-context conversation and uses its own provider credentials, so enable one only if that provider may receive your session text. Changing `compactionModel` does not affect branch summaries. SDK and extension callers can override the setting for a single run with `session.compact({ compactionModel })` or `ctx.compact({ compactionModel })`.
159
+ ```json
160
+ {
161
+ "providers": {
162
+ "my-compactor": {
163
+ "baseUrl": "https://compact.example.com/v1",
164
+ "apiKey": "$MY_COMPACTOR_API_KEY",
165
+ "headers": {
166
+ "X-Team": "platform"
167
+ },
168
+ "models": [
169
+ {
170
+ "id": "compact-v2",
171
+ "name": "Internal Compactor v2",
172
+ "type": "compactor",
173
+ "api": "custom-compact",
174
+ "endpointPath": "/compress",
175
+ "compactionParams": {
176
+ "target_ratio": 0.4,
177
+ "preserve_recent": 2
178
+ },
179
+ "timeoutMs": 180000,
180
+ "maxTokens": 48000
181
+ }
182
+ ]
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ - Set `"type": "compactor"` so Atomic treats the entry as a compaction model (and exposes it automatically in `/settings` under **Compaction model** instead of `/model`).
189
+ - Set `"api"` on the provider or model (for example `"custom-compact"`). Custom compactors do not inherit a default `"api"` string; each provider defines its own (built-in Morph defines `"api": "morph-compact"`). Overriding an existing compactor model under `modelOverrides` inherits its provider's `api` and `baseUrl` automatically.
190
+ - Omit `compactionParams` to send only `{ messages, query, model }` and use the remote API's own defaults. Add `compactionParams` to pass any API-specific parameters (such as `compression_ratio`, `preserve_recent`, `include_markers`, `include_line_ranges`, or custom fields) directly in the JSON request body.
191
+ - `endpointPath` appends to `baseUrl` and defaults to `"/compact"`. Set `"endpointPath": ""` to POST directly to `baseUrl`.
192
+ - Set `headers` on the provider or model for custom auth headers (such as `"X-API-Key": "$MY_KEY"`). Values support `$ENV`, `${ENV}`, and `!command`, and sensitive auth headers are redacted automatically from errors and output.
128
193
 
129
- Compaction does not call chat models or classifiers. On startup, after extensions load, and when a project becomes trusted, Atomic resets any saved chat or classifier `compactionModel` to `auto`. Compactor IDs and unknown IDs remain untouched; an unknown ID or a per-run chat or classifier override falls back to context clearing with a notice.
194
+ A compactor receives your in-context conversation and uses its own provider credentials, so enable one only if that provider may receive your session text. Changing `compactionModel` does not affect branch summaries. SDK and extension callers can override the setting for a single run with `session.compact({ compactionModel })` or `ctx.compact({ compactionModel })`, or register custom compactors programmatically with [`atomic.registerProvider()`](/custom-provider/api-reference).
195
+
196
+ Compaction does not call chat models or classifiers. On startup, once extensions finish loading, and when you trust a project, Atomic resets any saved chat or classifier `compactionModel` to `auto`. Compactor IDs and unknown IDs remain untouched; an unknown ID or a per-run chat or classifier override falls back to context clearing with a notice.
130
197
 
131
198
  ## `keepContext` tags
132
199
 
@@ -156,13 +223,13 @@ A boundary supplied by an extension names `extension` as its source. When a conf
156
223
 
157
224
  A failed or cancelled `/compact` stops its spinner, displays the error, writes no boundary, and leaves the session ready for another `/compact` or normal turn.
158
225
 
159
- ## Recovery omissions
226
+ ## Failed turns and token accounting
160
227
 
161
- Threshold checks and recovery read the canonical session projection. When Atomic recovers from a provider retry, model fallback, context overflow, or truncated response, the failed attempt stays in raw history while a `context_edit` entry omits it from model context (see [Session format](/session-format#contexteditentry)).
228
+ When counting context tokens and checking compaction thresholds, Atomic measures only what will actually be sent to the model. When Atomic recovers from a provider retry, model fallback, context overflow, or truncated response, the failed attempt stays in raw history while a `context_edit` entry omits it from model context (see [Session file format](/session-format#contexteditentry)).
162
229
 
163
230
  Omitted entries do not count toward compaction or token estimates, and usage from an omitted or edited assistant message is not used for threshold checks. You can still inspect the original provider error in the agent panel, `/tasks`, raw transcripts, exports, and history search.
164
231
 
165
- <a id="branch-summarization" />
232
+ <div id="branch-summarization" />
166
233
 
167
234
  ## Branch summaries
168
235
 
@@ -178,7 +245,9 @@ Set `"branchSummary": { "skipPrompt": true }` to skip the prompt and default to
178
245
 
179
246
  ### How branch summarization works
180
247
 
181
- Atomic collects entries from the abandoned branch up to the common ancestor, prioritizing newer messages within `branchSummary.reserveTokens`, and saves the summary at the navigation point. The provider sizes summary output from the model's output limit and available context; `branchSummary.reserveTokens` controls only how much branch history is selected. Atomic rejects incomplete summaries rather than saving partial prose.
248
+ Atomic collects entries from the abandoned branch up to the common ancestor, prioritizing newer messages to fit inside a token budget of `contextWindow - branchSummary.reserveTokens` (defaulting `contextWindow` to `128000` when unknown, and `reserveTokens` to `16384`). `branchSummary.reserveTokens` sets the space reserved for the summary prompt and reply, not the history budget itself.
249
+
250
+ The provider sizes summary output from the model's output limit and available context, inheriting the session's `thinkingLevel` unless it is `"off"`. Atomic rejects incomplete summaries rather than saving partial prose.
182
251
 
183
252
  ```text
184
253
  Tree before navigation:
@@ -197,27 +266,10 @@ After navigation with summary:
197
266
  └─ E ─ F (new leaf)
198
267
  ```
199
268
 
200
- Branch summaries keep a cumulative list of read and modified files, including files carried forward from earlier branch summaries.
201
-
202
- ### Summary request isolation
203
-
204
- Branch summary requests execute no tools and do not write into the main chat's prompt cache. They keep normal authentication, cancellation, and retry behavior.
205
-
206
- See [Branch summary format](/compaction/reference#branch-summary-format) and [Extension hooks for branch summarization](/compaction/reference#extension-hooks-for-branch-summarization) for saved entry types and `session_before_tree`.
269
+ Built-in branch summaries keep a cumulative list of read and modified files, carrying forward file lists from earlier built-in branch summaries (extension-supplied summaries are not parsed for file lists).
207
270
 
208
- ## Moved sections
271
+ ### How summary requests run
209
272
 
210
- <a id="parameters" />
211
- <a id="persistence-and-resume" />
212
- <a id="extension-hooks" />
213
- <a id="session_before_compact" />
214
- <a id="session_compact" />
215
- <a id="session_compact_failed" />
216
- <a id="branch-summary-format" />
217
- <a id="message-serialization-for-branch-summaries" />
218
- <a id="extension-hooks-for-branch-summarization" />
219
- <a id="session_before_tree" />
220
- <a id="settings" />
221
- <a id="historical-formats" />
273
+ Branch summary requests run no tools and do not write into the main chat's prompt cache. They keep normal authentication, cancellation, and retry behavior.
222
274
 
223
- Parameters, persistence details, extension hooks, branch summary formats, settings, and historical formats moved to the [Compaction reference](/compaction/reference).
275
+ For saved entry fields, message serialization, extension hooks, SDK concurrency rules, and settings, see [Compaction reference](/compaction/reference) (including [Branch summary format](/compaction/reference#branch-summary-format) and [Extension hooks for branch summarization](/compaction/reference#extension-hooks-for-branch-summarization)).