@bastani/atomic 0.10.0 → 0.10.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 (233) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +33 -3
  7. package/dist/builtin/web-access/package.json +1 -1
  8. package/dist/core/agent-session-events.d.ts.map +1 -1
  9. package/dist/core/agent-session-events.js +21 -6
  10. package/dist/core/agent-session-events.js.map +1 -1
  11. package/dist/core/lifecycle-timings.d.ts +6 -0
  12. package/dist/core/lifecycle-timings.d.ts.map +1 -1
  13. package/dist/core/lifecycle-timings.js +12 -0
  14. package/dist/core/lifecycle-timings.js.map +1 -1
  15. package/dist/core/queued-message-delivery.d.ts +41 -0
  16. package/dist/core/queued-message-delivery.d.ts.map +1 -0
  17. package/dist/core/queued-message-delivery.js +48 -0
  18. package/dist/core/queued-message-delivery.js.map +1 -0
  19. package/dist/core/storage/node-sqlite-thread.d.ts +64 -0
  20. package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -0
  21. package/dist/core/storage/node-sqlite-thread.js +326 -0
  22. package/dist/core/storage/node-sqlite-thread.js.map +1 -0
  23. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  24. package/dist/core/storage/node-sqlite.js +230 -104
  25. package/dist/core/storage/node-sqlite.js.map +1 -1
  26. package/dist/core/tasks/agent-panel-source.d.ts +5 -0
  27. package/dist/core/tasks/agent-panel-source.d.ts.map +1 -1
  28. package/dist/core/tasks/agent-panel-source.js +1 -1
  29. package/dist/core/tasks/agent-panel-source.js.map +1 -1
  30. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +8 -1
  31. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts.map +1 -1
  32. package/dist/modes/interactive/agent-view/agent-view-bridge.js.map +1 -1
  33. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +11 -5
  34. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
  35. package/dist/modes/interactive/agent-view/agent-view-switcher.js +17 -5
  36. package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
  37. package/dist/modes/interactive/agent-view/contracts.d.ts +5 -0
  38. package/dist/modes/interactive/agent-view/contracts.d.ts.map +1 -1
  39. package/dist/modes/interactive/agent-view/contracts.js.map +1 -1
  40. package/dist/modes/interactive/agent-view/install.d.ts.map +1 -1
  41. package/dist/modes/interactive/agent-view/install.js +6 -3
  42. package/dist/modes/interactive/agent-view/install.js.map +1 -1
  43. package/dist/modes/interactive/agent-view/local-port.d.ts +5 -0
  44. package/dist/modes/interactive/agent-view/local-port.d.ts.map +1 -1
  45. package/dist/modes/interactive/agent-view/local-port.js +8 -0
  46. package/dist/modes/interactive/agent-view/local-port.js.map +1 -1
  47. package/dist/modes/interactive/agent-view/remote-port.d.ts +4 -1
  48. package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
  49. package/dist/modes/interactive/agent-view/remote-port.js +22 -8
  50. package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
  51. package/dist/modes/interactive/agent-view/transcript-slot.d.ts +9 -0
  52. package/dist/modes/interactive/agent-view/transcript-slot.d.ts.map +1 -1
  53. package/dist/modes/interactive/agent-view/transcript-slot.js +141 -1
  54. package/dist/modes/interactive/agent-view/transcript-slot.js.map +1 -1
  55. package/dist/modes/interactive/components/agent-panel.d.ts +6 -0
  56. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  57. package/dist/modes/interactive/components/agent-panel.js +40 -10
  58. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  59. package/dist/modes/interactive/components/atomic-working-status.d.ts +15 -0
  60. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
  61. package/dist/modes/interactive/components/atomic-working-status.js +51 -3
  62. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
  63. package/dist/modes/interactive/components/bash-execution.d.ts +2 -0
  64. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  65. package/dist/modes/interactive/components/bash-execution.js +5 -1
  66. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  67. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -0
  68. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  69. package/dist/modes/interactive/components/branch-summary-message.js +5 -1
  70. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  71. package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -0
  72. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  73. package/dist/modes/interactive/components/chat-message-renderer.js +17 -6
  74. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  75. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  76. package/dist/modes/interactive/components/chat-session-host-events.js +35 -4
  77. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  78. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  79. package/dist/modes/interactive/components/chat-session-host-rendering.js +70 -13
  80. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  81. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +7 -0
  82. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  83. package/dist/modes/interactive/components/chat-session-host-runtime.js +25 -4
  84. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  85. package/dist/modes/interactive/components/chat-session-host-state.d.ts +41 -1
  86. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  87. package/dist/modes/interactive/components/chat-session-host-state.js +24 -3
  88. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  89. package/dist/modes/interactive/components/chat-session-host-steering.d.ts.map +1 -1
  90. package/dist/modes/interactive/components/chat-session-host-steering.js +2 -1
  91. package/dist/modes/interactive/components/chat-session-host-steering.js.map +1 -1
  92. package/dist/modes/interactive/components/chat-session-host.d.ts +13 -1
  93. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  94. package/dist/modes/interactive/components/chat-session-host.js +20 -2
  95. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  96. package/dist/modes/interactive/components/chat-transcript.d.ts +15 -0
  97. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  98. package/dist/modes/interactive/components/chat-transcript.js +14 -1
  99. package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
  100. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
  101. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  102. package/dist/modes/interactive/components/compaction-boundary-message.js +5 -1
  103. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  104. package/dist/modes/interactive/components/custom-entry.d.ts +2 -0
  105. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  106. package/dist/modes/interactive/components/custom-entry.js +5 -1
  107. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  108. package/dist/modes/interactive/components/custom-message.d.ts +2 -0
  109. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  110. package/dist/modes/interactive/components/custom-message.js +5 -1
  111. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  112. package/dist/modes/interactive/components/model-column.d.ts +96 -0
  113. package/dist/modes/interactive/components/model-column.d.ts.map +1 -0
  114. package/dist/modes/interactive/components/model-column.js +207 -0
  115. package/dist/modes/interactive/components/model-column.js.map +1 -0
  116. package/dist/modes/interactive/components/prompt-slot.d.ts +73 -0
  117. package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -0
  118. package/dist/modes/interactive/components/prompt-slot.js +201 -0
  119. package/dist/modes/interactive/components/prompt-slot.js.map +1 -0
  120. package/dist/modes/interactive/components/queued-messages-view.d.ts +6 -3
  121. package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
  122. package/dist/modes/interactive/components/queued-messages-view.js +7 -4
  123. package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
  124. package/dist/modes/interactive/components/session-selector.d.ts +2 -0
  125. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  126. package/dist/modes/interactive/components/session-selector.js +4 -0
  127. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  128. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -0
  129. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  130. package/dist/modes/interactive/components/skill-invocation-message.js +5 -1
  131. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  132. package/dist/modes/interactive/components/task-board.d.ts +12 -3
  133. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  134. package/dist/modes/interactive/components/task-board.js +33 -17
  135. package/dist/modes/interactive/components/task-board.js.map +1 -1
  136. package/dist/modes/interactive/components/task-inspector.d.ts +6 -1
  137. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  138. package/dist/modes/interactive/components/task-inspector.js +27 -7
  139. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  140. package/dist/modes/interactive/components/task-row.d.ts +4 -0
  141. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  142. package/dist/modes/interactive/components/task-row.js +7 -1
  143. package/dist/modes/interactive/components/task-row.js.map +1 -1
  144. package/dist/modes/interactive/components/task-transcript-page.d.ts +5 -0
  145. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  146. package/dist/modes/interactive/components/task-transcript-page.js +25 -0
  147. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  148. package/dist/modes/interactive/components/tool-execution.d.ts +7 -0
  149. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  150. package/dist/modes/interactive/components/tool-execution.js +19 -2
  151. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  152. package/dist/modes/interactive/components/tool-group-tracker.d.ts +20 -3
  153. package/dist/modes/interactive/components/tool-group-tracker.d.ts.map +1 -1
  154. package/dist/modes/interactive/components/tool-group-tracker.js +34 -7
  155. package/dist/modes/interactive/components/tool-group-tracker.js.map +1 -1
  156. package/dist/modes/interactive/components/transcript-block-clicks.d.ts +14 -2
  157. package/dist/modes/interactive/components/transcript-block-clicks.d.ts.map +1 -1
  158. package/dist/modes/interactive/components/transcript-block-clicks.js +23 -2
  159. package/dist/modes/interactive/components/transcript-block-clicks.js.map +1 -1
  160. package/dist/modes/interactive/interactive-agent-events.js +10 -2
  161. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  162. package/dist/modes/interactive/interactive-extension-runtime.d.ts +12 -1
  163. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  164. package/dist/modes/interactive/interactive-extension-runtime.js +37 -5
  165. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  166. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  167. package/dist/modes/interactive/interactive-input-handling.js +70 -46
  168. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  169. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  170. package/dist/modes/interactive/interactive-mode-base.js +7 -1
  171. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  172. package/dist/modes/interactive/interactive-prompt-turn.js +17 -9
  173. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
  174. package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
  175. package/dist/modes/interactive/interactive-queueing.js +2 -1
  176. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  177. package/dist/modes/interactive/interactive-render-chat.d.ts +18 -1
  178. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  179. package/dist/modes/interactive/interactive-render-chat.js +90 -10
  180. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  181. package/dist/modes/interactive/interactive-session-routing.js +2 -0
  182. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  183. package/dist/modes/interactive/interactive-task-projection.js +2 -2
  184. package/dist/modes/interactive/interactive-task-projection.js.map +1 -1
  185. package/dist/modes/interactive/screen-hold.d.ts +41 -0
  186. package/dist/modes/interactive/screen-hold.d.ts.map +1 -0
  187. package/dist/modes/interactive/screen-hold.js +80 -0
  188. package/dist/modes/interactive/screen-hold.js.map +1 -0
  189. package/dist/modes/interactive/started-run-echo.d.ts +66 -0
  190. package/dist/modes/interactive/started-run-echo.d.ts.map +1 -0
  191. package/dist/modes/interactive/started-run-echo.js +75 -0
  192. package/dist/modes/interactive/started-run-echo.js.map +1 -0
  193. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +1 -0
  194. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  195. package/dist/modes/interactive-engine/engine-custom-ui.js +25 -1
  196. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  197. package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
  198. package/dist/modes/interactive-engine/engine-quit-intent.js +3 -0
  199. package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
  200. package/dist/modes/interactive-engine/protocol.d.ts +5 -0
  201. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  202. package/dist/modes/interactive-engine/protocol.js +7 -1
  203. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  204. package/dist/modes/interactive-engine/remote-component.d.ts +10 -2
  205. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  206. package/dist/modes/interactive-engine/remote-component.js +19 -2
  207. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  208. package/dist/modes/interactive-engine/remote-renderer.d.ts +10 -0
  209. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  210. package/dist/modes/interactive-engine/remote-renderer.js +24 -4
  211. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  212. package/dist/modes/interactive-engine/transcript-frame-layout.d.ts +50 -0
  213. package/dist/modes/interactive-engine/transcript-frame-layout.d.ts.map +1 -0
  214. package/dist/modes/interactive-engine/transcript-frame-layout.js +95 -0
  215. package/dist/modes/interactive-engine/transcript-frame-layout.js.map +1 -0
  216. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  217. package/dist/modes/rpc/agent-panel-bridge.js +16 -0
  218. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  219. package/dist/modes/rpc/agent-view-engine-registry.d.ts.map +1 -1
  220. package/dist/modes/rpc/agent-view-engine-registry.js +36 -1
  221. package/dist/modes/rpc/agent-view-engine-registry.js.map +1 -1
  222. package/dist/modes/rpc/agent-view-rpc-panel.d.ts.map +1 -1
  223. package/dist/modes/rpc/agent-view-rpc-panel.js +5 -1
  224. package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
  225. package/dist/modes/rpc/task-ui-bridge.js +1 -1
  226. package/dist/modes/rpc/task-ui-bridge.js.map +1 -1
  227. package/docs/background-tasks.md +1 -1
  228. package/docs/development.md +2 -0
  229. package/docs/extensions/authoring.md +1 -1
  230. package/docs/keybindings.md +2 -2
  231. package/docs/storage.md +1 -0
  232. package/npm-shrinkwrap.json +49 -49
  233. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,104 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.10.1] - 2026-11-20
6
+
7
+ Typing and rendering keep going while Atomic reads and writes its local SQLite files, and the chat screen no longer flashes blank or shifted frames.
8
+
9
+ **Storage off the interface**
10
+
11
+ - **SQLite no longer freezes the interface.** Each connection to a local SQLite file runs on a thread of its own, so typing, rendering and clicks keep working while a session store opens, waits for another process's write lock or commits, and while a long session loads. Opening a store takes up to about 25 ms longer while its thread starts ([#5376](https://github.com/bastani-inc/atomic/issues/5376), [#6059](https://github.com/bastani-inc/atomic/pull/6059))
12
+ - **The history index builds without pauses.** Building the `history://` search index of a long session no longer pauses typing and rendering on a slow disk. The build itself takes 6 to 12% longer on a lightly loaded machine and up to about twice as long when the CPUs are oversubscribed, so the first `history://` search of a long session that has no index yet covers fewer entries per call ([#5666](https://github.com/bastani-inc/atomic/issues/5666), [#6060](https://github.com/bastani-inc/atomic/pull/6060))
13
+ - **Open shared SQLite files with `openNodeSqliteDatabase`.** Its connections in one process now wait for each other's write lock instead of failing with `database is locked`. In SDK hosts, a `DatabaseSync` of your own or a `wrapNodeSqliteDatabase` handle that writes the file during such a transaction can now fail with `SQLITE_BUSY` ([#5376](https://github.com/bastani-inc/atomic/issues/5376))
14
+
15
+ **A steadier chat screen**
16
+
17
+ - **The chat stays still during a run.** The working row under the prompt stays on screen between a run's turns, and a message you send no longer vanishes for a frame as its run starts. Subagent chats keep their working row the same way, and their token count no longer dips for a frame ([#6054](https://github.com/bastani-inc/atomic/pull/6054))
18
+ - **Views and fullscreen open without a blank frame.** `/model`, `/scoped-models`, `/tree`, `/resume` and `/tasks` keep the prompt on screen until their view can draw. On most terminals, fullscreen keeps the previous screen until its first frame, at start and when you come back from an external editor, a subshell or a suspended session ([#6057](https://github.com/bastani-inc/atomic/pull/6057), [#6056](https://github.com/bastani-inc/atomic/pull/6056))
19
+ - **Subagents stay in place.** A subagent shown on the chat screen no longer jumps when the prompt or panel below it changes height, and Enter on a subagent in `/tasks` no longer flashes the main chat's prompt first. A steering or follow-up message stays listed until it shows in the subagent's transcript ([#6055](https://github.com/bastani-inc/atomic/pull/6055), [#6071](https://github.com/bastani-inc/atomic/pull/6071))
20
+ - **Task rows stay still.** A new subagent's row in `/tasks` and the agent panel no longer shifts twice as its model and then its reasoning level arrive, and the model column no longer narrows while the list stays open ([#6061](https://github.com/bastani-inc/atomic/pull/6061))
21
+ - **A click expands one block.** A click on a block's `(ctrl+o to expand)` hint opens or folds only that block, so tool blocks that stream in later no longer start expanded, and tool calls that join a group after a click are no longer hidden ([#6062](https://github.com/bastani-inc/atomic/pull/6062))
22
+
23
+ **Standalone binaries**
24
+
25
+ - **Bun 1.4.5 with its security fixes.** The standalone binaries now embed Bun 1.4.5, with its fixes for TLS, HTTP and DNS. They check custom CA certificates as the npm-installed `atomic` does, so a root certificate in `NODE_EXTRA_CA_CERTS` or a PostgreSQL `sslrootcert` that is not marked as a CA, or is limited to client authentication, is now refused ([#6066](https://github.com/bastani-inc/atomic/pull/6066))
26
+
27
+ **Diagnostics and skills**
28
+
29
+ - **Windows startup traces keep their last lines.** On Windows, `ATOMIC_STARTUP_TRACE` keeps the engine's last lines when you quit soon after they are recorded ([#6058](https://github.com/bastani-inc/atomic/pull/6058))
30
+ - **The tmux wait helper stops on interrupt.** The bundled tmux skill's `wait-for-text.sh` stops within a second of an interrupt on bash 5.2 and older, instead of waiting for a stalled capture or its timeout ([#6053](https://github.com/bastani-inc/atomic/pull/6053))
31
+
32
+ ### Changed
33
+
34
+ - Local SQLite storage runs each connection to a file on a worker thread of its own, so opening a session store, waiting for another process's write lock and synced commits no longer freeze typing, rendering, streamed output or clicks in `/tasks`. Loading a long session no longer holds the interface for its whole read. In-memory databases and connections passed to `wrapNodeSqliteDatabase` still run on the calling thread ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
35
+ - SDK: in one process, a `DatabaseSync` of your own or a `wrapNodeSqliteDatabase` handle that writes a file while an `openNodeSqliteDatabase` transaction on it is open can now wait for its busy timeout on your thread and fail with `SQLITE_BUSY`, where before the write usually ran after the transaction. Open every handle that writes a shared file with `openNodeSqliteDatabase` ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
36
+ - The standalone `atomic` binaries are now built with Bun 1.4.5, which includes upstream security fixes for TLS, HTTP and DNS in the embedded runtime. They now check custom CA certificates, such as those in `NODE_EXTRA_CA_CERTS` or a PostgreSQL `sslrootcert`, the way Node.js and the npm-installed `atomic` already do: a root certificate that is not marked as a CA, or that is limited to client authentication, is refused with `INVALID_PURPOSE` ([#6066](https://github.com/bastani-inc/atomic/pull/6066)).
37
+
38
+ ### Fixed
39
+
40
+ - A write outside a transaction no longer fails with `database is locked` while another connection of the same process holds the write lock across an await: it now waits on its own connection's thread until that transaction commits ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
41
+ - Building the `history://` search index of a long session no longer pauses typing and rendering while the index is written to a slow disk ([#5666](https://github.com/bastani-inc/atomic/issues/5666)).
42
+ - The working row under the prompt no longer disappears for a moment between two turns of a run (after a tool call, before the next request), so the chat above it no longer jumps down and back up; it stays still until the next turn starts. Subagent chats keep theirs the same way, and a subagent's working line no longer shows a smaller token count for a moment when an answer settles ([#6054](https://github.com/bastani-inc/atomic/pull/6054)).
43
+ - A sent message and the working row under it no longer vanish and reappear for a moment when the engine answers that it started the run before the run's first events arrive, which happened on most first prompts of a session and on some later ones ([#6054](https://github.com/bastani-inc/atomic/pull/6054)).
44
+ - `/model`, `/scoped-models`, `/tree`, `/resume` and `/tasks` open their view without first flashing an empty prompt or a blank panel, and the chat above no longer jumps down and back: the prompt stays on screen until the view has something to draw. A panel the engine opens in the prompt's place, such as `/tasks` from its key, waits for its first frame the same way ([#6057](https://github.com/bastani-inc/atomic/pull/6057)).
45
+ - Starting Atomic in fullscreen, or returning to it from an external editor, a subshell or a suspended session, no longer blanks the terminal before the first frame: the previous screen stays until the full interface replaces it in one screen update. WezTerm and Alacritty keep the previous behavior, because they hold back their answers to Atomic's startup terminal queries until that update ends ([#6056](https://github.com/bastani-inc/atomic/pull/6056)).
46
+ - A subagent shown on the chat screen no longer jumps when the prompt, autocomplete list or panel below it changes height: the rows already on screen stay where they are while its transcript redraws for the new size, and its notes and question form stay at the bottom ([#6055](https://github.com/bastani-inc/atomic/pull/6055)).
47
+ - Enter on a subagent in `/tasks` no longer shows the main chat's prompt for a moment before the subagent appears: the prompt, footer and panel stay as painted until the subagent is shown (or cannot be), while the transcript above keeps updating. Any key you press shows the screen as it is at once, as does a run starting or finishing ([#6055](https://github.com/bastani-inc/atomic/pull/6055), [#6057](https://github.com/bastani-inc/atomic/pull/6057)).
48
+ - A queued message to a subagent no longer disappears for a frame when the subagent takes it. Its `Steering:` or `Follow-up:` row now stays until the message itself shows in the subagent's transcript, and goes in the same frame, also while extensions handle the message first ([#6071](https://github.com/bastani-inc/atomic/pull/6071)).
49
+ - A new subagent's row in `/tasks` and the agent panel no longer shifts its task twice as its model and then its reasoning level arrive. The row shows its model together with its level, or alone if no level arrives within a second, and a model without reasoning levels at once. While `/tasks` or the panel stays open, the model column no longer narrows while it still fits, so rows do not move when the subagent with the longest model falls back or leaves ([#6061](https://github.com/bastani-inc/atomic/pull/6061)).
50
+ - A click on the `(ctrl+o to expand)` hint of a tool block, a grouped-call summary or another block that Ctrl+O expands now opens or folds that block alone, like a click anywhere else on it. It used to press Ctrl+O, which expanded every block in the chat, so every tool block that streamed in afterwards also opened expanded. Ctrl+O and the `ctrl+o expand` hint under the prompt still expand every block ([#6062](https://github.com/bastani-inc/atomic/pull/6062)).
51
+ - Tool calls that join a group after a click opened one of its calls now appear as their own folded blocks, and a click opens each one on its own. They used to be hidden until the group was folded again. Ctrl+O draws the whole group as one summary again ([#6062](https://github.com/bastani-inc/atomic/pull/6062)).
52
+ - On Windows, the startup trace (`ATOMIC_STARTUP_TRACE`) keeps the engine's last lines, such as `engine-resources-ready`, when you quit soon after they are recorded. Windows ends the engine as soon as the host has its quit acknowledgement, without running exit handlers, so the engine now writes any waiting lines before it acknowledges, as the event-loop diagnostic already does. This also holds in the standalone binary. The [event-loop diagnostic's docs](docs/development.md#finding-what-freezes-the-ui) now say which engine records Windows does not get ([#6058](https://github.com/bastani-inc/atomic/pull/6058)).
53
+
54
+ ## [0.10.1-alpha.1] - 2026-11-20
55
+
56
+ Typing and rendering keep going while Atomic reads and writes its local SQLite files, and the chat screen no longer flashes blank or shifted frames.
57
+
58
+ **Storage off the interface**
59
+
60
+ - **SQLite no longer freezes the interface.** Each connection to a local SQLite file runs on a thread of its own, so typing, rendering and clicks keep working while a session store opens, waits for another process's write lock or commits, and while a long session loads. Opening a store takes up to about 25 ms longer while its thread starts ([#5376](https://github.com/bastani-inc/atomic/issues/5376), [#6059](https://github.com/bastani-inc/atomic/pull/6059))
61
+ - **The history index builds without pauses.** Building the `history://` search index of a long session no longer pauses typing and rendering on a slow disk. The build itself takes 6 to 12% longer on a lightly loaded machine and up to about twice as long when the CPUs are oversubscribed, so the first `history://` search of a long session that has no index yet covers fewer entries per call ([#5666](https://github.com/bastani-inc/atomic/issues/5666), [#6060](https://github.com/bastani-inc/atomic/pull/6060))
62
+ - **Open shared SQLite files with `openNodeSqliteDatabase`.** Its connections in one process now wait for each other's write lock instead of failing with `database is locked`. In SDK hosts, a `DatabaseSync` of your own or a `wrapNodeSqliteDatabase` handle that writes the file during such a transaction can now fail with `SQLITE_BUSY` ([#5376](https://github.com/bastani-inc/atomic/issues/5376))
63
+
64
+ **A steadier chat screen**
65
+
66
+ - **The chat stays still during a run.** The working row under the prompt stays on screen between a run's turns, and a message you send no longer vanishes for a frame as its run starts. Subagent chats keep their working row the same way, and their token count no longer dips for a frame ([#6054](https://github.com/bastani-inc/atomic/pull/6054))
67
+ - **Views and fullscreen open without a blank frame.** `/model`, `/scoped-models`, `/tree`, `/resume` and `/tasks` keep the prompt on screen until their view can draw. On most terminals, fullscreen keeps the previous screen until its first frame, at start and when you come back from an external editor, a subshell or a suspended session ([#6057](https://github.com/bastani-inc/atomic/pull/6057), [#6056](https://github.com/bastani-inc/atomic/pull/6056))
68
+ - **Subagents stay in place.** A subagent shown on the chat screen no longer jumps when the prompt or panel below it changes height, and Enter on a subagent in `/tasks` no longer flashes the main chat's prompt first. A steering or follow-up message stays listed until it shows in the subagent's transcript ([#6055](https://github.com/bastani-inc/atomic/pull/6055), [#6071](https://github.com/bastani-inc/atomic/pull/6071))
69
+ - **Task rows stay still.** A new subagent's row in `/tasks` and the agent panel no longer shifts twice as its model and then its reasoning level arrive, and the model column no longer narrows while the list stays open ([#6061](https://github.com/bastani-inc/atomic/pull/6061))
70
+ - **A click expands one block.** A click on a block's `(ctrl+o to expand)` hint opens or folds only that block, so tool blocks that stream in later no longer start expanded, and tool calls that join a group after a click are no longer hidden ([#6062](https://github.com/bastani-inc/atomic/pull/6062))
71
+
72
+ **Standalone binaries**
73
+
74
+ - **Bun 1.4.5 with its security fixes.** The standalone binaries now embed Bun 1.4.5, with its fixes for TLS, HTTP and DNS. They check custom CA certificates as the npm-installed `atomic` does, so a root certificate in `NODE_EXTRA_CA_CERTS` or a PostgreSQL `sslrootcert` that is not marked as a CA, or is limited to client authentication, is now refused ([#6066](https://github.com/bastani-inc/atomic/pull/6066))
75
+
76
+ **Diagnostics and skills**
77
+
78
+ - **Windows startup traces keep their last lines.** On Windows, `ATOMIC_STARTUP_TRACE` keeps the engine's last lines when you quit soon after they are recorded ([#6058](https://github.com/bastani-inc/atomic/pull/6058))
79
+ - **The tmux wait helper stops on interrupt.** The bundled tmux skill's `wait-for-text.sh` stops within a second of an interrupt on bash 5.2 and older, instead of waiting for a stalled capture or its timeout ([#6053](https://github.com/bastani-inc/atomic/pull/6053))
80
+
81
+ ### Changed
82
+
83
+ - Local SQLite storage runs each connection to a file on a worker thread of its own, so opening a session store, waiting for another process's write lock and synced commits no longer freeze typing, rendering, streamed output or clicks in `/tasks`. Loading a long session no longer holds the interface for its whole read. In-memory databases and connections passed to `wrapNodeSqliteDatabase` still run on the calling thread ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
84
+ - SDK: in one process, a `DatabaseSync` of your own or a `wrapNodeSqliteDatabase` handle that writes a file while an `openNodeSqliteDatabase` transaction on it is open can now wait for its busy timeout on your thread and fail with `SQLITE_BUSY`, where before the write usually ran after the transaction. Open every handle that writes a shared file with `openNodeSqliteDatabase` ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
85
+ - The standalone `atomic` binaries are now built with Bun 1.4.5, which includes upstream security fixes for TLS, HTTP and DNS in the embedded runtime. They now check custom CA certificates, such as those in `NODE_EXTRA_CA_CERTS` or a PostgreSQL `sslrootcert`, the way Node.js and the npm-installed `atomic` already do: a root certificate that is not marked as a CA, or that is limited to client authentication, is refused with `INVALID_PURPOSE` ([#6066](https://github.com/bastani-inc/atomic/pull/6066)).
86
+
87
+ ### Fixed
88
+
89
+ - A write outside a transaction no longer fails with `database is locked` while another connection of the same process holds the write lock across an await: it now waits on its own connection's thread until that transaction commits ([#5376](https://github.com/bastani-inc/atomic/issues/5376)).
90
+ - Building the `history://` search index of a long session no longer pauses typing and rendering while the index is written to a slow disk ([#5666](https://github.com/bastani-inc/atomic/issues/5666)).
91
+ - The working row under the prompt no longer disappears for a moment between two turns of a run (after a tool call, before the next request), so the chat above it no longer jumps down and back up; it stays still until the next turn starts. Subagent chats keep theirs the same way, and a subagent's working line no longer shows a smaller token count for a moment when an answer settles ([#6054](https://github.com/bastani-inc/atomic/pull/6054)).
92
+ - A sent message and the working row under it no longer vanish and reappear for a moment when the engine answers that it started the run before the run's first events arrive, which happened on most first prompts of a session and on some later ones ([#6054](https://github.com/bastani-inc/atomic/pull/6054)).
93
+ - `/model`, `/scoped-models`, `/tree`, `/resume` and `/tasks` open their view without first flashing an empty prompt or a blank panel, and the chat above no longer jumps down and back: the prompt stays on screen until the view has something to draw. A panel the engine opens in the prompt's place, such as `/tasks` from its key, waits for its first frame the same way ([#6057](https://github.com/bastani-inc/atomic/pull/6057)).
94
+ - Starting Atomic in fullscreen, or returning to it from an external editor, a subshell or a suspended session, no longer blanks the terminal before the first frame: the previous screen stays until the full interface replaces it in one screen update. WezTerm and Alacritty keep the previous behavior, because they hold back their answers to Atomic's startup terminal queries until that update ends ([#6056](https://github.com/bastani-inc/atomic/pull/6056)).
95
+ - A subagent shown on the chat screen no longer jumps when the prompt, autocomplete list or panel below it changes height: the rows already on screen stay where they are while its transcript redraws for the new size, and its notes and question form stay at the bottom ([#6055](https://github.com/bastani-inc/atomic/pull/6055)).
96
+ - Enter on a subagent in `/tasks` no longer shows the main chat's prompt for a moment before the subagent appears: the prompt, footer and panel stay as painted until the subagent is shown (or cannot be), while the transcript above keeps updating. Any key you press shows the screen as it is at once, as does a run starting or finishing ([#6055](https://github.com/bastani-inc/atomic/pull/6055), [#6057](https://github.com/bastani-inc/atomic/pull/6057)).
97
+ - A queued message to a subagent no longer disappears for a frame when the subagent takes it. Its `Steering:` or `Follow-up:` row now stays until the message itself shows in the subagent's transcript, and goes in the same frame, also while extensions handle the message first ([#6071](https://github.com/bastani-inc/atomic/pull/6071)).
98
+ - A new subagent's row in `/tasks` and the agent panel no longer shifts its task twice as its model and then its reasoning level arrive. The row shows its model together with its level, or alone if no level arrives within a second, and a model without reasoning levels at once. While `/tasks` or the panel stays open, the model column no longer narrows while it still fits, so rows do not move when the subagent with the longest model falls back or leaves ([#6061](https://github.com/bastani-inc/atomic/pull/6061)).
99
+ - A click on the `(ctrl+o to expand)` hint of a tool block, a grouped-call summary or another block that Ctrl+O expands now opens or folds that block alone, like a click anywhere else on it. It used to press Ctrl+O, which expanded every block in the chat, so every tool block that streamed in afterwards also opened expanded. Ctrl+O and the `ctrl+o expand` hint under the prompt still expand every block ([#6062](https://github.com/bastani-inc/atomic/pull/6062)).
100
+ - Tool calls that join a group after a click opened one of its calls now appear as their own folded blocks, and a click opens each one on its own. They used to be hidden until the group was folded again. Ctrl+O draws the whole group as one summary again ([#6062](https://github.com/bastani-inc/atomic/pull/6062)).
101
+ - On Windows, the startup trace (`ATOMIC_STARTUP_TRACE`) keeps the engine's last lines, such as `engine-resources-ready`, when you quit soon after they are recorded. Windows ends the engine as soon as the host has its quit acknowledgement, without running exit handlers, so the engine now writes any waiting lines before it acknowledges, as the event-loop diagnostic already does. This also holds in the standalone binary. The [event-loop diagnostic's docs](docs/development.md#finding-what-freezes-the-ui) now say which engine records Windows does not get ([#6058](https://github.com/bastani-inc/atomic/pull/6058)).
102
+
5
103
  ## [0.10.0] - 2026-11-20
6
104
 
7
105
  Codemode and subagents replace workflows, subagents share the main chat screen with its steering and can be resumed by a message, and long sessions keep only their current context in memory.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": true,
5
5
  "description": "Atomic's pi-compatible MCP integration for server connections, OAuth, tools, resources, and terminal management.",
6
6
  "contributors": [
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.10.1] - 2026-11-20
6
+
7
+ ### Fixed
8
+
9
+ - An interrupted `wait-for-text.sh` (bundled tmux skill) no longer waits for a stalled pane capture to finish or for its timeout. With bash 5.2 or older, an interrupt that arrived just as the helper began waiting for its worker was only acted on once the worker wrote again; it now stops within a second ([#5566](https://github.com/bastani-inc/atomic/issues/5566)).
10
+
11
+ ## [0.10.1-alpha.1] - 2026-11-20
12
+
13
+ ### Fixed
14
+
15
+ - An interrupted `wait-for-text.sh` (bundled tmux skill) no longer waits for a stalled pane capture to finish or for its timeout. With bash 5.2 or older, an interrupt that arrived just as the helper began waiting for its worker was only acted on once the worker wrote again; it now stops within a second ([#5566](https://github.com/bastani-inc/atomic/issues/5566)).
16
+
5
17
  ## [0.10.0] - 2026-11-20
6
18
 
7
19
  ### Breaking Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -240,6 +240,35 @@ take() {
240
240
  pane) have_pane=1; pane=$(cat <&3) || :; return 1 ;;
241
241
  esac
242
242
  }
243
+ # How long, in whole seconds, one wait for the worker's next line lasts before
244
+ # the helper checks for a stop request. A signal normally interrupts the wait at
245
+ # once, but bash 5.2 and older miss one that arrives just as `read` starts to
246
+ # wait: its trap then runs only after the next line, which a stalled capture can
247
+ # hold back until the deadline.
248
+ read_slice=1
249
+ # What a wait that timed out had read of a line, kept for the next wait.
250
+ partial=""
251
+ # Read the worker's next line into `line`. Returns 1 at the end of its output,
252
+ # and, with `until-cancelled`, 2 once a stop request has been noted.
253
+ next_line() {
254
+ local part rc
255
+ while :; do
256
+ rc=0
257
+ IFS= read -r -t "$read_slice" part <&3 || rc=$?
258
+ if (( rc == 0 )); then
259
+ line=$partial$part
260
+ partial=""
261
+ return 0
262
+ fi
263
+ # A timed-out read returns more than 128; anything else is the end.
264
+ if (( rc <= 128 )); then
265
+ partial=""
266
+ return 1
267
+ fi
268
+ partial+=$part
269
+ if [[ ${1-} == until-cancelled && -n "$cancelled" ]]; then return 2; fi
270
+ done
271
+ }
243
272
  # Ask the worker and its timer to stop, and kill a capture still running.
244
273
  signal_worker() {
245
274
  stopping_worker=1
@@ -254,7 +283,7 @@ stop_worker() {
254
283
  local line
255
284
  if [[ -n "$worker" ]]; then
256
285
  signal_worker
257
- while IFS= read -r line <&3 && take "$line"; do :; done
286
+ while next_line && take "$line"; do :; done
258
287
  exec 3<&-
259
288
  worker=""
260
289
  fi
@@ -273,8 +302,9 @@ trap 'on_signal TERM' TERM
273
302
  if [[ -z "$cancelled" ]]; then
274
303
  exec 3< <(watch_pane)
275
304
  worker=$!
276
- # The first status wins. A signal ends this loop at the worker's next line.
277
- while [[ -z "$status$cancelled" ]] && IFS= read -r line <&3 && take "$line"; do :; done
305
+ # The first status wins. A signal ends this loop at the worker's next line, or
306
+ # within a read slice when that line does not come.
307
+ while [[ -z "$status$cancelled" ]] && next_line until-cancelled && take "$line"; do :; done
278
308
  fi
279
309
  stop_worker
280
310
  if [[ -n "$cancelled" ]]; then
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@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AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,uBAAuB,GAC/B,YAAY,CAAC;AAChB,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAAC;AAuB/F,oDAAoD;AACpD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAK7D;AAcD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAE9F;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,YAAY,EACrB,KAAK,GAAE,oBAAmE,EAC1E,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAC3B,OAAO,CAAC,IAAI,CAAC,CA6Gf;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzD;AAMD,uBAAuB;AAEvB,eAAO,MAAM,yBAAyB;iBACxB,YAAY,SAAS,oBAAoB,qBAAqB,MAAM,IAAI;;;;;;;;;;;;;;;;;CAmBrF,CAAC"}
@@ -21,6 +21,7 @@ import { emitSessionShutdownEvent } from "./extensions/runner.js";
21
21
  import { STALE_EXTENSION_CONTEXT_MESSAGE } from "./extensions/stale-context.js";
22
22
  import { hostNoticeForEvent } from "./host-notices.js";
23
23
  import { normalizeMessageContent } from "./messages.js";
24
+ import { beginQueuedMessageDelivery, endQueuedMessageDelivery, noteQueueUpdateDeliveries, } from "./queued-message-delivery.js";
24
25
  import { abortSessionWork, drainSessionReload, drainSessionWork, hasCallingSessionWork, ownedSessionPermits, ownedSessionStores, sessionGenerationClosing, sessionLifetime, shutdownDeadline, } from "./session-lifecycle-work.js";
25
26
  import { physicalForkHeader } from "./session-manager-core.js";
26
27
  import { retryStatusUpdate } from "./session-retry-status.js";
@@ -58,13 +59,16 @@ export function _emit(event) {
58
59
  }
59
60
  export function _emitQueueUpdate() {
60
61
  const held = heldInputView(this);
61
- this._emit({
62
+ const event = {
62
63
  type: "queue_update",
63
64
  steering: [...this._steeringMessages, ...held.steering],
64
65
  followUp: [...this._followUpMessages, ...held.followUp],
65
- });
66
+ };
67
+ noteQueueUpdateDeliveries(this, event);
68
+ this._emit(event);
66
69
  }
67
- const consumedQueuedMessageEvents = new WeakSet();
70
+ /** The `message_start` of a queued message the turn took, with its delivery until that event reaches the listeners. */
71
+ const consumedQueuedMessageEvents = new WeakMap();
68
72
  /** Sessions whose run was just stopped at its request boundary, with the reported cause (#4226). */
69
73
  const pendingPersistenceStops = new WeakMap();
70
74
  /** Agent-core's synthetic failure replies to those stops. */
@@ -153,15 +157,18 @@ export function _handleAgentEvent(received) {
153
157
  this._createRetryPromiseForAgentEnd(event);
154
158
  // Agent-core has already consumed this message. Reflect admission before an
155
159
  // Escape/abort can restore it from a stale queue while earlier hooks settle.
160
+ let delivery;
156
161
  if (event.type === "message_start" && event.message.role === "user") {
157
162
  // Image-only messages have empty text, and still leave the queue (pi #8612).
158
163
  const text = this._getUserMessageText(event.message);
159
164
  const queue = [this._steeringMessages, this._followUpMessages].find((messages) => messages.includes(text));
160
165
  if (queue) {
161
166
  queue.splice(queue.indexOf(text), 1);
162
- forgetTypedQueuedText(this, queue === this._steeringMessages ? "steer" : "followUp", text);
167
+ const lane = queue === this._steeringMessages ? "steer" : "followUp";
168
+ forgetTypedQueuedText(this, lane, text);
163
169
  this._admittedQueuedMessageAwaitingReply = text;
164
- consumedQueuedMessageEvents.add(event);
170
+ delivery = beginQueuedMessageDelivery(this, lane, text);
171
+ consumedQueuedMessageEvents.set(event, delivery);
165
172
  }
166
173
  }
167
174
  const awaitProtectedPersistence = event.type === "message_end" && event.message.role === "custom"
@@ -198,6 +205,8 @@ export function _handleAgentEvent(received) {
198
205
  : undefined;
199
206
  processing.then(releasePin, (error) => {
200
207
  releasePin?.();
208
+ // A queued message whose processing failed before its message_start went out never reaches the listeners.
209
+ endQueuedMessageDelivery(this, delivery);
201
210
  // #3105: callbacks interrupted by terminal disposal remain observable at shutdown.
202
211
  if (this._disposed) {
203
212
  const failures = shutdownEventFailures.get(this) ?? [];
@@ -277,6 +286,7 @@ export async function _processAgentEvent(event, retryGeneration = this._retryGen
277
286
  // awaits this queue, so the reset lands before the run's first projection.
278
287
  this._callerReplacedNextRequestContext = false;
279
288
  }
289
+ const delivery = consumedQueuedMessageEvents.get(event);
280
290
  if (event.type === "message_start" && event.message.role === "user") {
281
291
  this._overflowRecoveryAttempted = false;
282
292
  this._recoverableLengthRecoveryAttempted = false;
@@ -295,10 +305,15 @@ export async function _processAgentEvent(event, retryGeneration = this._retryGen
295
305
  this._undeliveredAgentStarts -= 1;
296
306
  if (event.type === "agent_end" && this.isRetrying)
297
307
  this._emit({ ...event, retryPending: true });
298
- else if (event.type !== "message_end" && !repeatsShownInput(this, event))
308
+ else if (event.type !== "message_end" && !repeatsShownInput(this, event)) {
309
+ // A queued message leaves the queue its chat shows as its own row reaches the listeners.
310
+ endQueuedMessageDelivery(this, delivery);
299
311
  this._emit(event);
312
+ }
300
313
  }
301
314
  finally {
315
+ // Its message_start never reaches the listeners: a hook failed, or the session already shows the input (#5135).
316
+ endQueuedMessageDelivery(this, delivery);
302
317
  // Agent-core has consumed this protected input already. Its durability
303
318
  // boundary cannot be skipped by a fallible extension or session listener.
304
319
  if (protectedMessage !== undefined) {