moi-computer 0.11.0 → 0.11.1-dev.be1ed10

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 (362) hide show
  1. package/README.md +2 -2
  2. package/client/AGENTS.md +2 -2
  3. package/client/app/AppRouter.tsx +2 -2
  4. package/client/app/routes/WorkspaceRoute.tsx +7 -9
  5. package/client/app/shell/SidebarLayout.tsx +18 -15
  6. package/client/components/shared/BottomPanel.tsx +26 -14
  7. package/client/components/shared/PanelHeader.tsx +1 -1
  8. package/client/components/shared/ReorderableList.tsx +7 -2
  9. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  10. package/client/components/ui/alert-dialog.tsx +1 -0
  11. package/client/components/ui/button.tsx +1 -53
  12. package/client/components/ui/checkbox.tsx +1 -0
  13. package/client/components/ui/collapsible.tsx +1 -15
  14. package/client/components/ui/dialog.tsx +1 -58
  15. package/client/components/ui/dropdown-menu.tsx +1 -254
  16. package/client/components/ui/hover-card.tsx +1 -44
  17. package/client/components/ui/inline-input.tsx +84 -0
  18. package/client/components/ui/input.tsx +1 -21
  19. package/client/components/ui/popover.tsx +1 -88
  20. package/client/components/ui/resizable.tsx +1 -40
  21. package/client/components/ui/skeleton.tsx +1 -13
  22. package/client/components/ui/slider.tsx +1 -70
  23. package/client/components/ui/spinner.tsx +1 -18
  24. package/client/components/ui/switch.tsx +1 -23
  25. package/client/components/ui/tabs.tsx +1 -0
  26. package/client/components/ui/textarea.tsx +1 -18
  27. package/client/components/ui/toast.tsx +2 -2
  28. package/client/components/ui/tooltip.tsx +1 -51
  29. package/client/features/applets/AppletMount.tsx +1 -1
  30. package/client/features/applets/applet-cache.ts +3 -3
  31. package/client/features/applets/applet-runtime.ts +147 -108
  32. package/client/features/applets/applet-styles.ts +2 -2
  33. package/client/features/applets/applet-thumbnail.ts +6 -8
  34. package/client/features/applets/useApplet.ts +10 -9
  35. package/client/features/chat/ChatPanel.tsx +24 -15
  36. package/client/features/chat/ChatPopup.tsx +9 -5
  37. package/client/features/chat/applet-chat-intents.ts +170 -0
  38. package/client/features/chat/chat-send.ts +116 -64
  39. package/client/features/chat/chat-store.ts +51 -62
  40. package/client/features/chat/composer/ChatComposer.tsx +43 -128
  41. package/client/features/chat/composer/ModelPicker.tsx +47 -60
  42. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  43. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  44. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  45. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  46. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  47. package/client/features/chat/composer/attachments/types.ts +25 -0
  48. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  49. package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
  50. package/client/features/chat/composer/model-order.ts +15 -0
  51. package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
  52. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  53. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
  54. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  55. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  56. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
  57. package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
  58. package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
  59. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  60. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  61. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
  62. package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
  63. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  64. package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
  65. package/client/features/chat/sessions/session-view.ts +53 -0
  66. package/client/features/chat/useChat.ts +42 -24
  67. package/client/features/dev/ChatStatesPage.tsx +8 -7
  68. package/client/features/dev/DevIndexPage.tsx +5 -0
  69. package/client/features/dev/DevRoutes.tsx +2 -0
  70. package/client/features/dev/HarnessDebugPage.tsx +11 -8
  71. package/client/features/dev/ToolCallsPage.tsx +1 -1
  72. package/client/features/dev/UiComponentPreviews.tsx +855 -0
  73. package/client/features/dev/UiComponentsPage.tsx +60 -0
  74. package/client/features/dev/chat-states-fixtures.ts +13 -2
  75. package/client/features/drawings/useChatAnnotation.ts +17 -17
  76. package/client/features/drawings/useDrawingLayer.ts +7 -9
  77. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  78. package/client/features/home/HomePage.tsx +8 -7
  79. package/client/features/home/WorkspacePreview.tsx +2 -2
  80. package/client/features/home/workspace-presentation.tsx +1 -11
  81. package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
  82. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
  83. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  84. package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
  85. package/client/features/overview/HiddenPanel.tsx +109 -0
  86. package/client/features/overview/Overview.tsx +302 -0
  87. package/client/features/overview/WidgetCanvas.tsx +164 -0
  88. package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
  89. package/client/features/overview/WorkspaceName.tsx +60 -0
  90. package/client/features/overview/api.ts +30 -0
  91. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  92. package/client/features/overview/default/registry.tsx +36 -0
  93. package/client/features/{widgets → overview}/grid.ts +36 -0
  94. package/client/features/overview/useGridReconcile.ts +94 -0
  95. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  96. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  97. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  98. package/client/features/settings/GeneralSettings.tsx +55 -58
  99. package/client/features/settings/SettingsLayout.tsx +2 -2
  100. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  101. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  102. package/client/features/settings/api.ts +48 -24
  103. package/client/features/views/ViewBuilder.tsx +5 -4
  104. package/client/features/views/ViewManager.tsx +25 -22
  105. package/client/features/views/api.ts +36 -2
  106. package/client/features/views/useViewBuilderActions.ts +8 -5
  107. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  108. package/client/features/views/view-presentation.ts +13 -0
  109. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  110. package/client/features/workspace/UnavailablePage.tsx +21 -0
  111. package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -7
  112. package/client/features/workspace/WorkspaceScreen.tsx +210 -162
  113. package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
  114. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  115. package/client/features/workspace/api.ts +2 -30
  116. package/client/features/workspace/moi-context.ts +8 -9
  117. package/client/features/workspace/tab-resolution.ts +10 -33
  118. package/client/features/workspace/useWorkspaceNavigation.ts +164 -101
  119. package/client/index.css +23 -30
  120. package/client/lib/app-icon-registry.ts +2 -0
  121. package/client/lib/use-latest-ref.ts +11 -0
  122. package/client/main.tsx +1 -1
  123. package/client/runtime/useWorkspaceEvents.ts +59 -14
  124. package/client/theme.css +5 -5
  125. package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
  126. package/dist/chunk-691pqsj6.js +2 -0
  127. package/dist/chunk-7a5nm4k9.css +1 -0
  128. package/dist/chunk-amb8y04y.js +1 -0
  129. package/dist/chunk-cf3pgy7j.js +546 -0
  130. package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
  131. package/dist/chunk-mzrgr577.js +5 -0
  132. package/dist/chunk-nf2wkvf9.js +14 -0
  133. package/dist/chunk-q6a0g26x.js +1 -0
  134. package/dist/chunk-twgdemkc.js +74 -0
  135. package/dist/chunk-x90k0f5c.js +2 -0
  136. package/dist/chunk-yq00csvd.js +2 -0
  137. package/dist/index.html +1 -1
  138. package/lib/app-icons.ts +1 -0
  139. package/lib/applet-selector.ts +24 -0
  140. package/lib/chat-title.ts +6 -1
  141. package/lib/default-widgets.ts +32 -0
  142. package/lib/format.ts +67 -7
  143. package/lib/message-attachments.ts +40 -0
  144. package/lib/moi-attachments.ts +204 -0
  145. package/lib/moi-context.ts +20 -35
  146. package/lib/navigation.ts +84 -0
  147. package/lib/themes.ts +6 -6
  148. package/lib/types.ts +91 -34
  149. package/lib/workspace-icon.ts +20 -0
  150. package/lib/workspace-layout.ts +22 -2
  151. package/lib/workspace-tabs.ts +9 -33
  152. package/package.json +42 -32
  153. package/registry.json +656 -0
  154. package/server/AGENTS.md +2 -0
  155. package/server/agent.ts +1 -1
  156. package/server/api.ts +139 -66
  157. package/server/applet-typecheck.ts +95 -0
  158. package/server/applets/applet-css.ts +55 -0
  159. package/server/{bundler → applets}/build-applet.ts +13 -242
  160. package/server/applets/build-worker.ts +178 -0
  161. package/server/applets/config.ts +226 -0
  162. package/server/applets/dependencies.ts +206 -0
  163. package/server/{applets.ts → applets/index.ts} +44 -189
  164. package/server/applets/runtime/base.ts +4 -0
  165. package/server/applets/runtime/moi.ts +42 -0
  166. package/server/applets/runtime/rpc.ts +17 -0
  167. package/server/applets/view-source.ts +67 -0
  168. package/server/attachment-message.ts +95 -0
  169. package/server/cli-ui-components.ts +28 -33
  170. package/server/cli.ts +169 -108
  171. package/server/control.ts +63 -42
  172. package/server/data-dir.ts +1 -1
  173. package/server/harness/README.md +45 -50
  174. package/server/harness/acp/NOTES.md +426 -0
  175. package/server/harness/acp/adapter.ts +7 -21
  176. package/server/harness/acp/discovery.ts +27 -30
  177. package/server/harness/acp/model-state.ts +57 -0
  178. package/server/harness/acp/session.ts +49 -56
  179. package/server/harness/claude-code/NOTES.md +54 -13
  180. package/server/harness/claude-code/adapter.ts +8 -25
  181. package/server/harness/claude-code/cli.ts +40 -0
  182. package/server/harness/claude-code/index.ts +13 -5
  183. package/server/harness/claude-code/models.ts +72 -19
  184. package/server/harness/claude-code/session.ts +447 -343
  185. package/server/harness/claude-code/sessions.ts +9 -4
  186. package/server/harness/codex/NOTES.md +222 -350
  187. package/server/harness/codex/adapter.ts +102 -52
  188. package/server/harness/codex/auth.ts +1 -3
  189. package/server/harness/codex/client.ts +169 -249
  190. package/server/harness/codex/discovery.ts +9 -17
  191. package/server/harness/codex/index.ts +3 -1
  192. package/server/harness/codex/pagination.ts +24 -0
  193. package/server/harness/codex/permissions.ts +32 -8
  194. package/server/harness/codex/probe.ts +10 -13
  195. package/server/harness/codex/session.ts +567 -181
  196. package/server/harness/codex/transport.ts +184 -0
  197. package/server/harness/debug.ts +1 -1
  198. package/server/harness/hermes/NOTES.md +19 -1
  199. package/server/harness/hermes/discovery.ts +20 -0
  200. package/server/harness/hermes/index.ts +13 -0
  201. package/server/harness/hermes/models.ts +28 -8
  202. package/server/harness/openclaw/NOTES.md +1 -1
  203. package/server/harness/openclaw/adapter.ts +22 -4
  204. package/server/harness/openclaw/gateway.ts +5 -3
  205. package/server/harness/openclaw/session.ts +27 -27
  206. package/server/harness/types.ts +9 -5
  207. package/server/layout.ts +9 -14
  208. package/server/moi-scaffold.ts +22 -14
  209. package/server/navigation-relay.ts +110 -0
  210. package/server/preview.ts +3 -1
  211. package/server/registry.ts +71 -41
  212. package/server/scratchpad-executor.ts +79 -56
  213. package/server/scratchpad-shape-defaults.ts +82 -0
  214. package/server/selected-session.ts +24 -4
  215. package/server/skill-update.ts +5 -3
  216. package/server/skill-version.ts +4 -7
  217. package/server/skills-template.ts +48 -9
  218. package/server/tabs.ts +19 -33
  219. package/server/tldraw-package.d.ts +4 -0
  220. package/server/ui-components.ts +101 -434
  221. package/server/uploads.ts +0 -0
  222. package/server/view-builders.ts +20 -2
  223. package/server/views.ts +126 -6
  224. package/server/web.ts +46 -13
  225. package/server/widgets.ts +12 -5
  226. package/server/workspace-config.ts +13 -9
  227. package/server/workspace-env.ts +3 -2
  228. package/tsconfig.json +0 -1
  229. package/ui-components/accordion.tsx +71 -0
  230. package/ui-components/alert-dialog.tsx +165 -0
  231. package/ui-components/alert.tsx +68 -0
  232. package/ui-components/attachment.tsx +195 -0
  233. package/ui-components/avatar.tsx +90 -0
  234. package/ui-components/badge.tsx +49 -0
  235. package/ui-components/button-group.tsx +78 -0
  236. package/ui-components/button.tsx +55 -0
  237. package/ui-components/calendar.tsx +180 -0
  238. package/ui-components/card.tsx +84 -0
  239. package/ui-components/carousel.tsx +235 -0
  240. package/ui-components/chart.tsx +338 -0
  241. package/ui-components/checkbox.tsx +28 -0
  242. package/ui-components/collapsible.tsx +15 -0
  243. package/ui-components/combobox.tsx +267 -0
  244. package/ui-components/context-menu.tsx +244 -0
  245. package/ui-components/dialog.tsx +138 -0
  246. package/ui-components/docs/accordion.md +463 -0
  247. package/ui-components/docs/alert-dialog.md +481 -0
  248. package/ui-components/docs/alert.md +301 -0
  249. package/ui-components/docs/attachment.md +689 -0
  250. package/ui-components/docs/avatar.md +495 -0
  251. package/ui-components/docs/badge.md +258 -0
  252. package/ui-components/docs/button-group.md +879 -0
  253. package/ui-components/docs/button.md +26 -0
  254. package/ui-components/docs/calendar.md +862 -0
  255. package/ui-components/docs/card.md +265 -0
  256. package/ui-components/docs/carousel.md +627 -0
  257. package/ui-components/docs/chart.md +1256 -0
  258. package/ui-components/docs/checkbox.md +477 -0
  259. package/ui-components/docs/collapsible.md +446 -0
  260. package/ui-components/docs/combobox.md +1003 -0
  261. package/ui-components/docs/context-menu.md +860 -0
  262. package/ui-components/docs/data-table.md +1580 -0
  263. package/ui-components/docs/date-picker.md +614 -0
  264. package/ui-components/docs/dialog.md +414 -0
  265. package/ui-components/docs/drawer.md +51 -0
  266. package/ui-components/docs/dropdown-menu.md +1000 -0
  267. package/ui-components/docs/field.md +1192 -0
  268. package/ui-components/docs/hover-card.md +275 -0
  269. package/ui-components/docs/input-group.md +866 -0
  270. package/ui-components/docs/input.md +456 -0
  271. package/ui-components/docs/kbd.md +191 -0
  272. package/ui-components/docs/label.md +295 -0
  273. package/ui-components/docs/pagination.md +416 -0
  274. package/ui-components/docs/popover.md +348 -0
  275. package/ui-components/docs/progress.md +214 -0
  276. package/ui-components/docs/radio-group.md +389 -0
  277. package/ui-components/docs/resizable.md +265 -0
  278. package/ui-components/docs/select.md +616 -0
  279. package/ui-components/docs/separator.md +216 -0
  280. package/ui-components/docs/skeleton.md +205 -0
  281. package/ui-components/docs/slider.md +226 -0
  282. package/ui-components/docs/spinner.md +332 -0
  283. package/ui-components/docs/switch.md +236 -0
  284. package/ui-components/docs/table.md +551 -0
  285. package/ui-components/docs/tabs.md +379 -0
  286. package/ui-components/docs/textarea.md +187 -0
  287. package/ui-components/docs/toggle-group.md +370 -0
  288. package/ui-components/docs/toggle.md +91 -0
  289. package/ui-components/docs/tooltip.md +290 -0
  290. package/ui-components/drawer.tsx +213 -0
  291. package/ui-components/dropdown-menu.tsx +263 -0
  292. package/ui-components/field.tsx +224 -0
  293. package/ui-components/hover-card.tsx +46 -0
  294. package/ui-components/input-group.tsx +146 -0
  295. package/ui-components/input.tsx +20 -0
  296. package/ui-components/kbd.tsx +32 -0
  297. package/ui-components/label.tsx +17 -0
  298. package/ui-components/pagination.tsx +124 -0
  299. package/ui-components/popover.tsx +81 -0
  300. package/ui-components/progress.tsx +63 -0
  301. package/ui-components/radio-group.tsx +38 -0
  302. package/ui-components/resizable.tsx +40 -0
  303. package/ui-components/scoped-portal.tsx +31 -0
  304. package/ui-components/select.tsx +195 -0
  305. package/ui-components/separator.tsx +18 -0
  306. package/ui-components/skeleton.tsx +15 -0
  307. package/ui-components/slider.tsx +75 -0
  308. package/ui-components/spinner.tsx +20 -0
  309. package/ui-components/switch.tsx +27 -0
  310. package/ui-components/table.tsx +86 -0
  311. package/ui-components/tabs.tsx +75 -0
  312. package/ui-components/textarea.tsx +17 -0
  313. package/ui-components/toggle-group.tsx +85 -0
  314. package/ui-components/toggle.tsx +42 -0
  315. package/ui-components/tooltip.tsx +61 -0
  316. package/ui-components/utils.ts +8 -0
  317. package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
  318. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
  319. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  320. package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
  321. package/client/features/chat/attachment-staging.ts +0 -153
  322. package/client/features/chat/uploads.ts +0 -18
  323. package/client/features/chat/useAppletChatMessage.ts +0 -68
  324. package/client/features/settings/IconPicker.tsx +0 -442
  325. package/client/features/settings/WorkspaceSettings.tsx +0 -92
  326. package/client/features/settings/render-icon.ts +0 -173
  327. package/client/features/widgets/HiddenPanel.tsx +0 -80
  328. package/client/features/widgets/WidgetGrid.tsx +0 -123
  329. package/client/features/widgets/Widgets.tsx +0 -264
  330. package/client/features/widgets/useGridReconcile.ts +0 -73
  331. package/dist/chunk-104m57qw.js +0 -2
  332. package/dist/chunk-59zf0m6n.js +0 -1
  333. package/dist/chunk-bj3akjs2.js +0 -1
  334. package/dist/chunk-c9pjqx9m.js +0 -14
  335. package/dist/chunk-j2w2vak4.js +0 -546
  336. package/dist/chunk-k2r9c95m.js +0 -10
  337. package/dist/chunk-kmbxhgwv.js +0 -1
  338. package/dist/chunk-p1yqa71k.js +0 -83
  339. package/dist/chunk-pcnahct1.js +0 -5
  340. package/dist/chunk-r5xrenjy.css +0 -1
  341. package/dist/chunk-tny85yt2.js +0 -2
  342. package/dist/chunk-v7wr1df4.js +0 -2
  343. package/server/bundler/applet-css.ts +0 -155
  344. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  345. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  346. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  347. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  348. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  349. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  350. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  351. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  352. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  353. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  354. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  355. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  356. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  357. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  358. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  359. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  360. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  361. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
  362. /package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +0 -0
@@ -0,0 +1,426 @@
1
+ # ACP agents — verified behavior and implementation plan
2
+
3
+ Updated 2026-09-05 (Asia/Nicosia). These notes replace the original conformance
4
+ report and its implementation plan. Findings, verification limits, and proposed
5
+ solutions are consolidated here. The fixes below are not implemented.
6
+
7
+ **Fix moi's session lifecycle and protocol mapping before adding providers.**
8
+ The independent host probe exposed twelve failed behavior checks despite all
9
+ 42 existing ACP tests passing. Provider compatibility then needs a few focused
10
+ hooks: fx process isolation and history retrieval, Hermes completion/usage
11
+ handling, and Cursor config/replay support. A generic journal, workspace-type
12
+ migration, and custom-agent registry are not prerequisites.
13
+
14
+ ## 1. Evidence and verification
15
+
16
+ Fresh tests ran against moi `9bfd2ed` and `@agentclientprotocol/sdk@1.3.0`:
17
+
18
+ | Agent | Command | Installed version | Model used |
19
+ | ------ | ------------------ | ----------------------------- | ----------------------------------- |
20
+ | Hermes | `hermes acp` | `0.21.0`, source `d3630f8532` | `xai-oauth:grok-build-0.1` |
21
+ | fx | `fx acp` | `0.0.7` | `zai/glm-5.3-flash` |
22
+ | Cursor | `cursor-agent acp` | `2026.09.02-c22c1a3` | `auto-smart[optimize_for=balanced]` |
23
+
24
+ fx source was inspected at `7e02f32f7fca`; the installed binary reports only
25
+ `0.0.7`, so that commit is corroborating source, not a proven binary identity.
26
+ Hermes source was inspected in the installed checkout at the revision above.
27
+
28
+ Fresh independent JSON-RPC probes exercised creation, config rejection, real
29
+ shell/write/read operations, injected environment values checked against the
30
+ resulting file, multiple sessions, cold list/load/resume, nonexistent sessions,
31
+ nondefault modes, cancellation during tools, and broken MCP startup. Hermes
32
+ steering was exercised during an active shell call. The host probe separately
33
+ drove moi's actual ACP client, session, and adapter through a mock subprocess.
34
+
35
+ Images, successful MCP calls, permission-denial behavior, Cursor `--force`, and
36
+ subagent transcripts have **historical capture evidence only**. Those captures
37
+ were inspected but these cases were not freshly rerun. The old matrix script
38
+ and mini-MCP script are absent from this checkout and its available git history;
39
+ the old command examples no longer apply. Aggregate pass/fail rankings have
40
+ been removed: optional methods are not conformance failures, and an RPC
41
+ acknowledgement does not prove that a setting took effect.
42
+
43
+ The one-off probe scripts and separate audit artifacts are not retained in the
44
+ repository. To repeat the provider checks, use an independent JSON-RPC client
45
+ with the commands above, existing authentication, and disposable workspaces.
46
+ Test nondefault modes before and after restarting the process, cancel while a
47
+ tool is active, and verify file contents against a random environment marker.
48
+ Restore the confirmed model after rejection tests. For host regressions, use
49
+ the observed failures and acceptance criteria in §5; run the existing suite
50
+ with `bun test server/harness/acp`.
51
+
52
+ The audit did not upgrade agents, temporarily edit global settings, or file
53
+ upstream issues. Fresh raw captures were stored in `/tmp/moi-acp-audit.f4Uoya/`;
54
+ historical captures were inspected under
55
+ `/tmp/claude-501/-Users-molefrog-git-moi/645be88d-e045-49f1-a68a-66b70769f71e/scratchpad/`.
56
+ These temporary paths may disappear and are not durable test dependencies.
57
+
58
+ ## 2. Verified compatibility summary
59
+
60
+ These are observations for the tested builds, not promises about every model,
61
+ provider configuration, or future version. See the following sections for
62
+ limitations and solutions.
63
+
64
+ | Behavior | Hermes | fx | Cursor |
65
+ | --------------------------------------------- | --------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------- |
66
+ | Earlier session usable after creating another | Yes in sequential test | No: `Session is not active` | Yes in sequential test |
67
+ | Model configuration | Legacy `models` / `session/set_model` | `configOptions`; distinct provider and model selectors | `models` and `configOptions`; exact parameterized model IDs |
68
+ | Independently settable effort | Not verified; current path omits config | Unknown effort option is inert | No separate override established; use catalog variants |
69
+ | Live tool completion | File calls remain unsettled | Output deltas and final shell envelope | Paired updates; inputs/output may arrive after start |
70
+ | Cold `session/load` | Structured replay | Tool history flattened into assistant prose | Structured replay |
71
+ | `session/resume` | Supported, also replays | Attaches without replay | Method not found in tested build; use load |
72
+ | Load nonexistent session | Returns `{}` | Error | Error |
73
+ | Changed mode after warm load | `dont_ask` preserved | `code` resets to `ask` | `plan` preserved |
74
+ | Changed mode after cold load | Resets to `default` | Resets to `ask` | `plan` preserved |
75
+ | Cancel during a tool | Internal error in finalization | `cancelled`, tool left unsettled | `cancelled`, tool left unsettled |
76
+ | Mid-turn steering | `/steer` prompt works | No equivalent verified | No equivalent verified |
77
+ | Broken stdio MCP executable on creation | Returns a session ID | Rejects creation | Returns a session ID |
78
+ | Prompt usage | Cumulative agent counters | Input/output observed | None observed |
79
+ | Context usage update | Observed | Observed, including cost | None observed |
80
+ | Alternative history path | Local SQLite exists; prefer replay | Supported `fx session --id <id> --json` | Local store contains plaintext/JSON; prefer replay |
81
+
82
+ The Hermes/Cursor sequential test does not prove unrestricted concurrent
83
+ session isolation. A safe default for unfamiliar agents is a dedicated process
84
+ per open chat. Process sharing should be an explicit provider optimization,
85
+ not a destructive runtime probe against a user's active sessions.
86
+
87
+ ## 3. Shared protocol rules
88
+
89
+ ### Tool updates replace collections
90
+
91
+ The installed SDK explicitly defines `ToolCallUpdate.content` and `locations`
92
+ as replacements. An omitted field preserves its previous value; an explicit
93
+ `[]` clears it. moi currently fails to clear both and drops `rawOutput`.
94
+ Preserve structured diffs and outputs instead of flattening them to `newText`.
95
+
96
+ `rawOutput` and `UsageUpdate.cost` are standard fields in SDK 1.3.0; cost is a
97
+ cumulative session value. `ToolCall.name` is present as an **unstable** field.
98
+ fx's `command_result` is an extension. Do not discard useful standard fields
99
+ as unknown provider extras. See [tool calls](https://agentclientprotocol.com/protocol/v1/tool-calls).
100
+
101
+ fx's incremental shell output needs an fx-specific normalization hook that
102
+ produces replacement snapshots for the shared adapter. Recognize its shell
103
+ completion envelope before treating it as metadata; retain legitimate final
104
+ text and failures. A global append rule duplicates cumulative snapshots and
105
+ can hide the final result.
106
+
107
+ ### Supplied message IDs define boundaries
108
+
109
+ Two adjacent assistant messages with IDs `a` and `b` currently collapse into
110
+ one `onetwo` message. Flush on supplied identity changes for both user and
111
+ assistant messages. Use role/tool boundary heuristics only when IDs are absent.
112
+ Keep IDs opaque, including literal newlines. Live and replay IDs need not match:
113
+ fresh Hermes replay used `call-…`, Cursor replay used `replay-…`, and both
114
+ used different live IDs. The old Hermes `functions.<tool>:<n>` replay format is
115
+ not universal. Do not reconcile persisted history through ephemeral wire IDs.
116
+
117
+ ### Configuration belongs to a session
118
+
119
+ Support advertised `configOptions` and legacy `models`/`modes`, including grouped
120
+ values and config updates. Keep selected values separate from the catalog cache.
121
+ Prefer known preset option IDs; semantic categories are a fallback, not unique
122
+ keys. fx marks **both** `provider` and `model` with category `model`.
123
+
124
+ Other ACP agents can expose `thought_level`; detect it instead of declaring
125
+ ACP incapable of effort control. Return only confirmed model/config selections
126
+ and surface rejected changes. See [session config options](https://agentclientprotocol.com/protocol/v1/session-config-options).
127
+
128
+ Modes are not a portable permission policy: `code` or `agent` does not imply
129
+ bypass. Apply an explicit preset policy and answer permission requests.
130
+ `resumeSession` already reapplies moi's no-prompt mode after `session/load`;
131
+ adding that same load-path fix again would be redundant.
132
+
133
+ ### Capabilities and authentication need separate checks
134
+
135
+ An executable resolving on PATH proves installation, not authenticated readiness.
136
+ `authMethods` advertises login methods, not current login success; an empty list
137
+ does not prove unavailability. Run provider status checks under the same
138
+ profile/environment as the session and retain an unknown state for custom
139
+ agents. No login was performed during this audit.
140
+
141
+ Check advertised image/resource capabilities. An agent reading a supplied URI
142
+ does not prove it consumed embedded content; a strict test needs an inline-only
143
+ random marker with no readable file. moi's text-only chunk handler currently
144
+ drops unsupported assistant media. Unknown extension requests should receive
145
+ prompt errors, but returning an error is not implementing the associated feature.
146
+
147
+ ## 4. Provider-specific solutions
148
+
149
+ ### Hermes
150
+
151
+ - **Missing live file-tool completions:** reproduced with three starts and one
152
+ update. Preserve an unknown/interrupted outcome when completion is absent;
153
+ never synthesize success at turn end. Upstream should pair completions by
154
+ invocation ID, not FIFO tool name, which also risks out-of-order same-name
155
+ calls. Related background is in [the Hermes notes](../hermes/NOTES.md), whose
156
+ older claims must be read against this audit.
157
+ - **Cancellation crash:** a shell cancellation returned `-32603` with
158
+ `'NoneType' object has no attribute 'startswith'`. Source uses
159
+ `result.get('final_response', '')`, which leaves explicit `None` unchanged.
160
+ Normalize optional text upstream and guarantee cancelled finalization.
161
+ Locally preserve cancellation intent, settle cards honestly, and surface
162
+ unexpected errors; do not suppress every exception after a cancel request.
163
+ - **Steering works over ACP:** during `sleep 12`, a concurrent prompt containing
164
+ `/steer … reply STEERED …` changed the original run's answer to `STEERED`.
165
+ The slash handler runs before the busy check. A dedicated Hermes steer hook
166
+ must distinguish the short acknowledgement RPC's `end_turn` from completion
167
+ of the original prompt. Its acknowledgement chunks share the session stream.
168
+ `/queue` is advertised but was not freshly exercised; ordinary queueing
169
+ remains the fallback.
170
+ - **Model switching drops session MCP configuration:** `_switch_model` rebuilds
171
+ without reattaching it. Keep specs on the session and reattach after rebuild.
172
+ The registry is also process-global by server name; conflicting same-name
173
+ configs are not proven isolated. Use dedicated chat processes when connector
174
+ configs differ. The upstream fix needs instance-scoped MCP ownership.
175
+ - **Broken MCP startup can still return a session:** creation success is not
176
+ connector readiness. Preserve connector diagnostics and verify availability
177
+ separately rather than assuming registration is all-or-nothing.
178
+ - **Usage is cumulative:** the tools prompt reported 52,132 input / 899 output;
179
+ the next short prompt reported 65,761 / 1,017. `turn_finalizer.py` copies
180
+ `agent.session_*` counters into the response. Compute provider-specific deltas
181
+ only within a known agent instance; reset on rebuild/reconnect and guard
182
+ decreases. An unknown baseline is cumulative data, not invented turn usage.
183
+ - **Effort-file workaround is unconnected:** `_make_agent` loads config but
184
+ does not pass resolved `reasoning_config` to `AIAgent`. A mocked constructor
185
+ with `agent.reasoning_effort: high` confirmed the omission. Resolve/pass
186
+ session-local reasoning on creation and rebuild, then expose `thought_level`
187
+ upstream. Keep the independent picker unavailable until that path works.
188
+ - **Missing sessions appear to load:** the nonexistent-ID test returned `{}`.
189
+ Upstream should return an explicit error; locally check known membership
190
+ where available without treating a truncated list as authoritative absence.
191
+ - **Modes:** warm load preserves `dont_ask`; cold load resets to `default`.
192
+ Reapply the chosen policy on attachment. Historical default-mode file denial
193
+ was bypassed through a shell redirect: that gate is not a filesystem sandbox.
194
+ - **Discovery can truncate:** source scans at most 1,000 ACP records before cwd
195
+ filtering. A filtered empty result does not establish that no sessions exist.
196
+
197
+ ### fx
198
+
199
+ - **One active session per process:** creating another session invalidates the
200
+ first. Source can cancel/reap current work, so serialize neither discovery nor
201
+ unrelated chats through an active chat process. Use one owned lease per open
202
+ chat and a separate short-lived discovery process when needed.
203
+ - **Prefer supported history retrieval:**
204
+ `fx session --id <id> --json` returned tool inputs/results and a complete file
205
+ presentation/diff. Adapt that for cold display; attach through
206
+ `session/resume`. `session/load` remains a visibly lossy fallback. This is
207
+ simpler than building readers for private events/checkpoints or introducing
208
+ a generic journal first. [Issue #624](https://github.com/vercel-labs/fx/issues/624)
209
+ was open when checked on 2026-09-05; no new issue was filed.
210
+ - **Normalize shell deltas locally:** accumulate incremental `in_progress`
211
+ text into a snapshot; recognize the final shell envelope and retain useful
212
+ `command_result` metadata. File writes can finish with ordinary prose and
213
+ failures with error text, so completion content is not universally metadata.
214
+ - **Use tool identity separately from display:** generic titles such as
215
+ `Running` and `Writing` need `name`, `kind`, and `rawInput` for useful labels.
216
+ File paths may be in `rawInput.path` without `locations`; some tools wrap
217
+ inputs in `rawInput.request`. Preserve the native title where useful instead
218
+ of introducing a large vocabulary table upfront.
219
+ - **Operational notices arrive as assistant chunks:** classify a buffered
220
+ prefix such as `[context]` or `skill discovery warning:` within the fx hook.
221
+ The prefix can span chunks; IDs rotate when switching between operational
222
+ and assistant output, so do not assume one diagnostic ID per run. Show
223
+ omitted-instruction notices instead of silently hiding missing context.
224
+ - **Reapply explicit policy:** setting `code` then loading resets the reported
225
+ mode to `ask`, both warm and cold. Source/historical evidence distinguishes
226
+ reported mode from effective permission settings. Verify policy behavior,
227
+ not just a response label.
228
+ - **Validate model selections:** the configured gateway accepted an invalid
229
+ model value; other providers have different validation paths. Prefer its
230
+ known `model` option ID and preserve the separate provider selector. Verify
231
+ returned state and fail the send when a required switch fails.
232
+ - **Do not swap global settings for effort:** separate processes still race
233
+ on `~/.fx/settings.json`, crashes can leave a temporary value installed, and
234
+ unrelated CLI launches can observe it. Expose a validated session-local
235
+ `thought_level` option upstream and persist effort with the session.
236
+ - **Keep measured run durations:** all four observed CLI tool results had the
237
+ same `created_at_ms`; the turn had no start/end fields. Those timestamps do
238
+ not establish per-tool duration and do not replace `run-durations.ts`.
239
+ - **Instruction discovery outside home is limited:** source has a specific
240
+ omission reason for such workspaces. This does not prohibit execution there.
241
+ Report omitted rules; do not move the workspace or spoof `HOME`.
242
+
243
+ Representative shell updates, abbreviated from the captures:
244
+
245
+ ```json
246
+ {"sessionUpdate":"tool_call","toolCallId":"…","name":"shell","title":"Running","kind":"execute","rawInput":{"action":"run","command":"echo hello"}}
247
+ {"sessionUpdate":"tool_call_update","toolCallId":"…","status":"in_progress","content":[{"type":"content","content":{"type":"text","text":"hello\n"}}]}
248
+ {"sessionUpdate":"tool_call_update","toolCallId":"…","status":"completed","content":[{"type":"content","content":{"type":"text","text":"{\"state\":\"completed\",\"exit_code\":0}"}}],"command_result":{"kind":"command","exit_code":0}}
249
+ ```
250
+
251
+ Historical captures/source also describe yielded shell calls whose invocation
252
+ finishes while their process remains running, followed by late output. Preserve
253
+ that distinction: a completed tool invocation does not prove the underlying
254
+ background command exited. Test this path before implementing late-output rules.
255
+
256
+ ### Cursor
257
+
258
+ - **Use `session/load` for attachment and structured replay.** The tested
259
+ build does not implement `session/resume`. A newly created empty session
260
+ cannot be reloaded before its first prompt, so keep its live lease; do not
261
+ assume a discovery-created ID is already durable history.
262
+ - **Keep exact catalog IDs opaque.** Parameterized variants are accepted;
263
+ invented brackets, bare IDs, and unknown config options were rejected.
264
+ Present the available variants without synthesizing combinations. No
265
+ separate per-chat effort override was established by this audit.
266
+ - **Preserve delayed tool fields:** inputs, `rawOutput`, diffs, and locations
267
+ can arrive after the start. Tool IDs can include newlines; replay IDs differ.
268
+ - **Keep the existing permission callback policy.** Shell approval was freshly
269
+ observed; successful MCP calls and `--force` have historical evidence.
270
+ The callback already supports moi's current auto-approval behavior; requiring
271
+ a global flag is unnecessary.
272
+ - **Plan mode needs an implementation:** historical captures show a
273
+ `cursor/create_plan` request. Returning an unsupported-method error prevents
274
+ a hang but does not make plan mode usable. Implement and test the extension
275
+ before exposing the mode. Changed `plan` mode persisted across warm and
276
+ cold loads, contradicting the original universal-reset claim.
277
+ - **Report usage unavailable:** no usage was observed in fresh prompts,
278
+ replay, or cancellation. Do not display zero or infer token counts. Consume
279
+ standard fields if a later version emits them.
280
+ - **The store is not encrypted as claimed:** the audit session's `store.db`
281
+ contained 14 parseable JSON blobs plus 37 other blobs; 13 contained the test
282
+ marker in plaintext. Binary records do not prove encryption. This does not
283
+ establish a supported schema or complete child-history recovery; prefer load.
284
+ - **Treat connector startup separately:** broken stdio MCP creation still
285
+ returned a session ID, as with Hermes.
286
+
287
+ ## 5. Existing moi defects and acceptance criteria
288
+
289
+ The independent host probe reproduced twelve failed checks, grouped below into
290
+ nine related problems. These are host defects, independent of the provider
291
+ observations above. The grouped collection row covers three checks; the
292
+ loading/readiness row covers two.
293
+
294
+ | Priority | Observed problem | Required behavior |
295
+ | -------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
296
+ | P1 | Concurrent cold loads issue two load RPCs and competing subscriptions. | Share one initialization promise per session; both callers receive the same complete replay from one RPC. |
297
+ | P1 | Loading records appear live; sends can run before replay finishes. | Separate loading from ready. Register the receiver early, publish readiness late, and make reads/sends await initialization. |
298
+ | P1 | A queued send changes the model during the preceding prompt. | Keep model/stream settings on the queue item and apply them at dequeue, preserving the original run's metadata. |
299
+ | P1 | Cancellation/error cleanup marks unfinished tools successful. | Only completion evidence yields success; use interrupted/unknown or an explicit error explanation for unresolved calls. |
300
+ | P1 before adding providers | Different provider specs in the same cwd reuse one client. | Key by provider/profile/config generation and session scope; retain the concrete client lease on the session. |
301
+ | P2 | Adjacent message IDs collapse into one message. | Respect identity changes, interleaved tools, and chunked diagnostics. |
302
+ | P2 | Empty content/locations do not clear; raw output is lost. | Preserve omitted fields, replace explicit collections including `[]`, and retain output data. |
303
+ | P2 | A tool-only prompt loses its response usage. | Attach completion metadata to the final assistant/tool turn or a dedicated run record, even without final assistant text. |
304
+ | P2 | RPC errors lose `code` and `data`. | Preserve typed errors so `-32601` can drive capability fallback and nested provider details remain visible. |
305
+
306
+ Additional source-confirmed gaps, not separately exercised by that mock:
307
+
308
+ - `resumeSession` ignores returned model/config state. Seed it on attachment
309
+ so replay metadata is correct and the next send does not needlessly rebuild
310
+ an already selected Hermes model. Failed model switches are currently logged
311
+ and ignored; retain the last confirmed selection and surface failure.
312
+ - There is **no ACP idle TTL**. `forgetAcpSession` drops the record/subscription
313
+ without cancelling work or releasing the backend session. Add ownership,
314
+ bounded idle cleanup, and cancel/close/release; never reap busy sessions.
315
+ - Exit cleanup compares the pool's `startClient(...)` promise with a different
316
+ inner `Promise.resolve(record)`, so identity cannot match. Compare the actual
317
+ stored promise/record and prevent stale exits from deleting replacement
318
+ clients. Validate parsed envelopes against null/primitives and settle
319
+ read/write failures without leaving child processes behind.
320
+ - After `__exit`, the old run's `finally` can drain queued work through a new
321
+ process before reattaching the session. Invalidate the client generation and
322
+ explicitly recover or discard queued work. Archive/forget must invalidate
323
+ its runner too.
324
+ - Model discovery creates a real session on the shared process. This would
325
+ invalidate fx's active chat even if normal sends used separate keys. Reuse
326
+ ready-session config or acquire a separate discovery lease.
327
+ - Listing stops after five pages; preview reads one page and trusts cwd
328
+ filtering. Expose paging, deduplicate IDs/cursors, filter mismatched cwds,
329
+ and report truncation. A generated title is not the first user message.
330
+
331
+ ## 6. Persistence and optional features
332
+
333
+ Keep transcript retrieval separate from backend attachment. A journal can
334
+ restore display but cannot make an agent without load/resume remember previous
335
+ context. Never silently replace a failed resume with a new empty conversation.
336
+ See [session setup](https://agentclientprotocol.com/protocol/v1/session-setup).
337
+
338
+ Use Hermes/Cursor load and fx's supported history CLI first. If a journal is
339
+ still needed, define versioned records, run IDs, sequence numbers, begin/end
340
+ markers, and coverage/freshness before making it authoritative. “Journal if
341
+ present” hides external CLI/editor changes and partial recordings. Appending
342
+ every accumulated UI snapshot can produce quadratic storage. Define imported
343
+ sessions, crash recovery, reconciliation, attachment lifetime, and unavailable
344
+ model context explicitly.
345
+
346
+ Historical subagent traces support flat tool cards as the initial presentation.
347
+ Hermes task logs and fx child stores may provide optional enrichment later.
348
+ Claims that thoughts are never persisted, child data is only available after
349
+ completion, or Cursor has no readable child data exceed the evidence. Do not
350
+ couple the first integration to private subagent formats.
351
+
352
+ moi-side archive is distinct from deleting provider history and must still
353
+ cancel/release owned resources. Historical missing close/fork/delete methods
354
+ are observations, not universal protocol prohibitions; detect supported methods
355
+ and preserve error codes for fallback.
356
+
357
+ ## 7. Implementation order
358
+
359
+ 1. **Fix lifecycle ownership and add regressions.** One pending/ready session
360
+ record, one client lease, one serialized queue, confirmed session config,
361
+ preserved RPC errors, explicit cancellation/release, and guarded recovery.
362
+ Cover the twelve reproduced behaviors before enabling more providers.
363
+ 2. **Correct the shared adapter.** Replacement collections, message boundaries,
364
+ structured output/diffs, honest final status, and tool-only completion data.
365
+ Keep fx delta/envelope/diagnostic handling in a small provider hook.
366
+ 3. **Add fx.** Dedicated chat processes, separate discovery, known selectors,
367
+ supported CLI history adapter, and `session/resume`; make fallback loss clear.
368
+ 4. **Add Cursor.** Reuse config/replay and the current permission callback.
369
+ Show usage as unavailable; implement/test plan requests before enabling plan.
370
+ 5. **Add user-defined agents only when that product surface is wanted.** Grow
371
+ the existing `AcpProviderConfig` with focused hooks first. A new workspace
372
+ type, migration, custom registry, presentation endpoint, and setup UI are
373
+ separate product work. Custom commands are machine-local; a shareable
374
+ workspace reference must handle a missing local definition explicitly.
375
+ 6. **Add a journal/private reader only for a demonstrated remaining gap.**
376
+ Define coverage, freshness, recovery, and backend-context behavior first.
377
+
378
+ ## 8. Tracker
379
+
380
+ Original IDs are retained so earlier references remain meaningful. “Confirmed”
381
+ means observed or source-confirmed as specified above, not fixed. The only
382
+ linked existing upstream issue is #1; no new reports were sent in this audit.
383
+
384
+ | # | Agent | Finding and disposition |
385
+ | --- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
386
+ | 1 | fx | Lossy load confirmed. [Issue #624](https://github.com/vercel-labs/fx/issues/624) open as of 2026-09-05; use supported CLI history plus resume. |
387
+ | 2 | fx | Diagnostics confirmed. Buffer/classify within fx and surface relevant notices; upstream should use a distinct notification. |
388
+ | 3 | fx | One active session confirmed. Dedicated chat leases, separate discovery, explicit cleanup. |
389
+ | 4 | fx | Mode reset confirmed; effective policy is distinct from its label. Apply/test explicit policy. |
390
+ | 5 | fx | Generic titles confirmed. Use name/kind/inputs for identity and display. |
391
+ | 6 | fx | Invalid model accepted on the tested gateway. Validate picker values and confirmed state; do not generalize to every backend. |
392
+ | 7 | Hermes | Missing file-tool completions confirmed. Honest unresolved outcomes locally; invocation-ID pairing upstream. |
393
+ | 8 | Hermes | Model rebuild omits MCP config in source. Retain/reattach specs and isolate conflicting registries. |
394
+ | 9 | Cursor | Shell approvals confirmed; MCP/force historical. Existing permission callback supports current moi policy. |
395
+ | 10 | Cursor | Usage absent in tested paths. Display unavailable and accept future standard updates. |
396
+ | 11 | All | Universal mode reset disproved. Cursor preserves plan; Hermes preserves warm mode; moi already reapplies mode after load. |
397
+ | 12 | fx | Effort option inert. No global settings swap; upstream session-local option and persistence. |
398
+ | 13 | Hermes | Effort config not passed through constructor path. Resolve/pass session reasoning upstream; keep picker unavailable meanwhile. |
399
+ | 14 | Cursor | Exact catalog variants work; separate effort override not established. Do not invent IDs or claim impossibility. |
400
+ | 15 | All | Flat subagent cards have historical evidence. Optional private-history enrichment remains separate work. |
401
+ | 16 | Hermes | Newly found cancellation finalizer crash. Normalize optional response text upstream; preserve stop intent and errors locally. |
402
+ | 17 | Hermes | Newly found cumulative prompt usage. Delta only within a known agent instance and preserve unknown baselines. |
403
+ | 18 | Hermes | Newly found nonexistent load returns `{}`. Explicit error upstream; cautious membership checks locally. |
404
+ | 19 | Cursor | Newly found empty session cannot cold-load before its first prompt. Retain live ownership. |
405
+ | 20 | moi | Twelve failed host checks plus source-confirmed lifecycle gaps. Fix and regress before adding providers (§5–7). |
406
+
407
+ ## 9. Sources and remaining uncertainty
408
+
409
+ Primary sources: the installed ACP 1.3.0 schema, installed Hermes source, and
410
+ fx's pinned [request handling](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/server.zig),
411
+ [session handling](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/sessions.zig),
412
+ [streaming](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/prompt.zig),
413
+ and [configuration](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/core/config/config_runtime.zig).
414
+
415
+ Cursor's exact old-version replay-fix date, separation of interactive and ACP
416
+ stores, every possible effort override, and the original Grok CLI exclusion
417
+ were not independently established. Do not carry them forward as requirements.
418
+ Catalog counts and timings vary; measure startup, first model token, and tool
419
+ completion separately with repeated controlled runs. Diagnostic first bytes
420
+ are not model latency.
421
+
422
+ At audit time, all 42 existing ACP tests passed. Full typechecking was blocked
423
+ by the existing `ui-components/drawer.tsx` import of an unexported `Drawer`.
424
+ The temporary probes passed lint and produced no type errors. Their twelve
425
+ failed host checks remain unresolved; the test suite was not modified to accept
426
+ those behaviors.
@@ -7,9 +7,9 @@
7
7
  // call both closes the open assistant turn and becomes a turn of its own —
8
8
  // the same item-per-turn model the Codex adapter produces.
9
9
 
10
- import { splitAttachmentNote } from '@/lib/attachment-note'
10
+ import { replayAttachmentParts } from '@/lib/moi-attachments'
11
+ import { formatChatTitle } from '@/lib/chat-title'
11
12
  import type { Part, ToolCall, ToolState, Turn, TurnMeta } from '@/lib/format'
12
- import { stripMoiContext } from '@/lib/moi-context'
13
13
 
14
14
  import {
15
15
  type AcpSessionListEntry,
@@ -109,31 +109,17 @@ export function acpUsageToTurnMeta(usage: Usage | null | undefined): TurnMeta['u
109
109
  return { inputTokens, outputTokens, totalTokens }
110
110
  }
111
111
 
112
- // Replayed `user_message_chunk` text is the persisted prompt verbatim: the
113
- // typed text plus everything the sender appended to it — the attachment note
114
- // and the `<moi-context>` envelope (see sendAcpMessage in ./session.ts). Fold
115
- // that machinery back out so a reloaded bubble matches the live one. Envelope
116
- // first: it is appended after the note, and `splitAttachmentNote` parses the
117
- // note as the text's tail. An envelope-only block (an attachment-only send
118
- // carries the envelope as its lone text) folds to no parts — the caller skips
119
- // the bubble entirely.
120
- export function replayedUserParts(raw: string): Part[] {
121
- const split = splitAttachmentNote(stripMoiContext(raw))
122
- const parts: Part[] = split.files.map(f => ({
123
- type: 'file',
124
- mediaType: 'application/octet-stream',
125
- url: f.path,
126
- filename: f.filename
127
- }))
128
- if (split.text.trim()) parts.push({ type: 'text', text: split.text })
129
- return parts
112
+ // Replay collects text and image chunks before reconstructing attachments,
113
+ // so inline images can be paired with their descriptions in message order.
114
+ export function replayedUserParts(raw: string, images: readonly Part[] = []): Part[] {
115
+ return replayAttachmentParts([...images, { type: 'text', text: raw }])
130
116
  }
131
117
 
132
118
  export function acpSessionToSessionInfo(entry: AcpSessionListEntry): SessionInfo {
133
119
  const updated = entry.updatedAt ? Date.parse(entry.updatedAt) : NaN
134
120
  return {
135
121
  sessionId: entry.sessionId,
136
- summary: entry.title?.trim() || 'Untitled session',
122
+ summary: formatChatTitle(entry.title?.trim() ?? '') || 'Untitled session',
137
123
  lastModified: Number.isNaN(updated) ? 0 : updated,
138
124
  ...(entry.cwd ? { cwd: entry.cwd } : {})
139
125
  }
@@ -5,7 +5,8 @@ import { type AcpProviderConfig, type AcpSpawnContext } from './session'
5
5
  import { acpSessionToSessionInfo } from './adapter'
6
6
  import { archivedAcpSessions } from './archived'
7
7
  import { getAcpClient, peekAcpClient } from './client'
8
- import type { ListSessionsResponse, AcpModelInfo, AcpModelState, AcpNewSessionResult } from './wire'
8
+ import { clearAcpModelCache, peekAcpModelState, storeAcpModelState } from './model-state'
9
+ import type { ListSessionsResponse, AcpModelState, AcpNewSessionResult } from './wire'
9
10
  import type { WorkspaceActivityPreview } from '../types'
10
11
  import { debug } from '../../debug'
11
12
 
@@ -78,51 +79,47 @@ export async function acpWorkspacePreview(
78
79
  }
79
80
 
80
81
  // The model catalog arrives inline on `session/new`, so there is no standalone
81
- // list RPC. Cache it per workspace: creating a session just to read models is
82
- // wasteful, and an empty session is invisible to `session/list` anyway (agents
83
- // skip zero-history rows).
84
- const modelCatalogs = new Map<string, Promise<AcpModelState | undefined>>()
85
-
86
- export function cacheAcpModelState(workspacePath: string, models: AcpModelState | undefined): void {
87
- if (models?.availableModels?.length) {
88
- modelCatalogs.set(workspacePath, Promise.resolve(models))
89
- }
90
- }
91
-
92
- export function clearAcpModelCache(workspacePath: string): void {
93
- modelCatalogs.delete(workspacePath)
82
+ // list RPC. Read it through the per-workspace cache (./model-state.ts): the
83
+ // first picker snapshot pays for one throwaway session, every chat moi starts
84
+ // afterwards refreshes the cache for free, and a provider fingerprint catches a
85
+ // default changed outside moi in between.
86
+ async function discoverAcpModelState(
87
+ config: AcpProviderConfig,
88
+ ctx: AcpSpawnContext
89
+ ): Promise<AcpModelState | undefined> {
90
+ const client = await getAcpClient(await config.spawn(ctx))
91
+ const created = await client.rpc<AcpNewSessionResult>('session/new', {
92
+ cwd: ctx.workspacePath,
93
+ mcpServers: []
94
+ })
95
+ return created.models ?? undefined
94
96
  }
95
97
 
96
98
  export async function listAcpModels(
97
99
  config: AcpProviderConfig,
98
100
  ctx: AcpSpawnContext
99
101
  ): Promise<Model[]> {
100
- let cached: Promise<AcpModelState | undefined> | undefined = modelCatalogs.get(ctx.workspacePath)
101
- if (!cached) {
102
- cached = (async () => {
103
- const client = await getAcpClient(await config.spawn(ctx))
104
- const created = await client.rpc<AcpNewSessionResult>('session/new', {
105
- cwd: ctx.workspacePath,
106
- mcpServers: []
107
- })
108
- return created.models ?? undefined
109
- })().catch(err => {
110
- modelCatalogs.delete(ctx.workspacePath)
102
+ // Read the fingerprint before the RPC so a change racing the discovery
103
+ // invalidates the next lookup instead of hiding behind a fresher stamp.
104
+ const fingerprint = await config.modelStateFingerprint?.(ctx)
105
+ let state = peekAcpModelState(ctx.workspacePath, fingerprint)
106
+ if (!state) {
107
+ state = discoverAcpModelState(config, ctx).catch(err => {
108
+ clearAcpModelCache(ctx.workspacePath)
111
109
  throw err
112
110
  })
113
- modelCatalogs.set(ctx.workspacePath, cached)
111
+ storeAcpModelState(ctx.workspacePath, state, fingerprint)
114
112
  }
115
113
  const mapModels =
116
114
  config.mapModels ??
117
- ((infos: AcpModelInfo[]): Model[] =>
118
- infos.map(m => ({
115
+ ((modelState: AcpModelState): Model[] =>
116
+ (modelState.availableModels ?? []).map(m => ({
119
117
  value: m.modelId,
120
118
  displayName: m.name ?? m.modelId,
121
119
  ...(m.description ? { description: m.description } : {})
122
120
  })))
123
121
  try {
124
- const state = await cached
125
- return mapModels(state?.availableModels ?? [])
122
+ return mapModels((await state) ?? {})
126
123
  } catch (err) {
127
124
  debug(`${config.id} model catalog failed: ${err instanceof Error ? err.message : String(err)}`)
128
125
  return []
@@ -0,0 +1,57 @@
1
+ // Per-workspace model state (catalog + the backend's own default) for ACP
2
+ // backends. The state only ever arrives inline on `session/new`, so there is
3
+ // no standalone list RPC to poll: creating a session just to read models
4
+ // leaves a zero-history row in the agent's store (Hermes lists them as blank
5
+ // entries in `hermes sessions list`). The cache lets every real chat start
6
+ // keep the picker fresh for free, and a provider fingerprint (Hermes: config
7
+ // file mtimes) invalidates it when the default changes outside moi.
8
+ import type { AcpModelState } from './wire'
9
+
10
+ type Entry = {
11
+ state: Promise<AcpModelState | undefined>
12
+ // Opaque provider-supplied version of the inputs that shape the state. A
13
+ // lookup with a different fingerprint is a miss; `undefined` on either side
14
+ // matches anything, for backends with no external source to track.
15
+ fingerprint?: string
16
+ }
17
+
18
+ const entries = new Map<string, Entry>()
19
+
20
+ export function peekAcpModelState(
21
+ workspacePath: string,
22
+ fingerprint?: string
23
+ ): Promise<AcpModelState | undefined> | undefined {
24
+ const entry = entries.get(workspacePath)
25
+ if (!entry) return undefined
26
+ if (
27
+ fingerprint !== undefined &&
28
+ entry.fingerprint !== undefined &&
29
+ entry.fingerprint !== fingerprint
30
+ )
31
+ return undefined
32
+ return entry.state
33
+ }
34
+
35
+ export function storeAcpModelState(
36
+ workspacePath: string,
37
+ state: Promise<AcpModelState | undefined>,
38
+ fingerprint?: string
39
+ ): void {
40
+ entries.set(workspacePath, { state, fingerprint })
41
+ }
42
+
43
+ // Seed from a `session/new` moi made anyway. Empty catalogs are skipped so a
44
+ // degraded response cannot shadow a good one.
45
+ export function cacheAcpModelState(
46
+ workspacePath: string,
47
+ models: AcpModelState | null | undefined,
48
+ fingerprint?: string
49
+ ): void {
50
+ if (models?.availableModels?.length) {
51
+ storeAcpModelState(workspacePath, Promise.resolve(models), fingerprint)
52
+ }
53
+ }
54
+
55
+ export function clearAcpModelCache(workspacePath: string): void {
56
+ entries.delete(workspacePath)
57
+ }