@bastani/atomic 0.10.14 → 0.10.15-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 (341) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +1 -1
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -1,230 +1,74 @@
1
1
  ---
2
- title: "Context and compaction"
3
- sidebarTitle: "Compaction"
4
- description: "Clear or compact long conversations, recover earlier details from session history, and summarize abandoned branches."
2
+ title: "Manage context and compaction"
3
+ sidebarTitle: "Manage compaction"
4
+ description: "Keep long sessions inside the model's context window with memory compaction (default) or a custom compaction model."
5
5
  ---
6
6
 
7
- LLMs have finite context windows. When a session nears its limit, Atomic compacts the context window in one of two ways:
7
+ LLMs have finite context windows. When a session nears its limit, Atomic compacts the active context window using one of **two forms of compaction**:
8
8
 
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.
10
- - **Context compacted.** When `compactionModel` names a compactor model, Atomic sends the conversation to that compactor once and replaces the context with its output.
9
+ <Columns cols={2}>
10
+ <Card title="1. Memory compaction (default)" href="/compaction/memory-compaction">
11
+ Clears the active context window with no model call and no parameters. The full conversation stays verbatim in session history, and the agent recalls exact details on demand.
12
+ </Card>
13
+ <Card title="2. Custom compaction models" href="/compaction/custom-compactors">
14
+ Sends the active context once to a dedicated compactor endpoint (`morph/morph-compactor` or your own remote compactor) using your own parameters, with automatic fallback to memory compaction.
15
+ </Card>
16
+ </Columns>
11
17
 
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
+ In both forms, your full conversation stays verbatim in session history and the compaction boundary tells the agent where to find it.
13
19
 
14
- ## Overview
20
+ <Columns cols={2}>
21
+ <Card title="Branch summaries" href="/compaction/branch-summaries">
22
+ Optional, lossy summary generated when you leave a branch with `/tree`. Separate from compaction.
23
+ </Card>
24
+ <Card title="Compaction reference" href="/compaction/reference">
25
+ Compactor HTTP contract, saved boundary fields, extension hooks, continuation limits, SDK concurrency, error classes, and settings.
26
+ </Card>
27
+ </Columns>
15
28
 
16
- | Form | When | Model call | What the model sees after the boundary |
17
- | --- | --- | --- | --- |
18
- | Context cleared | `compactionModel` is `auto` or empty, or the compactor failed | None | The system prompt and one `Context cleared` message |
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 |
20
- | Branch summarization | Optional, when `/tree` leaves a branch | One summary request | A branch summary at the new branch position |
29
+ ## Compare compaction forms
21
30
 
22
- ## When compaction runs
31
+ | Form | When it runs | Model call | Parameters | What the model sees after the boundary |
32
+ | --- | --- | --- | --- | --- |
33
+ | [Memory compaction](/compaction/memory-compaction) | Default (`compactionModel` is `""` or `"auto"`), or automatic fallback when a compactor fails | None | None | System prompt and one `Context cleared` boundary pointing to session history |
34
+ | [Custom compaction model](/compaction/custom-compactors) | `compactionModel` names a registered compactor model (or an extension supplies compacted text) | One compactor request | Only what you set on the model (`compactionParams`, optional `maxTokens`, `timeoutMs`) | System prompt and one `Context compacted` boundary with `<compacted-context>` plus history recovery steps |
35
+ | [Branch summaries](/compaction/branch-summaries) | Optional, when `/tree` leaves a branch | One summary request | `branchSummary.reserveTokens`, optional focus prompt | A branch summary attached at the new tree position |
23
36
 
24
- Atomic triggers compaction in five situations:
25
-
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.
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.
28
- - **Overflow.** On a provider context-overflow error, Atomic compacts and retries the interrupted turn once per turn.
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.
30
- - **Manual.** Run `/compact [instructions]`, call `ctx.compact()` or `session.compact()`, or send RPC `{ "type": "compact" }`.
31
-
32
- ### Safety, backups, and cancellation
33
-
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.
35
-
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.
37
-
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, PostgreSQL, and in-memory stores do not write separate backup files (see [Storage](/storage)).
39
-
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.
41
-
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.
43
-
44
- For SDK compaction calls, concurrency, `abortCompaction()`, message queuing callbacks, and turn hooks during compaction, see [Compaction and tree navigation](/sdk#compaction-and-tree-navigation) and [SDK concurrency and message queuing](/compaction/reference#sdk-concurrency-and-message-queuing).
45
-
46
- ### Compaction instructions
47
-
48
- `/compact` accepts optional focus instructions, such as `/compact keep the migration plan and the names of the failing tests`. Atomic appends those instructions to the boundary message after the recovery steps and sends them as the compactor query.
49
-
50
- SDK and extension code pass instructions as `query` in `session.compact({ query })` or `ctx.compact({ query })`. RPC clients pass `{ "type": "compact", "instructions": "..." }`.
51
-
52
- ## Context cleared
53
-
54
- With the default `compactionModel`, compaction makes no model call. After the boundary, the model sees the system prompt and one `Context cleared` message telling the agent:
55
-
56
- - How many tokens the earlier conversation held, the exact `history://sessions/<session id>` URL for this session, which saved entries hold the earlier conversation, the boundary's entry position, and the total entry count.
57
- - What to recover, in order. First, every `<keepContext>` span verbatim and whole by searching for `keepContext`. Next, the user's objectives and latest requests, constraints, decisions and their reasons, key identifiers (branches, worktrees, pull requests, run IDs, file paths, commands), open work, and needed tool results, preferring the most recent records.
58
- - How to recover it. Search the exact session URL first (a plain `history://sessions` search skips the current session), then read narrow ranges of about 200 saved entries with `read history://sessions/<id>:N-M`. Ranges select saved entries rather than rendered lines. Follow continuation URLs when reads or searches stop early, and check any `Full output saved to: <location>` or `Full output: <location>` path (`tool-output://` or `artifact://`) when full tool output is needed.
59
- - Your `/compact` instructions, if provided, followed by a prompt to continue the task.
60
-
61
- The agent recovers details with `read` and `search` in its next turn. An abbreviated boundary message looks like this:
62
-
63
- ```text
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.
65
-
66
- Recover what you need, in this order:
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 ...
69
-
70
- How to recover:
71
- - Search first ...
72
-
73
- Then continue the task.
74
- ```
75
-
76
- See [Recalling earlier work](/sessions#recalling-earlier-work) for how `history://` URLs read and search.
77
-
78
- ### Agents without read or search
79
-
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).
81
-
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.
88
-
89
- ## Context compacted
90
-
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.
92
-
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.
94
-
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 an output limit (`maxTokens`, no default) per compactor model in `models.json` or an extension.
96
-
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.
98
-
99
- A compactor's output has no built-in size limit: whatever the endpoint returns is used, however long it is. Only limits you configure apply. To ask the endpoint for shorter output, set its own size option in `compactionParams` (for Morph, `compression_ratio`). To reject long output, set `maxTokens` on the compactor model: output longer than that many estimated tokens (4 ASCII characters or 1 non-ASCII character per token) clears the context instead. `maxTokens` has no default. If the compacted context is still above the automatic trigger, nothing is rejected, and it is not compacted again before each tool call of the same turn. The next user turn compacts it again before its first request. If the provider reports the context is too long, Atomic compacts and retries once, as for any context; if the retry is still too long, the provider's error is shown. Compacted text returned by an extension's `session_before_compact` hook keeps its limits: text longer than 32,000 estimated tokens (or half of the automatic trigger on a small context window), or a result that would not fit below the trigger, clears the context instead. If an endpoint echoes your API key or sensitive auth header, Atomic replaces it with `[redacted]` before storing or displaying the output.
100
-
101
- ### When the compactor fails
102
-
103
- Every compactor failure falls back automatically to **Automatic** (clearing the context instead) so a broken, unauthenticated, or slow remote compactor never blocks compaction:
104
-
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 (within maxTokens, if you set one) -> Context compacted (compactor)
114
- └─ missing auth / HTTP or network error / timeout / Esc /
115
- malformed or empty output / longer than a maxTokens you set -> 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.
119
-
120
- #### When the compactor cannot reach its server
37
+ ## When compaction runs {#when-compaction-runs}
121
38
 
122
- If Atomic cannot connect to the compactor's server, the notice gives the reason the connection failed. For example, when the server's host name cannot be found:
39
+ Atomic triggers compaction in five situations:
123
40
 
124
- ```text
125
- Compaction model not used (morph/morph-compactor failed: fetch failed: getaddrinfo ENOTFOUND api.morphllm.com); context cleared instead
126
- ```
41
+ - **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 visible as the last answer so you can read or `/copy` it; Atomic compacts right before the next request. When a provider reports zero usage, Atomic estimates visible message size instead of skipping the check.
42
+ - **Resumed near the window.** On a Claude model with a fixed thinking budget, the first prompt after resume clears earlier conversation if newly added resume context (updated `AGENTS.md` or prompt files, blueprint context, or recovery notices) would crowd out the thinking budget. Those 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.
43
+ - **Overflow.** On a provider context-overflow error, Atomic compacts and retries the interrupted turn automatically.
44
+ - **Truncated response.** When a reply is cut short by a token or output limit, Atomic automatically continues or compacts and retries (see [Automatic trigger and continuation limits](/compaction/reference#automatic-trigger-and-continuation-limits) for exact counts).
45
+ - **Manual.** Run `/compact [instructions]` in the terminal (or trigger compaction programmatically from the SDK or RPC).
127
46
 
128
- Check your network connection, proxy or VPN, and the compactor's address.
47
+ ## Compaction instructions
129
48
 
130
- A DNS filter such as NextDNS, Pi-hole, or AdGuard can also block the compactor. These filters answer `0.0.0.0` or `::` for a domain they block, so the connection never reaches the real server. When the server's host name resolves only to those addresses, the notice says so and names the domain to allow:
49
+ `/compact` accepts optional focus instructions, such as:
131
50
 
132
51
  ```text
133
- Compaction model not used (morph/morph-compactor failed: fetch failed: ERR_SSL_TLSV1_ALERT_INTERNAL_ERROR: tlsv1 alert internal error (api.morphllm.com resolves to 0.0.0.0, the address DNS filters such as NextDNS, Pi-hole or AdGuard return for blocked domains; allow api.morphllm.com in the resolver)); context cleared instead
134
- ```
135
-
136
- To fix it, add that domain to your DNS filter's allowlist. Until then, compaction keeps working by clearing the context.
137
-
138
- ## Compaction model
139
-
140
- 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`:
141
-
142
- ```json
143
- {
144
- "compactionModel": "morph/morph-compactor"
145
- }
146
- ```
147
-
148
- `"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.
149
-
150
- ### Customize Morph or add a remote compactor
151
-
152
- Keep default compaction clean in `settings.json` and configure endpoint-specific parameters directly on the compactor model in `~/.atomic/agent/models.json`.
153
-
154
- **Override built-in Morph parameters:**
155
-
156
- ```json
157
- {
158
- "providers": {
159
- "morph": {
160
- "modelOverrides": {
161
- "morph-compactor": {
162
- "compactionParams": {
163
- "compression_ratio": 0.35,
164
- "preserve_recent": 2
165
- },
166
- "timeoutMs": 180000
167
- }
168
- }
169
- }
170
- }
171
- }
172
- ```
173
-
174
- **Add a custom remote compactor model:**
175
-
176
- ```json
177
- {
178
- "providers": {
179
- "my-compactor": {
180
- "baseUrl": "https://compact.example.com/v1",
181
- "apiKey": "$MY_COMPACTOR_API_KEY",
182
- "headers": {
183
- "X-Team": "platform"
184
- },
185
- "models": [
186
- {
187
- "id": "compact-v2",
188
- "name": "Internal Compactor v2",
189
- "type": "compactor",
190
- "api": "custom-compact",
191
- "endpointPath": "/compress",
192
- "compactionParams": {
193
- "target_ratio": 0.4,
194
- "preserve_recent": 2
195
- },
196
- "timeoutMs": 180000
197
- }
198
- ]
199
- }
200
- }
201
- }
52
+ /compact keep the migration plan and the names of the failing tests
202
53
  ```
203
54
 
204
- - Set `"type": "compactor"` so Atomic treats the entry as a compaction model (and exposes it automatically in `/settings` under **Compaction model** instead of `/model`).
205
- - 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.
206
- - 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.
207
- - `endpointPath` appends to `baseUrl` and defaults to `"/compact"`. Set `"endpointPath": ""` to POST directly to `baseUrl`.
208
- - 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.
209
-
210
- 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).
55
+ Atomic appends your instructions to the boundary message after the recovery steps and sends them as the query to any configured compactor model.
211
56
 
212
- 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.
57
+ ## Safety, backups, and cancellation
213
58
 
214
- ## `keepContext` tags
59
+ A compaction boundary never lands mid-stream or between a tool call and its result. Running `/compact` stops the active run before starting; if a tool call is still waiting for its result, `/compact` tells you to wait until it finishes, while automatic compaction runs once the result arrives.
215
60
 
216
- Wrap text the agent must not lose in `<keepContext>` and `</keepContext>`:
61
+ 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 clear boundary alone already fill the automatic threshold, letting [`fallbackModels`](/settings#fallbackmodels) handle any provider overflow.
217
62
 
218
- ```text
219
- <keepContext>
220
- You are researching only. Do not implement code changes.
221
- </keepContext>
222
- ```
63
+ <Note>
64
+ **Pre-compaction backups (JSONL stores only).** Before writing a boundary in a JSONL directory store, Atomic saves a best-effort copy alongside the session file at `<sessionFile>.<timestamp>.<label>.bak` (these files are not deleted automatically). If a backup cannot be written (for example on a full disk), Atomic still writes the boundary. SQLite, PostgreSQL, and in-memory stores do not write separate backup files (see [Storage](/storage)).
65
+ </Note>
223
66
 
224
- The tags do not pin text in the context window automatically. Instead, recovery instructions tell the agent to search session history for every tagged span and recover each one verbatim before anything else. A compactor model may also honor the tags.
67
+ - **Cancellation.** Press `Escape` to cancel compaction before the boundary commits and leave the session unchanged. If a custom compactor request is already running, `Escape` stops that request and falls back to memory compaction instead.
68
+ - **Queued input and commands.** Queued messages wait in arrival order and run automatically once compaction finishes. Non-prompt commands (`/settings`, `/tasks`) run immediately during compaction, `/compact` takes over automatic compaction, and session-switching commands (`/new`) cancel compaction immediately.
69
+ - **Automatic continuations.** Continuations remain part of the original prompt until the chain finishes, so status monitors such as [Herdr](/herdr) stay active across continuations.
225
70
 
226
- - Put each opening and closing tag on its own line.
227
- - Tag constraints, prohibitions, acceptance criteria, and key identifiers. Keep spans short and place large material in files so recovery stays fast.
71
+ For SDK compaction calls, concurrency, cancellation helpers, and extension hooks, see [Compaction and tree navigation](/sdk#compaction-and-tree-navigation) and [Compaction reference](/compaction/reference#sdk-concurrency-and-message-queuing).
228
72
 
229
73
  ## The boundary in the chat
230
74
 
@@ -235,57 +79,12 @@ Both the main chat and subagent views in `/tasks` show one line per boundary:
235
79
  ⚛ Context compacted · morph/morph-compactor · 182.0k → 21.4k tokens
236
80
  ```
237
81
 
238
- A boundary supplied by an extension names `extension` as its source. When a configured compactor was not used, the `Compaction model not used (<reason>); context cleared instead` notice appears beneath the line. Press `Ctrl+O` (`app.tools.expand`) or click the boundary to expand the full recovery instructions and any compacted text.
82
+ A boundary supplied by an extension names `extension` as its source. When a configured compactor was not used, a `Compaction model not used (<reason>); context cleared instead` notice appears beneath the line. Press `Ctrl+O` or click the boundary to expand the full recovery instructions and any compacted text.
239
83
 
240
84
  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.
241
85
 
242
86
  ## Failed turns and token accounting
243
87
 
244
- 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)).
245
-
246
- 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.
247
-
248
- <div id="branch-summarization" />
249
-
250
- ## Branch summaries
251
-
252
- When [`/tree`](/sessions#branching-with-tree) switches away from a branch, Atomic can optionally summarize the abandoned branch and attach that summary at the new position. This preserves work from the path you left without replaying the entire branch.
253
-
254
- When prompted, choose one of three options:
255
-
256
- 1. No summary
257
- 2. Summarize with the default prompt
258
- 3. Summarize with custom focus instructions
259
-
260
- Set `"branchSummary": { "skipPrompt": true }` to skip the prompt and default to no summary. Branch summaries are separate from `/compact`. Branch navigation generates summary prose, whereas compaction clears context or replaces it with a compactor's output.
261
-
262
- ### How branch summarization works
263
-
264
- 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.
265
-
266
- 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.
267
-
268
- ```text
269
- Tree before navigation:
270
-
271
- ┌─ B ─ C ─ D (old leaf, being abandoned)
272
- A ───┤
273
- └─ E ─ F (target)
274
-
275
- Common ancestor: A
276
- Entries to summarize: B, C, D
277
-
278
- After navigation with summary:
279
-
280
- ┌─ B ─ C ─ D ─ [summary of B,C,D]
281
- A ───┤
282
- └─ E ─ F (new leaf)
283
- ```
284
-
285
- 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).
286
-
287
- ### How summary requests run
288
-
289
- 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.
88
+ 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 Atomic omits it from future model context (see [Session file format](/session-format#contexteditentry)).
290
89
 
291
- 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)).
90
+ Omitted attempts do not count toward compaction thresholds or token estimates, and usage from an omitted reply is excluded from threshold checks. You can still inspect the original provider error in the agent panel, `/tasks`, raw transcripts, exports, and history search.