@scotthuang/agent-knock-knock 0.13.18 → 0.14.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 (289) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/CONTRIBUTING.md +212 -0
  3. package/README.md +106 -166
  4. package/connectors/deepseek-harness/LICENSE +21 -0
  5. package/connectors/deepseek-harness/README.md +406 -0
  6. package/connectors/pi/LICENSE +21 -0
  7. package/connectors/pi/README.md +446 -0
  8. package/dist/src/backend-public-progress.d.ts +38 -0
  9. package/dist/src/backend-public-progress.js +106 -0
  10. package/dist/src/backend-public-progress.js.map +1 -0
  11. package/dist/src/backend-recovery-semantic.d.ts +16 -0
  12. package/dist/src/backend-recovery-semantic.js +113 -0
  13. package/dist/src/backend-recovery-semantic.js.map +1 -0
  14. package/dist/src/backend-task-recovery.d.ts +103 -0
  15. package/dist/src/backend-task-recovery.js +143 -0
  16. package/dist/src/backend-task-recovery.js.map +1 -0
  17. package/dist/src/callback-transport.d.ts +8 -0
  18. package/dist/src/callback-transport.js +14 -0
  19. package/dist/src/callback-transport.js.map +1 -1
  20. package/dist/src/cli-core.js +20 -10
  21. package/dist/src/cli-core.js.map +1 -1
  22. package/dist/src/cli-runtime-context.d.ts +5 -0
  23. package/dist/src/cli-runtime-context.js.map +1 -1
  24. package/dist/src/codex-app-server-read-client.d.ts +3 -0
  25. package/dist/src/codex-app-server-read-client.js.map +1 -1
  26. package/dist/src/codex-native-cli-adapter.d.ts +6 -0
  27. package/dist/src/codex-native-cli-adapter.js +303 -0
  28. package/dist/src/codex-native-cli-adapter.js.map +1 -0
  29. package/dist/src/codex-native-client-interactions.d.ts +6 -0
  30. package/dist/src/codex-native-client-interactions.js +124 -0
  31. package/dist/src/codex-native-client-interactions.js.map +1 -0
  32. package/dist/src/codex-native-client-rpc.d.ts +21 -0
  33. package/dist/src/codex-native-client-rpc.js +137 -0
  34. package/dist/src/codex-native-client-rpc.js.map +1 -0
  35. package/dist/src/codex-native-client.d.ts +42 -0
  36. package/dist/src/codex-native-client.js +331 -0
  37. package/dist/src/codex-native-client.js.map +1 -0
  38. package/dist/src/codex-native-identity.d.ts +6 -0
  39. package/dist/src/codex-native-identity.js +42 -0
  40. package/dist/src/codex-native-identity.js.map +1 -0
  41. package/dist/src/codex-native-monitor.d.ts +4 -0
  42. package/dist/src/codex-native-monitor.js +92 -0
  43. package/dist/src/codex-native-monitor.js.map +1 -0
  44. package/dist/src/codex-native-outbox.d.ts +16 -0
  45. package/dist/src/codex-native-outbox.js +120 -0
  46. package/dist/src/codex-native-outbox.js.map +1 -0
  47. package/dist/src/codex-native-public-projection.d.ts +545 -0
  48. package/dist/src/codex-native-public-projection.js +182 -0
  49. package/dist/src/codex-native-public-projection.js.map +1 -0
  50. package/dist/src/codex-native-record-store.d.ts +27 -0
  51. package/dist/src/codex-native-record-store.js +111 -0
  52. package/dist/src/codex-native-record-store.js.map +1 -0
  53. package/dist/src/codex-native-response-service.d.ts +69 -0
  54. package/dist/src/codex-native-response-service.js +244 -0
  55. package/dist/src/codex-native-response-service.js.map +1 -0
  56. package/dist/src/codex-native-runtime.d.ts +46 -0
  57. package/dist/src/codex-native-runtime.js +112 -0
  58. package/dist/src/codex-native-runtime.js.map +1 -0
  59. package/dist/src/codex-native-semantic.d.ts +17 -0
  60. package/dist/src/codex-native-semantic.js +175 -0
  61. package/dist/src/codex-native-semantic.js.map +1 -0
  62. package/dist/src/codex-native-snapshot.d.ts +19 -0
  63. package/dist/src/codex-native-snapshot.js +160 -0
  64. package/dist/src/codex-native-snapshot.js.map +1 -0
  65. package/dist/src/codex-native-state-store.d.ts +61 -0
  66. package/dist/src/codex-native-state-store.js +132 -0
  67. package/dist/src/codex-native-state-store.js.map +1 -0
  68. package/dist/src/codex-native-task-service.d.ts +71 -0
  69. package/dist/src/codex-native-task-service.js +503 -0
  70. package/dist/src/codex-native-task-service.js.map +1 -0
  71. package/dist/src/codex-native-types.d.ts +92 -0
  72. package/dist/src/codex-native-types.js +15 -0
  73. package/dist/src/codex-native-types.js.map +1 -0
  74. package/dist/src/conversation-list.d.ts +12 -0
  75. package/dist/src/conversation-list.js +30 -0
  76. package/dist/src/conversation-list.js.map +1 -0
  77. package/dist/src/conversation-route-dispatch.d.ts +13 -0
  78. package/dist/src/conversation-route-dispatch.js +66 -0
  79. package/dist/src/conversation-route-dispatch.js.map +1 -0
  80. package/dist/src/conversation-route-legacy.d.ts +18 -0
  81. package/dist/src/conversation-route-legacy.js +54 -0
  82. package/dist/src/conversation-route-legacy.js.map +1 -0
  83. package/dist/src/conversation-route-store.d.ts +51 -0
  84. package/dist/src/conversation-route-store.js +126 -0
  85. package/dist/src/conversation-route-store.js.map +1 -0
  86. package/dist/src/conversation-routing-cli-adapter.d.ts +12 -0
  87. package/dist/src/conversation-routing-cli-adapter.js +211 -0
  88. package/dist/src/conversation-routing-cli-adapter.js.map +1 -0
  89. package/dist/src/conversation-routing-commands.d.ts +11 -0
  90. package/dist/src/conversation-routing-commands.js +85 -0
  91. package/dist/src/conversation-routing-commands.js.map +1 -0
  92. package/dist/src/conversation-routing-home.d.ts +26 -0
  93. package/dist/src/conversation-routing-home.js +105 -0
  94. package/dist/src/conversation-routing-home.js.map +1 -0
  95. package/dist/src/conversation-routing-identity.d.ts +40 -0
  96. package/dist/src/conversation-routing-identity.js +174 -0
  97. package/dist/src/conversation-routing-identity.js.map +1 -0
  98. package/dist/src/conversation-runtime-route-store.d.ts +11 -0
  99. package/dist/src/conversation-runtime-route-store.js +118 -0
  100. package/dist/src/conversation-runtime-route-store.js.map +1 -0
  101. package/dist/src/desktop-async-interactions.d.ts +15 -0
  102. package/dist/src/desktop-async-interactions.js +88 -0
  103. package/dist/src/desktop-async-interactions.js.map +1 -0
  104. package/dist/src/desktop-async-state.d.ts +5 -0
  105. package/dist/src/desktop-async-state.js +53 -0
  106. package/dist/src/desktop-async-state.js.map +1 -0
  107. package/dist/src/desktop-cli-adapter.d.ts +7 -0
  108. package/dist/src/desktop-cli-adapter.js +343 -0
  109. package/dist/src/desktop-cli-adapter.js.map +1 -0
  110. package/dist/src/desktop-cli-controls.d.ts +9 -0
  111. package/dist/src/desktop-cli-controls.js +45 -0
  112. package/dist/src/desktop-cli-controls.js.map +1 -0
  113. package/dist/src/desktop-command-presentation.d.ts +2 -0
  114. package/dist/src/desktop-command-presentation.js +31 -0
  115. package/dist/src/desktop-command-presentation.js.map +1 -0
  116. package/dist/src/desktop-control-semantic.d.ts +8 -0
  117. package/dist/src/desktop-control-semantic.js +68 -0
  118. package/dist/src/desktop-control-semantic.js.map +1 -0
  119. package/dist/src/desktop-identity.d.ts +5 -0
  120. package/dist/src/desktop-identity.js +40 -0
  121. package/dist/src/desktop-identity.js.map +1 -0
  122. package/dist/src/desktop-interaction-projection.d.ts +57 -0
  123. package/dist/src/desktop-interaction-projection.js +196 -0
  124. package/dist/src/desktop-interaction-projection.js.map +1 -0
  125. package/dist/src/desktop-interaction-state.d.ts +3 -0
  126. package/dist/src/desktop-interaction-state.js +48 -0
  127. package/dist/src/desktop-interaction-state.js.map +1 -0
  128. package/dist/src/desktop-ipc-async-answer.d.ts +9 -0
  129. package/dist/src/desktop-ipc-async-answer.js +71 -0
  130. package/dist/src/desktop-ipc-async-answer.js.map +1 -0
  131. package/dist/src/desktop-ipc-client.d.ts +47 -0
  132. package/dist/src/desktop-ipc-client.js +400 -0
  133. package/dist/src/desktop-ipc-client.js.map +1 -0
  134. package/dist/src/desktop-ipc-native-operations.d.ts +11 -0
  135. package/dist/src/desktop-ipc-native-operations.js +126 -0
  136. package/dist/src/desktop-ipc-native-operations.js.map +1 -0
  137. package/dist/src/desktop-ipc-transport.d.ts +13 -0
  138. package/dist/src/desktop-ipc-transport.js +123 -0
  139. package/dist/src/desktop-ipc-transport.js.map +1 -0
  140. package/dist/src/desktop-list.d.ts +25 -0
  141. package/dist/src/desktop-list.js +55 -0
  142. package/dist/src/desktop-list.js.map +1 -0
  143. package/dist/src/desktop-metadata-reader.d.ts +30 -0
  144. package/dist/src/desktop-metadata-reader.js +182 -0
  145. package/dist/src/desktop-metadata-reader.js.map +1 -0
  146. package/dist/src/desktop-monitor.d.ts +4 -0
  147. package/dist/src/desktop-monitor.js +101 -0
  148. package/dist/src/desktop-monitor.js.map +1 -0
  149. package/dist/src/desktop-public-projection.d.ts +6 -0
  150. package/dist/src/desktop-public-projection.js +134 -0
  151. package/dist/src/desktop-public-projection.js.map +1 -0
  152. package/dist/src/desktop-request-interactions.d.ts +14 -0
  153. package/dist/src/desktop-request-interactions.js +144 -0
  154. package/dist/src/desktop-request-interactions.js.map +1 -0
  155. package/dist/src/desktop-response-dispatch.d.ts +14 -0
  156. package/dist/src/desktop-response-dispatch.js +19 -0
  157. package/dist/src/desktop-response-dispatch.js.map +1 -0
  158. package/dist/src/desktop-response-evidence.d.ts +4 -0
  159. package/dist/src/desktop-response-evidence.js +19 -0
  160. package/dist/src/desktop-response-evidence.js.map +1 -0
  161. package/dist/src/desktop-response-service.d.ts +11 -0
  162. package/dist/src/desktop-response-service.js +188 -0
  163. package/dist/src/desktop-response-service.js.map +1 -0
  164. package/dist/src/desktop-response-store.d.ts +35 -0
  165. package/dist/src/desktop-response-store.js +58 -0
  166. package/dist/src/desktop-response-store.js.map +1 -0
  167. package/dist/src/desktop-response-types.d.ts +20 -0
  168. package/dist/src/desktop-response-types.js +2 -0
  169. package/dist/src/desktop-response-types.js.map +1 -0
  170. package/dist/src/desktop-response-value.d.ts +6 -0
  171. package/dist/src/desktop-response-value.js +31 -0
  172. package/dist/src/desktop-response-value.js.map +1 -0
  173. package/dist/src/desktop-runtime.d.ts +153 -0
  174. package/dist/src/desktop-runtime.js +88 -0
  175. package/dist/src/desktop-runtime.js.map +1 -0
  176. package/dist/src/desktop-semantic.d.ts +21 -0
  177. package/dist/src/desktop-semantic.js +140 -0
  178. package/dist/src/desktop-semantic.js.map +1 -0
  179. package/dist/src/desktop-session-catalog.d.ts +68 -0
  180. package/dist/src/desktop-session-catalog.js +225 -0
  181. package/dist/src/desktop-session-catalog.js.map +1 -0
  182. package/dist/src/desktop-session-controls.d.ts +145 -0
  183. package/dist/src/desktop-session-controls.js +176 -0
  184. package/dist/src/desktop-session-controls.js.map +1 -0
  185. package/dist/src/desktop-sidebar-metadata.d.ts +27 -0
  186. package/dist/src/desktop-sidebar-metadata.js +83 -0
  187. package/dist/src/desktop-sidebar-metadata.js.map +1 -0
  188. package/dist/src/desktop-sidebar-projects.d.ts +10 -0
  189. package/dist/src/desktop-sidebar-projects.js +31 -0
  190. package/dist/src/desktop-sidebar-projects.js.map +1 -0
  191. package/dist/src/desktop-sidebar-selection.d.ts +28 -0
  192. package/dist/src/desktop-sidebar-selection.js +85 -0
  193. package/dist/src/desktop-sidebar-selection.js.map +1 -0
  194. package/dist/src/desktop-snapshot-details.d.ts +4 -0
  195. package/dist/src/desktop-snapshot-details.js +116 -0
  196. package/dist/src/desktop-snapshot-details.js.map +1 -0
  197. package/dist/src/desktop-snapshot.d.ts +11 -0
  198. package/dist/src/desktop-snapshot.js +281 -0
  199. package/dist/src/desktop-snapshot.js.map +1 -0
  200. package/dist/src/desktop-state-store.d.ts +72 -0
  201. package/dist/src/desktop-state-store.js +269 -0
  202. package/dist/src/desktop-state-store.js.map +1 -0
  203. package/dist/src/desktop-task-interactions.d.ts +10 -0
  204. package/dist/src/desktop-task-interactions.js +93 -0
  205. package/dist/src/desktop-task-interactions.js.map +1 -0
  206. package/dist/src/desktop-task-recovery.d.ts +38 -0
  207. package/dist/src/desktop-task-recovery.js +172 -0
  208. package/dist/src/desktop-task-recovery.js.map +1 -0
  209. package/dist/src/desktop-task-service.d.ts +54 -0
  210. package/dist/src/desktop-task-service.js +442 -0
  211. package/dist/src/desktop-task-service.js.map +1 -0
  212. package/dist/src/desktop-types.d.ts +283 -0
  213. package/dist/src/desktop-types.js +13 -0
  214. package/dist/src/desktop-types.js.map +1 -0
  215. package/dist/src/host-monitor-reconciliation.js +36 -4
  216. package/dist/src/host-monitor-reconciliation.js.map +1 -1
  217. package/dist/src/host-profile-runtime.js +7 -3
  218. package/dist/src/host-profile-runtime.js.map +1 -1
  219. package/dist/src/local-codex-cli-adapter.d.ts +7 -0
  220. package/dist/src/local-codex-cli-adapter.js +13 -0
  221. package/dist/src/local-codex-cli-adapter.js.map +1 -0
  222. package/dist/src/monitor-deadline-policy.d.ts +8 -0
  223. package/dist/src/monitor-deadline-policy.js +16 -0
  224. package/dist/src/monitor-deadline-policy.js.map +1 -0
  225. package/dist/src/openclaw-callback-transport.js +2 -1
  226. package/dist/src/openclaw-callback-transport.js.map +1 -1
  227. package/dist/src/semantic-conversation-target.d.ts +4 -0
  228. package/dist/src/semantic-conversation-target.js +20 -0
  229. package/dist/src/semantic-conversation-target.js.map +1 -0
  230. package/dist/src/semantic-permission-control.js +47 -9
  231. package/dist/src/semantic-permission-control.js.map +1 -1
  232. package/dist/src/semantic-private-authority-offers.d.ts +1 -1
  233. package/dist/src/semantic-private-authority-offers.js +3 -1
  234. package/dist/src/semantic-private-authority-offers.js.map +1 -1
  235. package/dist/src/semantic-tool-command-helpers.d.ts +6 -0
  236. package/dist/src/semantic-tool-command-helpers.js +199 -78
  237. package/dist/src/semantic-tool-command-helpers.js.map +1 -1
  238. package/dist/src/semantic-tool-descriptions.d.ts +2 -1
  239. package/dist/src/semantic-tool-descriptions.js +84 -35
  240. package/dist/src/semantic-tool-descriptions.js.map +1 -1
  241. package/dist/src/semantic-tool-list-projection.js +66 -2
  242. package/dist/src/semantic-tool-list-projection.js.map +1 -1
  243. package/dist/src/semantic-tool-presentation.js +76 -7
  244. package/dist/src/semantic-tool-presentation.js.map +1 -1
  245. package/dist/src/semantic-tool-runtime.js +129 -29
  246. package/dist/src/semantic-tool-runtime.js.map +1 -1
  247. package/dist/src/semantic-tool-schemas.d.ts +410 -27
  248. package/dist/src/semantic-tool-schemas.js +176 -88
  249. package/dist/src/semantic-tool-schemas.js.map +1 -1
  250. package/dist/src/terminal-action-contracts.js +10 -6
  251. package/dist/src/terminal-action-contracts.js.map +1 -1
  252. package/dist/src/terminal-command-cli-adapter.js +4 -4
  253. package/dist/src/terminal-command-cli-adapter.js.map +1 -1
  254. package/dist/src/terminal-command-dispatch-preparation.js +2 -1
  255. package/dist/src/terminal-command-dispatch-preparation.js.map +1 -1
  256. package/dist/src/terminal-list-cli-adapter.d.ts +1 -0
  257. package/dist/src/terminal-list-cli-adapter.js +6 -3
  258. package/dist/src/terminal-list-cli-adapter.js.map +1 -1
  259. package/dist/src/terminal-monitor-decision-policy.d.ts +1 -1
  260. package/dist/src/terminal-monitor-launch-plan.js +3 -2
  261. package/dist/src/terminal-monitor-launch-plan.js.map +1 -1
  262. package/dist/src/terminal-monitor-supervision-cli-adapter.js +2 -2
  263. package/dist/src/terminal-monitor-supervision-cli-adapter.js.map +1 -1
  264. package/dist/src/terminal-submission-retry-reconciliation.js +2 -2
  265. package/dist/src/terminal-submission-retry-reconciliation.js.map +1 -1
  266. package/dist/src/terminal-user-send-intent.d.ts +2 -0
  267. package/dist/src/terminal-user-send-intent.js +11 -3
  268. package/dist/src/terminal-user-send-intent.js.map +1 -1
  269. package/dist/src/terminal-watch-cli-adapter.js +4 -4
  270. package/dist/src/terminal-watch-cli-adapter.js.map +1 -1
  271. package/docs/architecture/current-architecture.md +313 -0
  272. package/docs/architecture/interactive-terminal-response.md +276 -0
  273. package/docs/architecture/issue-126-final-report.md +248 -0
  274. package/docs/architecture/orchestration-refactor-history.md +2987 -0
  275. package/docs/architecture/orchestration-refactor.md +21 -0
  276. package/docs/backend-task-recovery.md +98 -0
  277. package/docs/bidirectional-agent-protocol.md +260 -0
  278. package/docs/codex-cli-native-compatibility.md +246 -0
  279. package/docs/codex-desktop-compatibility.md +414 -0
  280. package/docs/openclaw-operations.md +281 -0
  281. package/docs/openclaw-session-turn-delivery-requirement.md +45 -0
  282. package/docs/operator-guide.md +572 -0
  283. package/docs/storage-and-logging.md +91 -0
  284. package/docs/test-performance-issue-108.md +80 -0
  285. package/docs/test-performance-issue-120.md +226 -0
  286. package/docs/testing.md +628 -0
  287. package/openclaw.plugin.json +8 -4
  288. package/package.json +6 -13
  289. package/templates/openclaw-skills/agent-knock-knock/SKILL.md +66 -15
@@ -0,0 +1,572 @@
1
+ # AKK Operator Guide
2
+
3
+ This guide covers daily use of existing Codex CLI backend conversations,
4
+ Codex Desktop conversations, and Codex or Claude Code terminals. OpenClaw,
5
+ Pi, DeepSeek Harness, or another compatible Host can act as the controller.
6
+ AKK 0.14.0 introduces the backend and Desktop features described here; see the
7
+ [README](../README.md) for installation. Each connector's pinned runtime
8
+ determines its supported capabilities.
9
+
10
+ Choose the guide for the coding agent you already use:
11
+
12
+ | Existing coding-agent environment | Setup and capability guide |
13
+ | --- | --- |
14
+ | Codex CLI connected to its shared backend | [CLI backend guide](codex-cli-native-compatibility.md); no tmux or Herdr required |
15
+ | Codex Desktop | [Desktop guide](codex-desktop-compatibility.md); keep the intended conversation open in the supported app |
16
+ | Codex or Claude Code in a shared terminal | [tmux quick start](quickstart-tmux.md) or [Herdr quick start](quickstart-herdr.md) |
17
+
18
+ For controller-specific setup, see [OpenClaw operations](openclaw-operations.md),
19
+ the [Pi guide](../connectors/pi/README.md), or the
20
+ [DeepSeek Harness guide](../connectors/deepseek-harness/README.md).
21
+ AKK never launches a hidden replacement coding agent. Human and controller
22
+ continue in the original conversation or shared terminal.
23
+
24
+ Start with AKK List, choose the intended conversation by title and project,
25
+ then use its advertised Send, Status, Watch, or interaction action. Backend
26
+ tools use the returned `conversation_id`; the controller supplies its own
27
+ session identity. Save the task's returned `watch_id` and, for a managed Send,
28
+ its equivalent `turn_id` for follow-up. A project path or title alone is never
29
+ task identity. [Backend task recovery](backend-task-recovery.md) explains how
30
+ to resume observation or release management for that exact task.
31
+
32
+ ## Command reference
33
+
34
+ Direct slash commands are available in every first-party Host integration:
35
+
36
+ | Command | Purpose |
37
+ | --- | --- |
38
+ | `/akk <task>` | Send a task when AKK can prove one unique send-ready terminal. |
39
+ | `/akk <selector>: <message>` | Send to the exact selector returned by the current list. |
40
+ | `/akk list` | Discover conversations, managed work, Watches, and supported actions. |
41
+ | `/akk watch <terminal-id>` | Observe one exact terminal task. |
42
+ | `/akk unwatch <watch-id>` | Stop observation of one terminal or backend Watch without stopping its native task. |
43
+ | `/akk threads <terminal-id>` | List resumable native threads for one terminal. |
44
+ | `/akk models <terminal-id>` | Inspect the current native model and reasoning choices for one exact idle terminal. |
45
+ | `/akk permissions <terminal-id>` | Inspect the exact Codex terminal's native permission choices. |
46
+ | `/akk set-permissions <terminal-id> <advertised-mode-id>` | Apply the selected native permission mode before a task. |
47
+ | `/akk repair-model-control <terminal-id>` | Clear only an exact advertised stale profiled Codex 0.154.0/0.155.1 `/model` Composer surface or open native picker and prove an empty Composer. |
48
+ | `/akk set-model <terminal-id> <model> <reasoning-effort>` | Select one exact tuple from the immediately preceding model catalog. |
49
+ | `/akk new-thread <terminal-id>` | Start a clean native coding-agent thread. |
50
+ | `/akk clear-thread <terminal-id>` | Alias for the same clean-thread lifecycle action. |
51
+ | `/akk resume-thread <terminal-id> [thread]` | Resume one exact native thread. |
52
+ | `/akk status <turn-or-watch>` | Inspect the original managed terminal Turn or backend/terminal Watch. |
53
+ | `/akk respond <turn-id> <answer>` | Answer a question inside the same managed Turn. |
54
+ | `/akk cancel <turn-id>` | Interrupt one exact active managed Turn. |
55
+
56
+ AKK List presents one `conversations[]` collection. It merges terminal/backend
57
+ rows only when their exact current native identities match. A matching project
58
+ or title does not establish that link. Select a conversation and action; AKK
59
+ chooses the supported transport. Bound task and interaction IDs retain their
60
+ original provider, and an uncertain mutation is never retried through another
61
+ transport. The [CLI backend guide](codex-cli-native-compatibility.md#automatic-conversation-routing-2026-10-10)
62
+ describes backend preference and terminal fallback in detail.
63
+
64
+ The terminal-specific commands in the table require a physical terminal;
65
+ Desktop interaction, model, permission, and cancellation controls use their
66
+ advertised semantic tools. Backend and terminal capabilities are distinct.
67
+ Raw CLI output retains provider arrays, including `terminals[]`, for diagnostics.
68
+ Within a terminal row, the optional `managed.current_turn` is active work; `managed.recent_turn` is
69
+ retained history and does not occupy the terminal. Attention-needed records
70
+ whose pane is unavailable appear in `unavailable_managed_turns[]`.
71
+
72
+ Terminal status has three independent evidence axes. `screen_state` describes
73
+ the bounded live TUI (`idle`, `working`, `awaiting_approval`, or `unknown`);
74
+ `native_identity_state` describes foreground native-session resolution
75
+ (`resolved`, `ambiguous`, `verified_absent`, or `unavailable`); and
76
+ `durable_activity_state` describes exact rollout/transcript task evidence
77
+ (`idle`, `working`, or `unknown`). The legacy `activity_state` remains a
78
+ conservative compatibility projection and can therefore be `unknown` while
79
+ `screen_state` is `idle`. These fields are diagnostic; `available_actions`
80
+ remains the authority for tool calls.
81
+
82
+ Human-facing terminal selectors are a slash-command convenience. Terminal
83
+ structured tools use semantic identities: `session_id` for strict continuation, `terminal_id` for
84
+ the currently verified physical terminal, `turn_id` for one managed dispatch,
85
+ `watch_id` for read-only observation, and `native_thread_id` for resume. A
86
+ `session_exact` action targets the continuing native context; a
87
+ `terminal_follow_current` action targets the current verified context in the
88
+ pane. Except for user-intent-first Watch, always use the exact action and
89
+ prefilled semantic IDs from a fresh list.
90
+
91
+ ## Reliable Send
92
+
93
+ Backend Send persists one submission and monitors its original accepted native
94
+ task. Reusing its message ID returns the same record; uncertain submission
95
+ evidence never triggers an automatic resend. See the [CLI backend guide](codex-cli-native-compatibility.md)
96
+ and [Desktop guide](codex-desktop-compatibility.md) for native acceptance and
97
+ interaction capabilities. The remainder of this section covers terminal Send,
98
+ including its physical-input fallback and terminal response adapters.
99
+
100
+ Starting in AKK 0.14.1, new Send monitoring and explicit or
101
+ automatic Watch share a default **720-minute hard deadline**. Explicit request
102
+ parameters override the Host hard-timeout configuration, which overrides that
103
+ default. Save and use the Watch returned by Send; do not add another Watch merely
104
+ to obtain completion callbacks. Expiry ends observation, not the native task.
105
+ Existing saved deadlines and repeated message IDs are not extended by an upgrade.
106
+ Managed terminal inactivity remains a separate 60-minute default.
107
+
108
+ The v30 `action_contracts` expose model-facing semantic IDs only. The trusted
109
+ adapter privately derives and revalidates terminal, process, binding, native
110
+ thread, composer, approval, handoff, revision, and compare-and-swap evidence.
111
+ Callers never supply those opaque fences.
112
+
113
+ A managed Send verifies one terminal and native context, creates one Turn,
114
+ proves exact request acceptance, monitors that Turn, and returns completion or
115
+ attention callbacks to the initiating Host. A completed `turn_id` is history,
116
+ not a destination for another task. A question inside a live Turn uses the
117
+ advertised `respond` action with that Turn's `turn_id`.
118
+
119
+ Native interaction prompts use `respond_interaction`, not ordinary `respond`.
120
+ For a supported pending step, the managed monitor sends an
121
+ `interaction_required` callback to wake the owning controller conversation.
122
+ That callback is notification only and carries no private response authority:
123
+ first obtain the current managed Turn's `interaction_state` from Status in the
124
+ same controller conversation, show that exact step to the user, and submit only
125
+ its advertised semantic question/option IDs or bounded typed text. A blocking
126
+ `questionnaire` does not carry `delivery_mode`. A Codex `async_question`
127
+ coexists with a task that remains `working`; responses default to advertised
128
+ `steer_current_turn` or explicitly select advertised `queue_next_turn`: `steer_current_turn` delivers the answer to that running turn,
129
+ while `queue_next_turn` queues it for the next turn. One call resolves one
130
+ current step; the monitor notifies the next supported step when it appears.
131
+ Status remains the manual refresh fallback. Never submit raw keys, shortcut
132
+ chords, or menu indexes, and never respond to `manual_required`, expired,
133
+ changed, secret-bearing, or uncertain state. Codex 0.154.0 and 0.155.1 use
134
+ version-bound TUI execution; main-only notification and stable-question-ID
135
+ wrappers added after 0.155.1 are not assumed to exist in either release.
136
+
137
+ The initial async adapter accepts at most four fully visible suggestions plus
138
+ native Other, and custom answers must be a short, fully visible single line
139
+ without leading/trailing whitespace. Wrapped or clipped input cannot prove the
140
+ postcondition and stops without a submit key. Codex's own collapsed-question
141
+ timer still applies: AKK does not keep a question alive or reopen an expired
142
+ one. Refresh Status before responding; an absent question is not retryable.
143
+
144
+ The user-priority `terminal_user_explicit` path requires one exact live
145
+ physical terminal/process, a scanned non-blocked approval state, and no proven
146
+ input-owning questionnaire, editor, menu, or read-only viewer. Broken AKK Turn,
147
+ Session, transfer, transition, ledger, or Store state cannot veto the user's
148
+ explicit Send. Neither can parsed working activity, an existing draft, or
149
+ ordinary Composer visibility, stability, or exactness. Codex physical fallback
150
+ sends `C-u` once. Claude Code physical fallback uses a sentinel-backed native
151
+ `C-s` stash-clear transaction that is independent of the cursor position and
152
+ does not interrupt an active turn, then proves the main Composer empty. Each
153
+ then injects the new request,
154
+ waits through the paste window, and dispatches Enter exactly once. After text
155
+ injection, Composer observation cannot veto Enter. Unreviewed Codex fullscreen
156
+ frontends additionally require a recognizable styled Composer before clearing
157
+ and a fresh empty Composer afterward, before any task text is sent.
158
+
159
+ AKK first takes the managed path where its stronger pre-input requirements
160
+ hold. Otherwise it may deliver unmanaged work once and best-effort attaches a
161
+ Terminal Watch that provides the completion callback. Exact preparation failure falls back to a request-correlated terminal-activity
162
+ Watch when the physical identity and observation path remain valid. Its callback
163
+ reports stable idle with best-effort confidence, never exact task success.
164
+ Watch persistence failure never vetoes, revokes, or retries a successful
165
+ Send. Uncertain native probe input or unsafe input surfaces stop before task
166
+ text; they do not authorize this fallback. If clear or request input may have occurred and terminal
167
+ delivery or native acceptance is uncertain, AKK does not retry automatically;
168
+ inspect Status, the exact pane, or the returned Watch instead.
169
+
170
+ On first attach, the target terminal must be explicitly named by the user. AKK
171
+ never guesses which already-running pane should receive the task. An omitted
172
+ target is allowed only when AKK can prove one unique eligible terminal.
173
+
174
+ ### Codex candidate attribution
175
+
176
+ The human-priority Codex path also covers a status-card-only Session, a
177
+ quiescent managed pane whose foreground rollout cannot be selected, and a
178
+ supported manual `/clear` whose new logical thread appears before its rollout
179
+ materializes. The complete exact inventory domain binds the provider terminal,
180
+ PID and process birth, workspace and canonical endpoint, and every open
181
+ rollout's UUID, descriptor, device, inode, canonical path, and
182
+ pre-submit byte offset. A `/clear` resume hint is advisory only, never routing or acceptance
183
+ authority.
184
+
185
+ Under the terminal lock, AKK isolates the predecessor, creates a separate
186
+ zero-UUID provisional Session and Turn, sends the real request once, and binds
187
+ only the single rollout that proves exact request acceptance. A rollout-backed
188
+ Codex row therefore advertises `terminal_follow_current`, not `session_exact`;
189
+ a cached or direct `session_exact` attempt rejects before task text and never
190
+ downgrades itself. Only released predecessor Turn history from an earlier
191
+ binding epoch is excluded from current authority. Use only the freshly listed
192
+ semantic-ID action.
193
+
194
+ Until promotion commits, strict `session_id` send, `respond`, managed
195
+ `approve`, `cancel`, native lifecycle, callback delivery, and `native_inspect`
196
+ remain unavailable. This provisional path can still work in a narrow pane
197
+ because it binds from acceptance rather than automating native `/status`.
198
+
199
+ ### Explicit Codex foreground identification
200
+
201
+ When a recent `/clear` has not yet materialized a rollout, or several open
202
+ rollouts make `native_identity_state="ambiguous"`, a fresh List may advertise
203
+ two Codex-only actions. `identify_foreground({terminal_id})` holds the exact
204
+ terminal lock and sends the closed `/status` probe exactly once, but performs
205
+ no Store mutation and creates no Session, Turn, receipt, monitor, or callback.
206
+ The returned proof expires after 30 seconds and is diagnostic only: it cannot
207
+ authorize Send, approval, native-interaction response, lifecycle input, or a later
208
+ binding after the lock is released.
209
+
210
+ `identify_and_send({terminal_id,request})` is the actionable atomic form. It
211
+ keeps one terminal lock from foreground identification through the one task
212
+ dispatch. The status UUID is provisional; only one rollout that later accepts
213
+ the exact request can become durable Session/Turn identity. A changed or
214
+ uncertain probe boundary stops before the task and is not retried
215
+ automatically. This optional enhancement is not a prerequisite for ordinary
216
+ human Send: ordinary Send retains its user-priority behavior. Codex 0.158.0/0.159.0/0.159.2
217
+ exact Send and active-task Watch use a separate closed `/status` transaction
218
+ to bind the foreground paginated thread. List never types an identity probe.
219
+ Status for an exact backend task does not use terminal input. A targeted
220
+ conversation Status for an unbound, idle Codex terminal may use the separate
221
+ closed routing inspection described under [Status](#akk-status-and-native-inspection).
222
+
223
+ ## Terminal Watch
224
+
225
+ The [terminal handoff demo](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/assets/akk-tmux-handoff-demo.mp4)
226
+ shows OpenClaw giving Claude Code a task and handing its result to Codex
227
+ through tmux; both terminals remain available for direct human use.
228
+
229
+ Watch follows the exact terminal selected by the user. Codex 0.158.0/0.159.0/0.159.2 exact
230
+ Watch creation types a closed `/status` command into an available main Composer;
231
+ subsequent observation is read-only. Newer Codex versions may use the same
232
+ strict observed UI and paginated read contracts. See the
233
+ [upgrade compatibility policy](callback-compatibility.md).
234
+
235
+ ```text
236
+ /akk list
237
+ /akk watch <exact-terminal-id>
238
+ /akk status <watch-id>
239
+ /akk unwatch <watch-id>
240
+ ```
241
+
242
+ The fresh list is the safest way to copy a complete `terminal_id`, but missing
243
+ Watch advertisement, coding-agent version uncertainty, unusable task artifacts,
244
+ or existing managed ownership are warnings rather than authorization vetoes.
245
+ Watch fails only when the exact terminal/process cannot be identified, neither
246
+ an exact task anchor nor a read-only terminal-activity path exists, or the
247
+ durable Watch record cannot be created.
248
+
249
+ An exact provider anchor produces `watch_mode="exact_task"` and
250
+ `confidence="exact"`. Without one, AKK can use
251
+ `watch_mode="terminal_activity"` and `confidence="best_effort"`: it must first
252
+ observe working or approval activity and then stable idle. That callback proves
253
+ only that the observed activity became idle, not that one uniquely identified
254
+ task succeeded, and it contains no exact-task completion text.
255
+
256
+ After initial Codex foreground binding, Watch observation sends no terminal
257
+ input and does not adopt, reserve, block, interrupt,
258
+ approve, or own the selected task. Manual-Watch approval events are
259
+ notification-only and never participate in auto-approval. Durable Watch state,
260
+ notification identities, and callback outboxes make restart recovery
261
+ idempotent. A managed Turn monitor remains preferable when exact Turn
262
+ attribution already exists.
263
+
264
+ ## Sessions, Turns, and native threads
265
+
266
+ For terminal-managed work, AKK keeps these identities separate:
267
+
268
+ ```text
269
+ tmux or Herdr terminal / verified process incarnation
270
+ ├─ native Codex or Claude Code session
271
+ │ └─ AKK Session (session_id)
272
+ │ ├─ Turn (turn_id)
273
+ │ └─ Turn (turn_id)
274
+ └─ Terminal Watch (watch_id)
275
+ ```
276
+
277
+ Backend Send instead returns one persisted task ID as both `watch_id` and
278
+ `turn_id`; a standalone backend Watch has no Send management. These task IDs
279
+ stay bound to the original thread and native task. They do not authorize the
280
+ terminal lifecycle commands below.
281
+
282
+ New and resume are native lifecycle transitions. They create or activate an
283
+ AKK Session but create no Turn. Run `/akk threads <exact-terminal-id>` to get
284
+ the current candidates. The output includes deterministic numbers,
285
+ collision-safe display-only short IDs, and each complete native thread UUID.
286
+ The number and short-ID resume forms belong only to that displayed snapshot;
287
+ neither is a durable identity or model authority. They expire after five
288
+ minutes and after terminal, process, workspace, binding, candidate-set, or
289
+ relevant action changes.
290
+
291
+ `previous` is advertised only when the current Session's latest committed
292
+ transition and fresh discovery prove exactly one resumable source. If
293
+ `previous` is present, use only its exact prefilled semantic-ID action for a
294
+ natural-language “刚才那个” request. Never substitute the newest terminal row.
295
+
296
+ Do not ask AKK to send `/clear`, `/new`, `/resume`, `/status`, Codex `/fork`,
297
+ `/side`, `/btw`, Claude `/branch`, or another first-line native slash command
298
+ as an ordinary task. Use the advertised lifecycle, native-inspection, or
299
+ Codex foreground-identification action, express the outcome in natural
300
+ language, or type an unsupported command directly in the TUI. AKK revalidates
301
+ the entire candidate snapshot before terminal input; candidate-set changes
302
+ fail closed. A replaced or changed transcript/rollout cannot be resumed under
303
+ stale metadata.
304
+
305
+ ## Permission settings
306
+
307
+ Send preserves the selected conversation's existing permission mode. Use an
308
+ explicit advertised permission action to change it before sending a task.
309
+ The [CLI backend](codex-cli-native-compatibility.md) and
310
+ [Desktop](codex-desktop-compatibility.md#settings-and-cancellation) adapters
311
+ apply and verify the selected conversation's native settings. For a Codex
312
+ terminal, [Codex permissions](codex-permissions.md) covers the current native
313
+ choices and exact idle-terminal checks. Full Access is an explicit supported
314
+ choice; AKK handles its native confirmation without an additional prompt.
315
+
316
+ ## Safe model control
317
+
318
+ This section describes terminal model control. Desktop settings use the
319
+ [Desktop settings API](codex-desktop-compatibility.md#settings-and-cancellation)
320
+ and do not expose a model catalog; they accept an explicitly requested model
321
+ and effort. The direct CLI backend has no equivalent native model operation.
322
+ Use only the provider capability advertised by the selected conversation.
323
+
324
+ Model control is a two-step, current-snapshot operation. Start from a fresh
325
+ `/akk list`, copy one complete `terminal_id` whose row advertises
326
+ `available_actions.model_options`, then run:
327
+
328
+ ```text
329
+ /akk models <exact-terminal-id>
330
+ /akk set-model <exact-terminal-id> <advertised-model-id> <advertised-reasoning-effort>
331
+ ```
332
+
333
+ The first command opens and closes the agent's native model UI as one bounded
334
+ inspection. It returns the effective model, the semantic model IDs currently
335
+ available to that account and runtime, and each model's available reasoning
336
+ efforts. This is dynamic authority, not a static AKK allowlist: copy one exact
337
+ model ID and one exact reasoning value from that result. Both values are
338
+ required; an omitted, invented, or unadvertised effort fails before native
339
+ model-selection input. The structured postcondition remains authoritative
340
+ about the effective tuple.
341
+
342
+ The matching OpenClaw tools are
343
+ `agent_knock_knock_model_options({terminal_id})` and
344
+ `agent_knock_knock_set_model({terminal_id,model,reasoning_effort})`. The
345
+ options result and its private physical-terminal/catalog authority belong to the
346
+ same controller
347
+ conversation and are consumed by one set-model attempt. Relist after any pane,
348
+ process, catalog, or UI change, or after any failed attempt.
349
+ Neither tool accepts a slash command, raw key, menu index, display label,
350
+ scope override, token, or fingerprint.
351
+
352
+ If a failed profiled Codex 0.154.0/0.155.1 attempt leaves an exact `/model` popup or an
353
+ exact bare `/model` Composer, List may advertise both
354
+ `model_options({terminal_id})` and `repair_model_control({terminal_id})`.
355
+ The former uses separate residual-bound authority to continue that exact slash
356
+ command into read-only catalog discovery without retyping it. The latter is the
357
+ cleanup-only alternative; its equivalent human command is
358
+ `/akk repair-model-control <exact-terminal-id>`. It accepts only the terminal
359
+ ID and privately revalidates the pane, process, residue, approval state, and
360
+ absence of an active Turn before every reversible cleanup input. It never
361
+ presses Enter, selects a model, submits a task, or handles an approval or
362
+ questionnaire. Success requires an exactly empty Composer. An uncertain
363
+ continuation or repair is not retryable.
364
+
365
+ If the exact native model picker is already open, List projects the terminal
366
+ as non-idle and advertises only `repair_model_control`. That repair may dismiss
367
+ the exact picker but never receives authority to press Enter.
368
+
369
+ Both steps use explicit current-snapshot authority for the same exact physical
370
+ terminal and coding-agent process. Profiled Codex 0.154.0/0.155.1 may use either one exact current
371
+ native Session or a verified-zero-rollout pane, and the Codex-only
372
+ `identify_foreground` diagnostic is not a prerequisite. Claude Code still
373
+ requires one exact current native Session. The pane
374
+ must remain safely idle with an exactly empty Composer, except for the exact
375
+ Codex residual continuation described above. An active Turn, working
376
+ agent, approval, questionnaire or editor, read-only viewer, non-empty Composer,
377
+ ambiguous or multi-rollout Codex identity, stale physical snapshot, unsupported
378
+ version, or changed catalog fails closed
379
+ with no model-selection input. The private multi-step native sequence
380
+ revalidates each frame and must return to the main Composer without submitting
381
+ a task or answering a prompt.
382
+
383
+ Provider scope is explicit in both results:
384
+
385
+ - Codex reports `scope="current_and_new_sessions"`. Its native model flow
386
+ changes this session and persists the selected model as the default for
387
+ future Codex sessions. Ordinary reasoning efforts through `max` are also
388
+ persisted. Codex treats `ultra` specially: it is effective only in the
389
+ current session, while the future-session effort falls back to a non-Ultra
390
+ value. The scope label therefore does not claim that Ultra itself persists.
391
+ These are intentional, visible side effects of the approved native
392
+ operation; AKK does not edit `~/.codex/config.toml` directly or restore it
393
+ afterward.
394
+ - Claude Code reports `scope="current_session"`. Its native session-only path
395
+ changes the open session and leaves new-session defaults unchanged.
396
+
397
+ A successful result is `changed` or `already_effective` and reports the
398
+ current session under `effective`, the future Codex defaults under
399
+ `new_session_defaults`, and whether they changed under `defaults_changed`.
400
+ For an Ultra request, expect `effective.reasoning_effort="ultra"` and only the
401
+ persisted model in `new_session_defaults`. The native TUI does not expose the
402
+ exact non-Ultra effort it chooses for new sessions, so AKK omits that field
403
+ rather than guessing; never infer that Ultra became a future default from
404
+ `scope="current_and_new_sessions"` alone.
405
+ `outcome="uncertain"` means native input may have taken effect but AKK could
406
+ not prove the final state. It carries `do_not_retry=true`: inspect the shared
407
+ pane, then obtain a new model catalog before any deliberate new attempt. Model
408
+ control creates no AKK Turn and never approves, answers, or submits coding
409
+ work.
410
+
411
+ ## AKK Status and native inspection
412
+
413
+ Status follows its target. An exact backend task's `watch_id` or Send-produced
414
+ `turn_id` reads that original backend's native state without terminal input.
415
+ A backend conversation Status reads the selected native conversation. Bound
416
+ terminal Turns and Watches retain their original observation route. List
417
+ never types into a terminal.
418
+
419
+ AKK 0.14.1 adds a single `progress` object to CLI
420
+ backend and Desktop Status. Conversation Status selects its current native turn;
421
+ Watch Status always selects the Watch's original turn, even after a newer task
422
+ starts. The latest public commentary and up to two short action type/status
423
+ summaries share an 800-Unicode-code-point body budget, with unused space shared
424
+ between them. Redaction precedes truncation, which preserves complete graphemes.
425
+ Reasoning, analysis, raw command output, tool arguments and diffs are excluded.
426
+ This is a progress-body limit, not a limit on the whole Status JSON. List does not
427
+ include this body, and the terminal screen contract is unchanged.
428
+
429
+ `progress.native_turn_id` identifies the selected task; `read_at` records the
430
+ read time. `latest_item_at` is a native timestamp of the displayed progress, or
431
+ `null` if none is available; it is never replaced with the read time. `truncated`
432
+ reports shortening of the selected progress body or omission of code blocks. `state: "no_public_progress"` means the read
433
+ succeeded without eligible public progress, while `state: "read_error"` means
434
+ the exact task/items could not be read completely. Neither means the task has
435
+ stopped. Missing old-turn data is never replaced with a successor's progress.
436
+ `trace` retains its existing terminal behavior; it is not an unbounded backend
437
+ progress mode. Final answers and current questions/approvals retain their own
438
+ existing fields.
439
+
440
+ When the selected conversation is an unbound physical Codex terminal, targeted
441
+ Status may use the existing closed `/status` identity inspection if that pane
442
+ is safely idle. It can display a native status card to establish the exact
443
+ backend thread. It does not create a task or disturb a working or blocked
444
+ terminal. This routing inspection is separate from the diagnostic-only
445
+ `identify_foreground` action; see [automatic conversation routing](codex-cli-native-compatibility.md#automatic-conversation-routing-2026-10-10).
446
+
447
+ Explicit native inspection remains a closed action:
448
+ `native_inspect({terminal_id,inspection:"status"})`. It accepts no arbitrary
449
+ command and creates no AKK Turn, Session, receipt, monitor, or callback.
450
+
451
+ Native inspection and foreground identification are different contracts.
452
+ `native_inspect` inspects an already attributable native context. The explicit
453
+ Codex-only `identify_foreground` action is available for an otherwise safe but
454
+ ambiguous foreground and returns only the 30-second non-authorizing diagnostic
455
+ described above. `identify_and_send` consumes its observation without
456
+ releasing the terminal lock; callers must never cache a standalone proof and
457
+ use it as authority for a later action.
458
+
459
+ Codex native `/status` inspection requires an exact viewport of at least 80
460
+ columns so the complete UUID can be proven. Legacy terminal-scoped tasks
461
+ can bind from exact native acceptance afterward without running `/status` or
462
+ failing merely because the pane is narrow. Codex paginated read-contract candidates attempt a separate
463
+ closed `/status` binding before physical Send. If an exact callback Watch cannot
464
+ be prepared safely, AKK may prepare terminal-activity observation; the receipt states the actual mode and limitation. Claude inspection must prove,
465
+ parse, and dismiss one fresh Status panel and return to the same idle composer.
466
+ Other complete `x.y.z` agent versions remain callable with a compatibility
467
+ warning; incompatible runtime behavior fails or becomes uncertain rather than
468
+ being blocked by a version allowlist.
469
+
470
+ ## Approval boundaries
471
+
472
+ Approval always requires the current exact prompt and explicit human intent.
473
+ Backend approvals use the exact pending interaction from fresh Status in the
474
+ same controller conversation. See the [CLI backend](codex-cli-native-compatibility.md)
475
+ and [Desktop interaction](codex-desktop-compatibility.md) guides. The prompt,
476
+ screen, and key boundaries below describe terminal approval.
477
+
478
+ Managed approval uses `approve({turn_id})`; terminal-scoped manual Codex
479
+ approval uses `approve({terminal_id})` when the current list advertises it.
480
+ On an unmanaged raw-terminal row, that action is prefilled with its exact
481
+ `terminal_id`; never construct or guess the target.
482
+
483
+ The private approval fence is prompt-scoped. It binds the adapter-isolated
484
+ exact unredacted approval region, terminal/process identity, decision keys,
485
+ prompt kind, working directory, reason, and request evidence. The whole-screen
486
+ digest and redacted excerpt are diagnostic only: output outside the approval
487
+ region may keep scrolling without invalidating the same prompt. Any change
488
+ inside the exact region—including a command or an otherwise identically
489
+ redacted secret—rejects and sends zero approval keys.
490
+
491
+ Terminal-scoped approval leaves Session and Turn identity unchanged, is never
492
+ available to auto-approve, and must not be retried blindly after an uncertain
493
+ transport result. Unsupported, stale, changed, ambiguous, or ownership-drifted
494
+ prompts remain for the human to resolve in the coding-agent TUI. OpenClaw's
495
+ optional exact-command auto-approval policy is documented separately in
496
+ [OpenClaw operations](openclaw-operations.md#automatic-approval).
497
+
498
+ ## Recovery and advanced controls
499
+
500
+ Recovery is specific to the provider and original task. Use its exact saved ID
501
+ and the applicable actions below; do not substitute the latest conversation.
502
+
503
+ ### Backend task recovery
504
+
505
+ For Codex CLI backend and Desktop tasks, use the original task's `watch_id`
506
+ from the originating controller; Recover, Renew, Close, and Retry Callback
507
+ also accept its Send-produced `turn_id`. `recover` reconciles
508
+ the original task and supervises eligible monitor work; `renew` verifies that
509
+ task before extending observation. `unwatch` stops observation while retaining
510
+ Send management, and `close` releases managed Send ownership without stopping
511
+ Codex. A standalone Watch uses Unwatch. `retry_callback` retries only a known
512
+ retryable notification with its original identity; select `notification_id`
513
+ when more than one is eligible.
514
+
515
+ These operations never select the latest task or fall back to a terminal.
516
+ Closed management cannot be reopened, and Recover does not extend deadlines
517
+ or resume an explicitly stopped Watch. For exact inputs, callback uncertainty,
518
+ and observation semantics, use the [backend task recovery reference](backend-task-recovery.md).
519
+
520
+ ### Terminal recovery and diagnostics
521
+
522
+ The following terminal controls remain available when the corresponding
523
+ state makes them meaningful. `reconcile_binding`, `identify_foreground`, and
524
+ `repair_model_control` retain their physical-terminal requirements; backend
525
+ Recover does not replace them.
526
+
527
+ | Command | Use |
528
+ | --- | --- |
529
+ | `/akk doctor` | Diagnose installation, Host, terminal, and coding-agent readiness. |
530
+ | `/akk models <terminal>` | Inspect one idle pane's exact native model and reasoning catalog. |
531
+ | `/akk repair-model-control <terminal>` | Clear one exact List-advertised stale Codex `/model` surface; never submit it. |
532
+ | `/akk set-model <terminal> <model> <effort>` | Consume that catalog once; Codex reports current and future defaults separately (Ultra stays current-only), while Claude Code is session-only. |
533
+ | `/akk approve <turn-or-terminal>` | Approve one current prompt after explicit review. |
534
+ | `/akk renew <turn> <minutes>` | Restart monitoring for one still-live stalled Turn without terminal input. |
535
+ | `/akk retry-callback <turn>` | Retry one persisted failed callback with its original identity. |
536
+ | `/akk close <turn>` | Ordinary managed-Turn Close releases AKK management without terminal input or stopping the coding agent; native lifecycle recovery has the exception below. |
537
+
538
+ Explicit terminal Close is the user's management escape hatch. It has priority over
539
+ broken deferred-transfer or handoff state, closes the selected Turn first, and
540
+ then best-effort releases only linked AKK metadata. Refresh List afterward; if
541
+ the agent is still working, a new Watch can observe it.
542
+
543
+ Closing an uncertain native new/resume transition is a separate recovery path:
544
+ it may clear an unsubmitted Composer and perform a guarded `/status` inspection
545
+ to establish the actual native identity. Follow that exact advertised recovery
546
+ action. Do not treat every terminal Close variant as a record-only operation.
547
+
548
+ An uncertain terminal mutation is not a retry instruction. Do not resend,
549
+ approve, cancel, or repeat Enter blindly. Inspect the exact pane and durable
550
+ Status, then use only the action currently advertised by AKK.
551
+
552
+ ## Structured tool surface
553
+
554
+ The OpenClaw plugin and Host Adapter register the ordered semantic tool catalog.
555
+ Pi and DeepSeek Harness verify the Host Adapter capability handshake against
556
+ their actual registrations, so the tool count and names are derived from that
557
+ catalog rather than maintained as connector constants. The current catalog
558
+ includes list, watch, unwatch, list resumable threads, native inspect, model
559
+ options, repair model control, set model, permission options, set permissions,
560
+ identify foreground, identify and send, new thread, reconcile binding, resume
561
+ thread, status, send, respond, typed native interaction response, approve,
562
+ renew, recover, retry callback, cancel, and close. Model-facing mutations
563
+ contain semantic IDs and user content only.
564
+ Connector prereleases that pin an earlier AKK runtime retain the tool surface
565
+ documented by that connector release.
566
+ Selectors, pane routes, draft text, fingerprints, tokens, revisions, candidate
567
+ fences, and binding generations stay inside the trusted Host adapter.
568
+
569
+ For the full lifecycle, callback, identity, handoff, and persistence contract,
570
+ see the [Terminal Handoff Protocol](bidirectional-agent-protocol.md). For
571
+ configuration and recovery specific to OpenClaw, see
572
+ [OpenClaw Operations](openclaw-operations.md).
@@ -0,0 +1,91 @@
1
+ # Storage and Logging
2
+
3
+ AKK keeps managed state in `~/.agent-knock-knock/store` by default. The Store
4
+ contains its compatibility manifest, authoritative Sessions and Turns,
5
+ independent Terminal Watch records, dispatch receipts, callback outboxes, and
6
+ event logs. It may therefore contain terminal and task metadata and should
7
+ remain private.
8
+
9
+ ## Filesystem safety
10
+
11
+ - Store directories use mode `0700`.
12
+ - State and event-log files use mode `0600`.
13
+ - Durable JSON writes are atomic and do not follow symbolic-link targets.
14
+ - A custom Store must be a dedicated directory. AKK refuses a non-empty
15
+ manifestless directory rather than adopting unknown files.
16
+ - The Store manifest fences incompatible managed writers before managed
17
+ terminal or callback mutations. An eligible explicit physical Send retains
18
+ its separate runtime receipt and input-safety checks; it cannot mutate an
19
+ incompatible managed Store.
20
+
21
+ ## Compatibility manifest
22
+
23
+ The manifest checks storage format and writer behavior separately. An unknown
24
+ `format_version` is not read. The current writer protocol is 9; writer
25
+ protocols 1 through 8 are supported predecessors and inspection reports them
26
+ as `upgradeable`.
27
+
28
+ Upgrading protocol 1 or 2 validates predecessor Turn records,
29
+ deterministically derives and durably materializes authoritative Session
30
+ records, quarantines ambiguous Session bindings, and finishes by atomically
31
+ publishing protocol 9. Existing Turn state, event logs, and the original
32
+ manifest `created_at` remain unchanged.
33
+
34
+ Protocols 3 through 8 already have Session authority, so their upgrade is an
35
+ atomic manifest-only writer fence with no data migration. Protocol 6 prevents
36
+ older writers from rejecting or damaging schema-v2 Terminal Watch records.
37
+ Protocol 7 fences the `interaction_manual_required` notification kind from
38
+ protocol-6 writers. Protocol 8 protects paginated task anchors and private
39
+ multi-question checkpoints from older writers. Terminal Watch schema v3 separately adds interaction
40
+ policy, subject-aware projection, one-shot reservation, and callback-outbox
41
+ state; its version fence makes older strict Watch decoders reject the record
42
+ instead of rewriting unknown authority. Legacy schema-v1/v2 Watches are
43
+ normalized to `notify_only`; they never silently acquire terminal response
44
+ authority. Downgrading after v3 records exist is not supported. Core
45
+ Session/Turn data remains readable across a writer-protocol mismatch, while
46
+ explicit reconciliation reports `skipped` and managed mutations fail before
47
+ terminal or Host side effects. This does not prohibit an independently
48
+ authorized physical Send that leaves managed state untouched.
49
+
50
+ ## Conversation routing journal
51
+
52
+ Backend-first Send records its chosen provider before task delivery. These
53
+ records live under the private runtime directory (`~/.agent-knock-knock/runtime-v2`
54
+ by default, or `AKK_RUNTIME_DIR`), in `conversation-routing/<store-path-hash>/state`.
55
+ They have their own locks and compatibility manifest; they do not acquire the
56
+ managed Store's writer lock. A reused message ID stays on its original provider,
57
+ even if another route becomes available later.
58
+
59
+ Development builds that wrote these records under the managed Store are read
60
+ without modifying the old records. Their original route and any recorded outcome
61
+ remain authoritative; conflicting journals stop the request. A replayed receipt
62
+ is the original submission observation. Query Status for current task state.
63
+
64
+ ## Legacy directory
65
+
66
+ The former `~/.agent-knock-knock/conversations` directory is left untouched.
67
+ AKK does not read or migrate it. Existing Codex and Claude Code terminals remain
68
+ discoverable, but legacy managed-turn IDs, callback associations, and old
69
+ conversation aliases are not imported into the stable Store.
70
+
71
+ ## Logs and retention
72
+
73
+ Runtime logs redact common secret forms and default to 14-day retention. The
74
+ main controls are:
75
+
76
+ | Control | Purpose |
77
+ | --- | --- |
78
+ | `--store-dir` | Use a dedicated Store for standalone CLI operations. |
79
+ | `AKK_LOG_DIR` | Select a dedicated runtime log directory. |
80
+ | `AKK_LOG_LEVEL` | Set the emitted log level. |
81
+ | `AKK_LOG_RETENTION_DAYS` | Change the retention window. |
82
+
83
+ Do not point a custom Store or log directory at a broad home, workspace, or
84
+ shared directory. Review retained callback and terminal data before any manual
85
+ cleanup. AKK does not delete coding-agent transcripts, Codex rollouts, tmux or
86
+ Herdr sessions, or model credentials.
87
+
88
+ OpenClaw-specific `storeDir` configuration and operational diagnostics are in
89
+ [OpenClaw Operations](openclaw-operations.md). The full Session, Turn, Watch,
90
+ and callback identity contract is in the
91
+ [Terminal Handoff Protocol](bidirectional-agent-protocol.md).