@fitchmultz/pi-subagents 0.44.7 → 0.45.0

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 (947) hide show
  1. package/CHANGELOG.md +258 -7
  2. package/LICENSE +1 -0
  3. package/README.md +58 -1483
  4. package/agents/context-builder.md +19 -1
  5. package/agents/debugger.md +10 -3
  6. package/agents/delegate.md +1 -0
  7. package/agents/fixer.md +4 -1
  8. package/agents/oracle.md +13 -2
  9. package/agents/planner.md +14 -3
  10. package/agents/researcher.md +11 -2
  11. package/agents/reviewer-claude.md +11 -2
  12. package/agents/reviewer-gpt.md +12 -2
  13. package/agents/reviewer-ponytail.md +11 -1
  14. package/agents/reviewer-security.md +13 -2
  15. package/agents/reviewer.md +12 -3
  16. package/agents/scout.md +12 -1
  17. package/agents/ui-designer.md +10 -3
  18. package/agents/watcher.md +1 -0
  19. package/agents/worker.md +8 -2
  20. package/agents/writer.md +6 -3
  21. package/dist/agents/agent-defaults.js +9 -0
  22. package/dist/agents/agent-definition.js +196 -0
  23. package/dist/agents/agent-management.js +64 -905
  24. package/dist/agents/agent-scope.js +4 -2
  25. package/dist/agents/agent-selection.js +10 -5
  26. package/dist/agents/agent-serializer.js +55 -67
  27. package/dist/agents/agents.js +75 -716
  28. package/dist/agents/builtin-overrides.js +218 -0
  29. package/dist/agents/chain-serializer.js +3 -367
  30. package/dist/agents/config-values.js +52 -0
  31. package/dist/agents/discovery-paths.js +91 -0
  32. package/dist/agents/frontmatter.js +15 -5
  33. package/dist/agents/identity.js +25 -8
  34. package/dist/agents/json-chain.js +254 -0
  35. package/dist/agents/management-config.js +332 -0
  36. package/dist/agents/management-format.js +231 -0
  37. package/dist/agents/management-persistence.js +287 -0
  38. package/dist/agents/management-targets.js +136 -0
  39. package/dist/agents/management-warnings.js +81 -0
  40. package/dist/agents/markdown-chain.js +210 -0
  41. package/dist/agents/package-agents.js +154 -0
  42. package/dist/agents/skill-files.js +157 -0
  43. package/dist/agents/skill-search-paths.js +246 -0
  44. package/dist/agents/skill-types.js +1 -0
  45. package/dist/agents/skills.js +54 -499
  46. package/dist/extension/acceptance-schema.js +55 -0
  47. package/dist/extension/build-info.js +1 -1
  48. package/dist/extension/chain-schema.js +196 -0
  49. package/dist/extension/child-runtime.js +237 -0
  50. package/dist/extension/compact-tools.js +122 -51
  51. package/dist/extension/config-schema.js +29 -0
  52. package/dist/extension/config.js +27 -11
  53. package/dist/extension/control-notice-schema.js +37 -0
  54. package/dist/extension/control-notices.js +13 -6
  55. package/dist/extension/delegation-bridges.js +43 -0
  56. package/dist/extension/doctor.js +48 -25
  57. package/dist/extension/everyday-schemas.js +207 -0
  58. package/dist/extension/fanout-child.js +18 -319
  59. package/dist/extension/index.js +8 -563
  60. package/dist/extension/message-renderers.js +225 -0
  61. package/dist/extension/nested-control-inbox.js +154 -0
  62. package/dist/extension/parent-runtime.js +339 -0
  63. package/dist/extension/primary-tool.js +69 -0
  64. package/dist/extension/result-snapshot.js +22 -0
  65. package/dist/extension/runtime-reload.js +62 -0
  66. package/dist/extension/runtime-storage.js +43 -0
  67. package/dist/extension/schema-overrides.js +75 -0
  68. package/dist/extension/schemas.js +265 -336
  69. package/dist/extension/tool-input.js +27 -12
  70. package/dist/extension/tool-result.js +19 -4
  71. package/dist/history/answer-texts.js +57 -0
  72. package/dist/history/canonical-result.js +76 -43
  73. package/dist/history/canonical-selection.js +40 -0
  74. package/dist/history/database-generation.js +82 -0
  75. package/dist/history/database.js +57 -33
  76. package/dist/history/entry-ingestion.js +61 -0
  77. package/dist/history/index.js +242 -97
  78. package/dist/history/ingest.js +168 -331
  79. package/dist/history/output-digests.js +40 -0
  80. package/dist/history/preview.js +210 -0
  81. package/dist/history/prune.js +33 -0
  82. package/dist/history/queries.js +60 -349
  83. package/dist/history/query-scope.js +190 -0
  84. package/dist/history/rows.js +77 -0
  85. package/dist/history/run-projection.js +137 -0
  86. package/dist/history/run-queries.js +153 -0
  87. package/dist/history/schema.js +31 -0
  88. package/dist/history/search-queries.js +163 -0
  89. package/dist/history/selected-record.js +108 -0
  90. package/dist/history/source-file.js +45 -0
  91. package/dist/history/source-watches.js +141 -0
  92. package/dist/history/store.js +164 -153
  93. package/dist/history/text-chunks.js +169 -0
  94. package/dist/history/text.js +35 -0
  95. package/dist/history/transcript-queries.js +177 -0
  96. package/dist/history/types.js +5 -1
  97. package/dist/history/values.js +36 -0
  98. package/dist/history/wire-inputs.js +122 -0
  99. package/dist/history/wire-models.js +38 -0
  100. package/dist/history/worker-runtime.js +441 -0
  101. package/dist/history/worker.js +66 -462
  102. package/dist/intercom/intercom-bridge.js +48 -20
  103. package/dist/intercom/live-intercom.js +80 -23
  104. package/dist/intercom/nested-result-tree.js +163 -0
  105. package/dist/intercom/result-delivery.js +40 -0
  106. package/dist/intercom/result-intercom.js +178 -261
  107. package/dist/pi-intercom/agent-dir.js +7 -3
  108. package/dist/pi-intercom/async.js +27 -0
  109. package/dist/pi-intercom/bridge-ask.js +57 -0
  110. package/dist/pi-intercom/bridge-config.js +79 -0
  111. package/dist/pi-intercom/bridge-http.js +86 -0
  112. package/dist/pi-intercom/bridge-protocol.js +106 -0
  113. package/dist/pi-intercom/bridge-routes.js +64 -0
  114. package/dist/pi-intercom/bridge-session.js +416 -0
  115. package/dist/pi-intercom/bridge.js +182 -603
  116. package/dist/pi-intercom/broker/broker.js +236 -244
  117. package/dist/pi-intercom/broker/client.js +189 -304
  118. package/dist/pi-intercom/broker/connection.js +165 -0
  119. package/dist/pi-intercom/broker/framing.js +5 -3
  120. package/dist/pi-intercom/broker/paths.js +4 -1
  121. package/dist/pi-intercom/broker/pid.js +53 -25
  122. package/dist/pi-intercom/broker/snapshot-reader.js +78 -0
  123. package/dist/pi-intercom/broker/snapshots.js +188 -0
  124. package/dist/pi-intercom/broker/spawn.js +36 -25
  125. package/dist/pi-intercom/config.js +85 -71
  126. package/dist/pi-intercom/connection.js +297 -0
  127. package/dist/pi-intercom/identity.js +58 -0
  128. package/dist/pi-intercom/inbound-delivery.js +356 -0
  129. package/dist/pi-intercom/inbound-journal.js +303 -0
  130. package/dist/pi-intercom/inbound-record.js +113 -0
  131. package/dist/pi-intercom/inbound.js +179 -0
  132. package/dist/pi-intercom/index.js +79 -2933
  133. package/dist/pi-intercom/inspection.js +62 -0
  134. package/dist/pi-intercom/interview.js +236 -0
  135. package/dist/pi-intercom/lifecycle.js +168 -0
  136. package/dist/pi-intercom/message-format.js +69 -0
  137. package/dist/pi-intercom/outbound.js +304 -0
  138. package/dist/pi-intercom/peer-awareness.js +66 -0
  139. package/dist/pi-intercom/reply-tracker.js +62 -43
  140. package/dist/pi-intercom/reply-wait.js +201 -0
  141. package/dist/pi-intercom/runtime-types.js +3 -0
  142. package/dist/pi-intercom/session-events.js +180 -0
  143. package/dist/pi-intercom/session-targets.js +42 -34
  144. package/dist/pi-intercom/subagent-events.js +238 -0
  145. package/dist/pi-intercom/subagent-live-events.js +129 -86
  146. package/dist/pi-intercom/supervisor.js +282 -0
  147. package/dist/pi-intercom/tool-arguments.js +74 -0
  148. package/dist/pi-intercom/tool-registration.js +95 -0
  149. package/dist/pi-intercom/tool-results.js +38 -0
  150. package/dist/pi-intercom/tool-schemas.js +82 -0
  151. package/dist/pi-intercom/tools.js +51 -0
  152. package/dist/pi-intercom/topic-actions.js +177 -0
  153. package/dist/pi-intercom/topics.js +177 -92
  154. package/dist/pi-intercom/transport.js +1 -0
  155. package/dist/pi-intercom/types.js +151 -114
  156. package/dist/pi-intercom/ui/compose-paste.js +93 -0
  157. package/dist/pi-intercom/ui/compose.js +121 -143
  158. package/dist/pi-intercom/ui/inline-message.js +59 -59
  159. package/dist/pi-intercom/ui/message-renderers.js +147 -0
  160. package/dist/pi-intercom/ui/overlay.js +181 -0
  161. package/dist/pi-intercom/ui/session-format.js +124 -0
  162. package/dist/pi-intercom/ui/session-list.js +76 -43
  163. package/dist/pi-intercom/ui/tool-renderers.js +110 -0
  164. package/dist/pi-intercom/ui/topic-view.js +88 -0
  165. package/dist/pi-intercom/validation.js +59 -0
  166. package/dist/runs/background/async-chain-plan.js +265 -0
  167. package/dist/runs/background/async-control.js +134 -58
  168. package/dist/runs/background/async-execution.js +136 -633
  169. package/dist/runs/background/async-job-admission.js +40 -0
  170. package/dist/runs/background/async-job-projection.js +169 -0
  171. package/dist/runs/background/async-job-tracker.js +297 -327
  172. package/dist/runs/background/async-launch.js +216 -0
  173. package/dist/runs/background/async-plan.js +116 -0
  174. package/dist/runs/background/async-result-file.js +47 -23
  175. package/dist/runs/background/async-resume.js +195 -253
  176. package/dist/runs/background/async-run-discovery.js +213 -0
  177. package/dist/runs/background/async-run-location.js +135 -0
  178. package/dist/runs/background/async-run-record.js +1 -0
  179. package/dist/runs/background/async-run-repair.js +223 -0
  180. package/dist/runs/background/async-run-summary.js +1 -0
  181. package/dist/runs/background/async-single-plan.js +105 -0
  182. package/dist/runs/background/async-status-projection.js +155 -0
  183. package/dist/runs/background/async-status-render.js +117 -0
  184. package/dist/runs/background/async-status-validation.js +181 -0
  185. package/dist/runs/background/async-status.js +3 -442
  186. package/dist/runs/background/async-value.js +21 -0
  187. package/dist/runs/background/completion-dedupe.js +36 -12
  188. package/dist/runs/background/completion-delivery.js +211 -205
  189. package/dist/runs/background/completion-receipts.js +237 -0
  190. package/dist/runs/background/legacy-status-acceptance.js +34 -0
  191. package/dist/runs/background/notify.js +96 -48
  192. package/dist/runs/background/parallel-groups.js +36 -19
  193. package/dist/runs/background/result-payload.js +178 -0
  194. package/dist/runs/background/result-watcher.js +348 -339
  195. package/dist/runs/background/run-id-resolver.js +53 -33
  196. package/dist/runs/background/run-schemas.js +189 -0
  197. package/dist/runs/background/run-status-contracts.js +14 -0
  198. package/dist/runs/background/run-status-render.js +270 -0
  199. package/dist/runs/background/run-status.js +231 -339
  200. package/dist/runs/background/runner-attempt-output.js +155 -0
  201. package/dist/runs/background/runner-attempt.js +263 -0
  202. package/dist/runs/background/runner-child-executor.js +166 -0
  203. package/dist/runs/background/runner-child-observer.js +192 -0
  204. package/dist/runs/background/runner-completion-summary.js +71 -0
  205. package/dist/runs/background/runner-completion.js +211 -0
  206. package/dist/runs/background/runner-config.js +1 -0
  207. package/dist/runs/background/runner-contract.js +1 -0
  208. package/dist/runs/background/runner-dynamic.js +121 -0
  209. package/dist/runs/background/runner-finalization.js +149 -0
  210. package/dist/runs/background/runner-graph.js +68 -0
  211. package/dist/runs/background/runner-initial-status.js +60 -0
  212. package/dist/runs/background/runner-lifecycle.js +142 -0
  213. package/dist/runs/background/runner-monitor.js +309 -0
  214. package/dist/runs/background/runner-parallel.js +204 -0
  215. package/dist/runs/background/runner-prepare-step.js +86 -0
  216. package/dist/runs/background/runner-reporting.js +153 -0
  217. package/dist/runs/background/runner-status.js +148 -0
  218. package/dist/runs/background/runner-step-output.js +92 -0
  219. package/dist/runs/background/runner-step-record.js +45 -0
  220. package/dist/runs/background/runner-step.js +112 -0
  221. package/dist/runs/background/runner-streaming.js +173 -0
  222. package/dist/runs/background/runner-workflow.js +213 -0
  223. package/dist/runs/background/stale-run-reconciler.js +155 -292
  224. package/dist/runs/background/subagent-runner-launcher.js +33 -13
  225. package/dist/runs/background/subagent-runner.js +51 -1842
  226. package/dist/runs/background/top-level-async.js +2 -1
  227. package/dist/runs/foreground/chain-clarify.js +293 -1017
  228. package/dist/runs/foreground/clarification-draft.js +87 -0
  229. package/dist/runs/foreground/clarify-contracts.js +1 -0
  230. package/dist/runs/foreground/clarify-invocation.js +129 -38
  231. package/dist/runs/foreground/clarify-text-editor.js +210 -0
  232. package/dist/runs/foreground/clarify-view.js +167 -0
  233. package/dist/runs/foreground/execution-input.js +226 -353
  234. package/dist/runs/foreground/execution-routing.js +33 -0
  235. package/dist/runs/foreground/execution-timeout.js +81 -0
  236. package/dist/runs/foreground/foreground-control.js +222 -763
  237. package/dist/runs/foreground/foreground-memory.js +99 -0
  238. package/dist/runs/foreground/invocation-context.js +55 -0
  239. package/dist/runs/foreground/invocation-execution.js +331 -0
  240. package/dist/runs/foreground/invocation-expansion.js +48 -0
  241. package/dist/runs/foreground/management-actions.js +295 -0
  242. package/dist/runs/foreground/nested-control.js +179 -0
  243. package/dist/runs/foreground/question-continuation.js +78 -0
  244. package/dist/runs/foreground/question-control.js +155 -50
  245. package/dist/runs/foreground/resume-target.js +221 -0
  246. package/dist/runs/foreground/revival-launch-policy.js +58 -0
  247. package/dist/runs/foreground/run-async-path.js +190 -178
  248. package/dist/runs/foreground/run-interrupt.js +164 -0
  249. package/dist/runs/foreground/run-nudge.js +278 -0
  250. package/dist/runs/foreground/saved-revival.js +251 -0
  251. package/dist/runs/foreground/subagent-executor.js +135 -424
  252. package/dist/runs/foreground/subagent-params.js +67 -30
  253. package/dist/runs/foreground/wait-observation.js +104 -0
  254. package/dist/runs/foreground/wait-registration.js +17 -0
  255. package/dist/runs/foreground/wait-run.js +283 -123
  256. package/dist/runs/shared/acceptance-contract.js +193 -99
  257. package/dist/runs/shared/acceptance-defaults.js +1 -0
  258. package/dist/runs/shared/acceptance-evaluation.js +201 -181
  259. package/dist/runs/shared/acceptance-finalization.js +256 -180
  260. package/dist/runs/shared/acceptance-outcome.js +53 -0
  261. package/dist/runs/shared/acceptance-reports.js +137 -72
  262. package/dist/runs/shared/acceptance-submission.js +167 -0
  263. package/dist/runs/shared/acceptance-verification.js +100 -0
  264. package/dist/runs/shared/chain-outputs.js +80 -52
  265. package/dist/runs/shared/child-attempt-types.js +1 -0
  266. package/dist/runs/shared/child-attempt.js +314 -667
  267. package/dist/runs/shared/child-boundaries.js +173 -0
  268. package/dist/runs/shared/child-context-filter.js +44 -0
  269. package/dist/runs/shared/child-event-observer.js +390 -0
  270. package/dist/runs/shared/child-execution-cwd.js +73 -43
  271. package/dist/runs/shared/child-execution-outcome.js +72 -0
  272. package/dist/runs/shared/child-invocation.js +54 -0
  273. package/dist/runs/shared/child-message-validation.js +215 -0
  274. package/dist/runs/shared/child-native-accounting.js +106 -0
  275. package/dist/runs/shared/child-native-observation.js +69 -0
  276. package/dist/runs/shared/child-observation-spool.js +164 -0
  277. package/dist/runs/shared/child-observations.js +157 -76
  278. package/dist/runs/shared/child-presence.js +3 -0
  279. package/dist/runs/shared/child-route-env.js +119 -0
  280. package/dist/runs/shared/child-stream-observer.js +221 -0
  281. package/dist/runs/shared/child-stream-projection.js +137 -0
  282. package/dist/runs/shared/child-structured-tool.js +27 -0
  283. package/dist/runs/shared/claude-code.js +121 -158
  284. package/dist/runs/shared/claude-model.js +42 -0
  285. package/dist/runs/shared/claude-session.js +83 -0
  286. package/dist/runs/shared/claude-types.js +1 -0
  287. package/dist/runs/shared/completion-guard.js +18 -18
  288. package/dist/runs/shared/control-event-policy.js +8 -0
  289. package/dist/runs/shared/control-notification-owner.js +13 -0
  290. package/dist/runs/shared/dynamic-fanout.js +188 -173
  291. package/dist/runs/shared/dynamic-item.js +102 -0
  292. package/dist/runs/shared/history-index.js +62 -36
  293. package/dist/runs/shared/legacy-async-recovery.js +114 -0
  294. package/dist/runs/shared/legacy-output-recovery.js +148 -0
  295. package/dist/runs/shared/mcp-config-schema.js +36 -0
  296. package/dist/runs/shared/mcp-direct-tool-allowlist.js +147 -116
  297. package/dist/runs/shared/model-fallback.js +97 -38
  298. package/dist/runs/shared/mutating-tool-guard.js +128 -88
  299. package/dist/runs/shared/native-finalization-types.js +1 -0
  300. package/dist/runs/shared/native-finalization.js +155 -76
  301. package/dist/runs/shared/native-usage.js +238 -98
  302. package/dist/runs/shared/nested-control-records.js +128 -0
  303. package/dist/runs/shared/nested-events.js +8 -700
  304. package/dist/runs/shared/nested-path.js +32 -28
  305. package/dist/runs/shared/nested-projection.js +155 -0
  306. package/dist/runs/shared/nested-protocol.js +18 -0
  307. package/dist/runs/shared/nested-registry.js +191 -0
  308. package/dist/runs/shared/nested-render.js +106 -58
  309. package/dist/runs/shared/nested-route.js +220 -0
  310. package/dist/runs/shared/nested-validation.js +216 -0
  311. package/dist/runs/shared/owned-child-evidence.js +125 -0
  312. package/dist/runs/shared/owned-run-list.js +146 -0
  313. package/dist/runs/shared/owned-run-observation.js +267 -0
  314. package/dist/runs/shared/owned-run-progress.js +109 -0
  315. package/dist/runs/shared/owned-run-read-state.js +1 -0
  316. package/dist/runs/shared/owned-run-results.js +202 -0
  317. package/dist/runs/shared/owned-run-status.js +180 -0
  318. package/dist/runs/shared/owned-run-view.js +51 -0
  319. package/dist/runs/shared/owned-workflow-details.js +17 -0
  320. package/dist/runs/shared/owner-output.js +43 -0
  321. package/dist/runs/shared/parallel-utils.js +36 -28
  322. package/dist/runs/shared/parent-receipts.js +90 -32
  323. package/dist/runs/shared/parent-usage.js +169 -57
  324. package/dist/runs/shared/pi-args.js +108 -201
  325. package/dist/runs/shared/pi-launch-input.js +1 -0
  326. package/dist/runs/shared/pi-session-launch.js +86 -0
  327. package/dist/runs/shared/pi-spawn.js +35 -21
  328. package/dist/runs/shared/run-history-queries.js +126 -35
  329. package/dist/runs/shared/run-history.js +101 -35
  330. package/dist/runs/shared/run-metadata-paths.js +14 -0
  331. package/dist/runs/shared/run-metadata.js +158 -0
  332. package/dist/runs/shared/run-persistence.js +131 -0
  333. package/dist/runs/shared/run-records.js +9 -679
  334. package/dist/runs/shared/run-restoration.js +338 -0
  335. package/dist/runs/shared/run-state-owner.js +26 -0
  336. package/dist/runs/shared/session-cwd-preload.js +27 -18
  337. package/dist/runs/shared/single-output.js +148 -70
  338. package/dist/runs/shared/stable-value.js +15 -0
  339. package/dist/runs/shared/streaming-text.js +23 -12
  340. package/dist/runs/shared/structured-output.js +25 -13
  341. package/dist/runs/shared/subagent-control.js +167 -100
  342. package/dist/runs/shared/subagent-prompt-runtime.js +27 -130
  343. package/dist/runs/shared/subagent-tool-loop-guard.js +81 -52
  344. package/dist/runs/shared/supervisor-question-state.js +145 -0
  345. package/dist/runs/shared/supervisor-questions.js +185 -254
  346. package/dist/runs/shared/workflow-graph.js +259 -167
  347. package/dist/runs/shared/workflow-policy.js +120 -48
  348. package/dist/runs/shared/worktree-contract.js +1 -0
  349. package/dist/runs/shared/worktree-hook.js +138 -0
  350. package/dist/runs/shared/worktree-location.js +47 -0
  351. package/dist/runs/shared/worktree-preservation.js +8 -0
  352. package/dist/runs/shared/worktree-process.js +107 -0
  353. package/dist/runs/shared/worktree.js +183 -322
  354. package/dist/shared/agent-context-policy.js +34 -44
  355. package/dist/shared/agent-dir.js +14 -0
  356. package/dist/shared/artifacts.js +30 -12
  357. package/dist/shared/atomic-json.js +4 -1
  358. package/dist/shared/chain-files.js +72 -0
  359. package/dist/shared/concurrency.js +18 -0
  360. package/dist/shared/content-preview.js +115 -0
  361. package/dist/shared/cooperative.js +5 -2
  362. package/dist/shared/execution-cwd.js +13 -5
  363. package/dist/shared/file-coalescer.js +2 -1
  364. package/dist/shared/fork-context.js +10 -12
  365. package/dist/shared/formatters.js +45 -19
  366. package/dist/shared/journal-frames.js +164 -0
  367. package/dist/shared/journal-projections.js +121 -0
  368. package/dist/shared/journal-reader.js +6 -407
  369. package/dist/shared/json-projection.js +191 -0
  370. package/dist/shared/lazy-tools.js +19 -8
  371. package/dist/shared/message-output.js +116 -0
  372. package/dist/shared/model-info.js +31 -14
  373. package/dist/shared/native-import.js +20 -0
  374. package/dist/shared/native-journal.js +140 -0
  375. package/dist/shared/native-session.js +5 -2
  376. package/dist/shared/native-tui.js +7 -2
  377. package/dist/shared/native-typebox.js +15 -3
  378. package/dist/shared/output-page.js +63 -0
  379. package/dist/shared/post-exit-stdio-guard.js +128 -88
  380. package/dist/shared/prompt-sections.js +2 -0
  381. package/dist/shared/session-entries.js +70 -35
  382. package/dist/shared/session-identity.js +5 -3
  383. package/dist/shared/settings.js +62 -192
  384. package/dist/shared/status-format.js +97 -37
  385. package/dist/shared/task-file-policy.js +24 -0
  386. package/dist/shared/temp-root.js +44 -15
  387. package/dist/shared/types/acceptance.js +1 -0
  388. package/dist/shared/types/async.js +1 -0
  389. package/dist/shared/types/config.js +1 -0
  390. package/dist/shared/types/details.js +1 -0
  391. package/dist/shared/types/history.js +1 -0
  392. package/dist/shared/types/inputs.js +1 -0
  393. package/dist/shared/types/intercom.js +1 -0
  394. package/dist/shared/types/launch.js +1 -0
  395. package/dist/shared/types/messages.js +1 -0
  396. package/dist/shared/types/nested.js +1 -0
  397. package/dist/shared/types/owned-runs.js +1 -0
  398. package/dist/shared/types/progress.js +1 -0
  399. package/dist/shared/types/questions.js +1 -0
  400. package/dist/shared/types/results.js +1 -0
  401. package/dist/shared/types/state.js +1 -0
  402. package/dist/shared/types/usage.js +1 -0
  403. package/dist/shared/types/workflow.js +1 -0
  404. package/dist/shared/types.js +75 -30
  405. package/dist/shared/unknown.js +52 -0
  406. package/dist/shared/utils.js +54 -260
  407. package/dist/slash/command-discovery.js +82 -0
  408. package/dist/slash/command-input.js +190 -0
  409. package/dist/slash/prompt-template-bridge.js +94 -270
  410. package/dist/slash/prompt-template-contract.js +77 -0
  411. package/dist/slash/prompt-template-results.js +125 -0
  412. package/dist/slash/request-protocol.js +68 -0
  413. package/dist/slash/result-delivery.js +237 -0
  414. package/dist/slash/saved-chain.js +78 -0
  415. package/dist/slash/slash-bridge.js +123 -89
  416. package/dist/slash/slash-commands.js +101 -572
  417. package/dist/slash/slash-live-state.js +68 -47
  418. package/dist/tui/action-hints.js +50 -22
  419. package/dist/tui/activity-lines.js +32 -0
  420. package/dist/tui/agent-browser.js +290 -0
  421. package/dist/tui/agent-controls.js +289 -0
  422. package/dist/tui/agent-conversation.js +444 -0
  423. package/dist/tui/agent-dock.js +171 -0
  424. package/dist/tui/agent-history.js +50 -183
  425. package/dist/tui/agent-model.js +62 -0
  426. package/dist/tui/agent-picker.js +262 -0
  427. package/dist/tui/agent-view.js +232 -1564
  428. package/dist/tui/compact-results.js +193 -0
  429. package/dist/tui/conversation-details.js +190 -0
  430. package/dist/tui/conversation-frame.js +135 -0
  431. package/dist/tui/conversation-history.js +201 -0
  432. package/dist/tui/conversation-menu.js +78 -0
  433. package/dist/tui/conversation-notices.js +79 -0
  434. package/dist/tui/conversation-selection.js +58 -0
  435. package/dist/tui/conversation-viewport.js +129 -0
  436. package/dist/tui/direction-message.js +27 -0
  437. package/dist/tui/display.js +282 -0
  438. package/dist/tui/editor-viewport.js +18 -0
  439. package/dist/tui/expanded-content.js +87 -0
  440. package/dist/tui/expanded-multi.js +170 -0
  441. package/dist/tui/expanded-single.js +65 -0
  442. package/dist/tui/history-cards.js +216 -0
  443. package/dist/tui/history-display.js +238 -0
  444. package/dist/tui/history-json.js +16 -0
  445. package/dist/tui/history-metadata.js +152 -0
  446. package/dist/tui/history-record.js +251 -0
  447. package/dist/tui/history-text.js +34 -0
  448. package/dist/tui/indexed-history.js +116 -0
  449. package/dist/tui/nested-widget.js +120 -0
  450. package/dist/tui/picker-page.js +59 -0
  451. package/dist/tui/render.js +58 -1501
  452. package/dist/tui/result-facts.js +64 -0
  453. package/dist/tui/task-observation.js +59 -0
  454. package/dist/tui/task-store.js +366 -0
  455. package/dist/tui/text-values.js +16 -0
  456. package/dist/tui/view-connections.js +47 -0
  457. package/dist/tui/view-model.js +94 -0
  458. package/dist/tui/view-persistence.js +51 -0
  459. package/dist/tui/view-ports.js +1 -0
  460. package/dist/tui/view-session.js +37 -0
  461. package/dist/tui/widget-details.js +144 -0
  462. package/dist/tui/widget-status.js +245 -0
  463. package/dist/tui/widget.js +145 -0
  464. package/dist/tui/workflow-labels.js +223 -0
  465. package/dist/tui/workflow-outcomes.js +124 -0
  466. package/docs/code-quality.md +38 -0
  467. package/docs/development.md +99 -0
  468. package/docs/intercom-bridge.md +22 -17
  469. package/docs/intercom.md +132 -106
  470. package/docs/performance.md +19 -17
  471. package/docs/reference.md +1472 -0
  472. package/generated/RunValidators.d.ts +28 -0
  473. package/generated/RunValidators.js +2 -0
  474. package/package.json +27 -6
  475. package/prompts/parallel-cleanup.md +3 -0
  476. package/prompts/parallel-context-build.md +3 -0
  477. package/prompts/parallel-handoff-plan.md +6 -0
  478. package/prompts/parallel-research.md +4 -0
  479. package/prompts/parallel-review.md +2 -0
  480. package/prompts/review-loop.md +2 -0
  481. package/scripts/build.mjs +129 -85
  482. package/scripts/check-compat.mjs +48 -11
  483. package/scripts/compat-host.mjs +35 -7
  484. package/scripts/generate-run-schemas.mjs +210 -0
  485. package/scripts/intercom-bridge-credentials.mjs +155 -28
  486. package/scripts/intercom-remote.mjs +175 -50
  487. package/scripts/local-install-smoke.mjs +47 -37
  488. package/scripts/native-package-smoke.mjs +135 -25
  489. package/scripts/package-smoke.mjs +360 -140
  490. package/scripts/prepare.mjs +54 -34
  491. package/scripts/real-pi-processes.mjs +261 -0
  492. package/scripts/real-pi-smoke.mjs +432 -351
  493. package/scripts/run-tests.mjs +29 -15
  494. package/skills/pi-intercom/SKILL.md +11 -11
  495. package/skills/pi-intercom/references/peer-sessions.md +7 -2
  496. package/skills/pi-subagents/SKILL.md +1 -1
  497. package/skills/pi-subagents/references/full-orchestration-guide.md +254 -112
  498. package/src/agents/agent-defaults.ts +13 -0
  499. package/src/agents/agent-definition.ts +253 -0
  500. package/src/agents/agent-management.ts +111 -808
  501. package/src/agents/agent-scope.ts +7 -3
  502. package/src/agents/agent-selection.ts +26 -16
  503. package/src/agents/agent-serializer.ts +84 -93
  504. package/src/agents/agents.ts +199 -906
  505. package/src/agents/builtin-overrides.ts +297 -0
  506. package/src/agents/chain-serializer.ts +3 -329
  507. package/src/agents/config-values.ts +57 -0
  508. package/src/agents/discovery-paths.ts +134 -0
  509. package/src/agents/frontmatter.ts +35 -17
  510. package/src/agents/identity.ts +49 -18
  511. package/src/agents/json-chain.ts +305 -0
  512. package/src/agents/management-config.ts +342 -0
  513. package/src/agents/management-format.ts +243 -0
  514. package/src/agents/management-persistence.ts +408 -0
  515. package/src/agents/management-targets.ts +260 -0
  516. package/src/agents/management-warnings.ts +115 -0
  517. package/src/agents/markdown-chain.ts +237 -0
  518. package/src/agents/package-agents.ts +231 -0
  519. package/src/agents/skill-files.ts +182 -0
  520. package/src/agents/skill-search-paths.ts +289 -0
  521. package/src/agents/skill-types.ts +31 -0
  522. package/src/agents/skills.ts +152 -610
  523. package/src/extension/acceptance-schema.ts +88 -0
  524. package/src/extension/chain-schema.ts +276 -0
  525. package/src/extension/child-runtime.ts +302 -0
  526. package/src/extension/compact-tools.ts +259 -102
  527. package/src/extension/config-schema.ts +59 -0
  528. package/src/extension/config.ts +39 -17
  529. package/src/extension/control-notice-schema.ts +55 -0
  530. package/src/extension/control-notices.ts +57 -33
  531. package/src/extension/delegation-bridges.ts +59 -0
  532. package/src/extension/doctor.ts +171 -135
  533. package/src/extension/everyday-schemas.ts +252 -0
  534. package/src/extension/fanout-child.ts +29 -308
  535. package/src/extension/index.ts +17 -642
  536. package/src/extension/message-renderers.ts +334 -0
  537. package/src/extension/nested-control-inbox.ts +196 -0
  538. package/src/extension/parent-runtime.ts +405 -0
  539. package/src/extension/primary-tool.ts +130 -0
  540. package/src/extension/result-snapshot.ts +35 -0
  541. package/src/extension/runtime-reload.ts +72 -0
  542. package/src/extension/runtime-storage.ts +49 -0
  543. package/src/extension/schema-overrides.ts +114 -0
  544. package/src/extension/schemas.ts +451 -418
  545. package/src/extension/tool-input.ts +40 -13
  546. package/src/extension/tool-result.ts +45 -14
  547. package/src/history/answer-texts.ts +74 -0
  548. package/src/history/canonical-result.ts +127 -51
  549. package/src/history/canonical-selection.ts +54 -0
  550. package/src/history/database-generation.ts +86 -0
  551. package/src/history/database.ts +86 -48
  552. package/src/history/entry-ingestion.ts +129 -0
  553. package/src/history/index.ts +426 -148
  554. package/src/history/ingest.ts +372 -342
  555. package/src/history/output-digests.ts +41 -0
  556. package/src/history/preview.ts +235 -0
  557. package/src/history/prune.ts +48 -0
  558. package/src/history/queries.ts +122 -256
  559. package/src/history/query-scope.ts +278 -0
  560. package/src/history/rows.ts +118 -0
  561. package/src/history/run-projection.ts +164 -0
  562. package/src/history/run-queries.ts +199 -0
  563. package/src/history/schema.ts +34 -0
  564. package/src/history/search-queries.ts +216 -0
  565. package/src/history/selected-record.ts +140 -0
  566. package/src/history/source-file.ts +51 -0
  567. package/src/history/source-watches.ts +156 -0
  568. package/src/history/store.ts +310 -197
  569. package/src/history/text-chunks.ts +181 -0
  570. package/src/history/text.ts +43 -0
  571. package/src/history/transcript-queries.ts +251 -0
  572. package/src/history/types.ts +27 -164
  573. package/src/history/values.ts +36 -0
  574. package/src/history/wire-inputs.ts +141 -0
  575. package/src/history/wire-models.ts +51 -0
  576. package/src/history/worker-runtime.ts +502 -0
  577. package/src/history/worker.ts +94 -336
  578. package/src/intercom/intercom-bridge.ts +136 -69
  579. package/src/intercom/live-intercom.ts +197 -92
  580. package/src/intercom/nested-result-tree.ts +213 -0
  581. package/src/intercom/result-delivery.ts +56 -0
  582. package/src/intercom/result-intercom.ts +364 -382
  583. package/src/pi-intercom/agent-dir.ts +9 -3
  584. package/src/pi-intercom/async.ts +33 -0
  585. package/src/pi-intercom/bridge-ask.ts +64 -0
  586. package/src/pi-intercom/bridge-config.ts +101 -0
  587. package/src/pi-intercom/bridge-http.ts +97 -0
  588. package/src/pi-intercom/bridge-protocol.ts +123 -0
  589. package/src/pi-intercom/bridge-routes.ts +90 -0
  590. package/src/pi-intercom/bridge-session.ts +506 -0
  591. package/src/pi-intercom/bridge.ts +258 -547
  592. package/src/pi-intercom/broker/broker.ts +326 -263
  593. package/src/pi-intercom/broker/client.ts +273 -354
  594. package/src/pi-intercom/broker/connection.ts +192 -0
  595. package/src/pi-intercom/broker/framing.ts +11 -6
  596. package/src/pi-intercom/broker/paths.ts +28 -25
  597. package/src/pi-intercom/broker/pid.ts +68 -24
  598. package/src/pi-intercom/broker/snapshot-reader.ts +91 -0
  599. package/src/pi-intercom/broker/snapshots.ts +241 -0
  600. package/src/pi-intercom/broker/spawn.ts +58 -34
  601. package/src/pi-intercom/config.ts +113 -108
  602. package/src/pi-intercom/connection.ts +346 -0
  603. package/src/pi-intercom/identity.ts +71 -0
  604. package/src/pi-intercom/inbound-delivery.ts +450 -0
  605. package/src/pi-intercom/inbound-journal.ts +350 -0
  606. package/src/pi-intercom/inbound-record.ts +141 -0
  607. package/src/pi-intercom/inbound.ts +237 -0
  608. package/src/pi-intercom/index.ts +86 -2923
  609. package/src/pi-intercom/inspection.ts +82 -0
  610. package/src/pi-intercom/interview.ts +295 -0
  611. package/src/pi-intercom/lifecycle.ts +183 -0
  612. package/src/pi-intercom/message-format.ts +77 -0
  613. package/src/pi-intercom/outbound.ts +418 -0
  614. package/src/pi-intercom/peer-awareness.ts +84 -0
  615. package/src/pi-intercom/reply-tracker.ts +121 -59
  616. package/src/pi-intercom/reply-wait.ts +247 -0
  617. package/src/pi-intercom/runtime-types.ts +97 -0
  618. package/src/pi-intercom/session-events.ts +247 -0
  619. package/src/pi-intercom/session-targets.ts +124 -72
  620. package/src/pi-intercom/subagent-events.ts +299 -0
  621. package/src/pi-intercom/subagent-live-events.ts +212 -109
  622. package/src/pi-intercom/supervisor.ts +362 -0
  623. package/src/pi-intercom/tool-arguments.ts +120 -0
  624. package/src/pi-intercom/tool-registration.ts +121 -0
  625. package/src/pi-intercom/tool-results.ts +54 -0
  626. package/src/pi-intercom/tool-schemas.ts +134 -0
  627. package/src/pi-intercom/tools.ts +80 -0
  628. package/src/pi-intercom/topic-actions.ts +243 -0
  629. package/src/pi-intercom/topics.ts +267 -121
  630. package/src/pi-intercom/transport.ts +14 -0
  631. package/src/pi-intercom/types.ts +288 -190
  632. package/src/pi-intercom/ui/compose-paste.ts +109 -0
  633. package/src/pi-intercom/ui/compose.ts +173 -157
  634. package/src/pi-intercom/ui/inline-message.ts +80 -62
  635. package/src/pi-intercom/ui/message-renderers.ts +182 -0
  636. package/src/pi-intercom/ui/overlay.ts +238 -0
  637. package/src/pi-intercom/ui/session-format.ts +146 -0
  638. package/src/pi-intercom/ui/session-list.ts +145 -62
  639. package/src/pi-intercom/ui/tool-renderers.ts +148 -0
  640. package/src/pi-intercom/ui/topic-view.ts +107 -0
  641. package/src/pi-intercom/validation.ts +69 -0
  642. package/src/runs/background/async-chain-plan.ts +451 -0
  643. package/src/runs/background/async-control.ts +201 -71
  644. package/src/runs/background/async-execution.ts +206 -829
  645. package/src/runs/background/async-job-admission.ts +54 -0
  646. package/src/runs/background/async-job-projection.ts +225 -0
  647. package/src/runs/background/async-job-tracker.ts +416 -360
  648. package/src/runs/background/async-launch.ts +319 -0
  649. package/src/runs/background/async-plan.ts +285 -0
  650. package/src/runs/background/async-result-file.ts +79 -37
  651. package/src/runs/background/async-resume.ts +338 -285
  652. package/src/runs/background/async-run-discovery.ts +270 -0
  653. package/src/runs/background/async-run-location.ts +194 -0
  654. package/src/runs/background/async-run-record.ts +14 -0
  655. package/src/runs/background/async-run-repair.ts +307 -0
  656. package/src/runs/background/async-run-summary.ts +71 -0
  657. package/src/runs/background/async-single-plan.ts +168 -0
  658. package/src/runs/background/async-status-projection.ts +188 -0
  659. package/src/runs/background/async-status-render.ts +164 -0
  660. package/src/runs/background/async-status-validation.ts +238 -0
  661. package/src/runs/background/async-status.ts +9 -481
  662. package/src/runs/background/async-value.ts +29 -0
  663. package/src/runs/background/completion-dedupe.ts +103 -54
  664. package/src/runs/background/completion-delivery.ts +313 -187
  665. package/src/runs/background/completion-receipts.ts +309 -0
  666. package/src/runs/background/legacy-status-acceptance.ts +38 -0
  667. package/src/runs/background/notify.ts +167 -106
  668. package/src/runs/background/parallel-groups.ts +95 -46
  669. package/src/runs/background/result-payload.ts +268 -0
  670. package/src/runs/background/result-watcher.ts +484 -387
  671. package/src/runs/background/run-id-resolver.ts +126 -57
  672. package/src/runs/background/run-schemas.ts +240 -0
  673. package/src/runs/background/run-status-contracts.ts +46 -0
  674. package/src/runs/background/run-status-render.ts +364 -0
  675. package/src/runs/background/run-status.ts +338 -356
  676. package/src/runs/background/runner-attempt-output.ts +281 -0
  677. package/src/runs/background/runner-attempt.ts +354 -0
  678. package/src/runs/background/runner-child-executor.ts +232 -0
  679. package/src/runs/background/runner-child-observer.ts +270 -0
  680. package/src/runs/background/runner-completion-summary.ts +106 -0
  681. package/src/runs/background/runner-completion.ts +274 -0
  682. package/src/runs/background/runner-config.ts +52 -0
  683. package/src/runs/background/runner-contract.ts +51 -0
  684. package/src/runs/background/runner-dynamic.ts +185 -0
  685. package/src/runs/background/runner-finalization.ts +203 -0
  686. package/src/runs/background/runner-graph.ts +91 -0
  687. package/src/runs/background/runner-initial-status.ts +72 -0
  688. package/src/runs/background/runner-lifecycle.ts +159 -0
  689. package/src/runs/background/runner-monitor.ts +399 -0
  690. package/src/runs/background/runner-parallel.ts +280 -0
  691. package/src/runs/background/runner-prepare-step.ts +128 -0
  692. package/src/runs/background/runner-reporting.ts +192 -0
  693. package/src/runs/background/runner-status.ts +220 -0
  694. package/src/runs/background/runner-step-output.ts +158 -0
  695. package/src/runs/background/runner-step-record.ts +76 -0
  696. package/src/runs/background/runner-step.ts +150 -0
  697. package/src/runs/background/runner-streaming.ts +220 -0
  698. package/src/runs/background/runner-workflow.ts +284 -0
  699. package/src/runs/background/stale-run-reconciler.ts +279 -336
  700. package/src/runs/background/subagent-runner-launcher.ts +67 -35
  701. package/src/runs/background/subagent-runner.ts +80 -2048
  702. package/src/runs/background/top-level-async.ts +9 -7
  703. package/src/runs/foreground/chain-clarify.ts +499 -1334
  704. package/src/runs/foreground/clarification-draft.ts +92 -0
  705. package/src/runs/foreground/clarify-contracts.ts +33 -0
  706. package/src/runs/foreground/clarify-invocation.ts +192 -65
  707. package/src/runs/foreground/clarify-text-editor.ts +229 -0
  708. package/src/runs/foreground/clarify-view.ts +222 -0
  709. package/src/runs/foreground/execution-input.ts +358 -424
  710. package/src/runs/foreground/execution-routing.ts +41 -0
  711. package/src/runs/foreground/execution-timeout.ts +92 -0
  712. package/src/runs/foreground/foreground-control.ts +333 -812
  713. package/src/runs/foreground/foreground-memory.ts +132 -0
  714. package/src/runs/foreground/invocation-context.ts +88 -0
  715. package/src/runs/foreground/invocation-execution.ts +465 -0
  716. package/src/runs/foreground/invocation-expansion.ts +58 -0
  717. package/src/runs/foreground/management-actions.ts +360 -0
  718. package/src/runs/foreground/nested-control.ts +248 -0
  719. package/src/runs/foreground/question-continuation.ts +112 -0
  720. package/src/runs/foreground/question-control.ts +297 -70
  721. package/src/runs/foreground/resume-target.ts +330 -0
  722. package/src/runs/foreground/revival-launch-policy.ts +112 -0
  723. package/src/runs/foreground/run-async-path.ts +307 -223
  724. package/src/runs/foreground/run-interrupt.ts +202 -0
  725. package/src/runs/foreground/run-nudge.ts +355 -0
  726. package/src/runs/foreground/saved-revival.ts +356 -0
  727. package/src/runs/foreground/subagent-executor.ts +195 -493
  728. package/src/runs/foreground/subagent-params.ts +314 -242
  729. package/src/runs/foreground/wait-observation.ts +160 -0
  730. package/src/runs/foreground/wait-registration.ts +18 -0
  731. package/src/runs/foreground/wait-run.ts +361 -119
  732. package/src/runs/shared/acceptance-contract.ts +410 -209
  733. package/src/runs/shared/acceptance-defaults.ts +1 -0
  734. package/src/runs/shared/acceptance-evaluation.ts +314 -240
  735. package/src/runs/shared/acceptance-finalization.ts +447 -305
  736. package/src/runs/shared/acceptance-outcome.ts +69 -0
  737. package/src/runs/shared/acceptance-reports.ts +220 -126
  738. package/src/runs/shared/acceptance-submission.ts +251 -0
  739. package/src/runs/shared/acceptance-verification.ts +118 -0
  740. package/src/runs/shared/acceptance.ts +25 -25
  741. package/src/runs/shared/chain-outputs.ts +190 -98
  742. package/src/runs/shared/child-attempt-types.ts +118 -0
  743. package/src/runs/shared/child-attempt.ts +372 -608
  744. package/src/runs/shared/child-boundaries.ts +217 -0
  745. package/src/runs/shared/child-context-filter.ts +53 -0
  746. package/src/runs/shared/child-event-observer.ts +496 -0
  747. package/src/runs/shared/child-execution-cwd.ts +139 -68
  748. package/src/runs/shared/child-execution-outcome.ts +103 -0
  749. package/src/runs/shared/child-invocation.ts +74 -0
  750. package/src/runs/shared/child-message-validation.ts +233 -0
  751. package/src/runs/shared/child-native-accounting.ts +154 -0
  752. package/src/runs/shared/child-native-observation.ts +79 -0
  753. package/src/runs/shared/child-observation-spool.ts +188 -0
  754. package/src/runs/shared/child-observations.ts +219 -89
  755. package/src/runs/shared/child-presence.ts +6 -0
  756. package/src/runs/shared/child-route-env.ts +142 -0
  757. package/src/runs/shared/child-stream-observer.ts +302 -0
  758. package/src/runs/shared/child-stream-projection.ts +160 -0
  759. package/src/runs/shared/child-structured-tool.ts +38 -0
  760. package/src/runs/shared/claude-code.ts +201 -228
  761. package/src/runs/shared/claude-model.ts +67 -0
  762. package/src/runs/shared/claude-session.ts +124 -0
  763. package/src/runs/shared/claude-types.ts +31 -0
  764. package/src/runs/shared/completion-guard.ts +35 -26
  765. package/src/runs/shared/control-event-policy.ts +15 -0
  766. package/src/runs/shared/control-notification-owner.ts +20 -0
  767. package/src/runs/shared/dynamic-fanout.ts +402 -238
  768. package/src/runs/shared/dynamic-item.ts +114 -0
  769. package/src/runs/shared/history-index.ts +112 -51
  770. package/src/runs/shared/legacy-async-recovery.ts +153 -0
  771. package/src/runs/shared/legacy-output-recovery.ts +214 -0
  772. package/src/runs/shared/mcp-config-schema.ts +46 -0
  773. package/src/runs/shared/mcp-direct-tool-allowlist.ts +396 -307
  774. package/src/runs/shared/model-fallback.ts +302 -180
  775. package/src/runs/shared/mutating-tool-guard.ts +259 -158
  776. package/src/runs/shared/native-finalization-types.ts +29 -0
  777. package/src/runs/shared/native-finalization.ts +233 -109
  778. package/src/runs/shared/native-usage.ts +379 -96
  779. package/src/runs/shared/nested-control-records.ts +178 -0
  780. package/src/runs/shared/nested-events.ts +45 -752
  781. package/src/runs/shared/nested-path.ts +47 -34
  782. package/src/runs/shared/nested-projection.ts +230 -0
  783. package/src/runs/shared/nested-protocol.ts +67 -0
  784. package/src/runs/shared/nested-registry.ts +273 -0
  785. package/src/runs/shared/nested-render.ts +198 -100
  786. package/src/runs/shared/nested-route.ts +292 -0
  787. package/src/runs/shared/nested-validation.ts +291 -0
  788. package/src/runs/shared/owned-child-evidence.ts +184 -0
  789. package/src/runs/shared/owned-run-list.ts +187 -0
  790. package/src/runs/shared/owned-run-observation.ts +368 -0
  791. package/src/runs/shared/owned-run-progress.ts +172 -0
  792. package/src/runs/shared/owned-run-read-state.ts +7 -0
  793. package/src/runs/shared/owned-run-results.ts +289 -0
  794. package/src/runs/shared/owned-run-status.ts +239 -0
  795. package/src/runs/shared/owned-run-view.ts +65 -0
  796. package/src/runs/shared/owned-workflow-details.ts +24 -0
  797. package/src/runs/shared/owner-output.ts +73 -0
  798. package/src/runs/shared/parallel-utils.ts +93 -129
  799. package/src/runs/shared/parent-receipts.ts +177 -50
  800. package/src/runs/shared/parent-usage.ts +314 -91
  801. package/src/runs/shared/pi-args.ts +241 -311
  802. package/src/runs/shared/pi-launch-input.ts +48 -0
  803. package/src/runs/shared/pi-session-launch.ts +94 -0
  804. package/src/runs/shared/pi-spawn.ts +57 -33
  805. package/src/runs/shared/run-history-queries.ts +189 -38
  806. package/src/runs/shared/run-history.ts +197 -76
  807. package/src/runs/shared/run-id-ambiguity.ts +7 -3
  808. package/src/runs/shared/run-metadata-paths.ts +17 -0
  809. package/src/runs/shared/run-metadata.ts +240 -0
  810. package/src/runs/shared/run-persistence.ts +181 -0
  811. package/src/runs/shared/run-records.ts +19 -607
  812. package/src/runs/shared/run-restoration.ts +455 -0
  813. package/src/runs/shared/run-state-owner.ts +31 -0
  814. package/src/runs/shared/session-cwd-preload.ts +39 -19
  815. package/src/runs/shared/single-output.ts +358 -205
  816. package/src/runs/shared/stable-value.ts +15 -0
  817. package/src/runs/shared/streaming-text.ts +39 -12
  818. package/src/runs/shared/structured-output.ts +76 -46
  819. package/src/runs/shared/subagent-control.ts +330 -197
  820. package/src/runs/shared/subagent-prompt-runtime.ts +92 -174
  821. package/src/runs/shared/subagent-tool-loop-guard.ts +118 -68
  822. package/src/runs/shared/supervisor-question-state.ts +221 -0
  823. package/src/runs/shared/supervisor-questions.ts +396 -401
  824. package/src/runs/shared/workflow-graph.ts +400 -198
  825. package/src/runs/shared/workflow-policy.ts +245 -110
  826. package/src/runs/shared/worktree-contract.ts +29 -0
  827. package/src/runs/shared/worktree-hook.ts +181 -0
  828. package/src/runs/shared/worktree-location.ts +61 -0
  829. package/src/runs/shared/worktree-preservation.ts +10 -0
  830. package/src/runs/shared/worktree-process.ts +132 -0
  831. package/src/runs/shared/worktree.ts +459 -587
  832. package/src/shared/agent-context-policy.ts +176 -145
  833. package/src/shared/agent-dir.ts +15 -0
  834. package/src/shared/artifacts.ts +99 -68
  835. package/src/shared/atomic-json.ts +14 -11
  836. package/src/shared/chain-files.ts +72 -0
  837. package/src/shared/concurrency.ts +27 -0
  838. package/src/shared/content-preview.ts +117 -0
  839. package/src/shared/cooperative.ts +17 -13
  840. package/src/shared/execution-cwd.ts +34 -9
  841. package/src/shared/file-coalescer.ts +24 -22
  842. package/src/shared/fork-context.ts +52 -48
  843. package/src/shared/formatters.ts +88 -47
  844. package/src/shared/journal-frames.ts +197 -0
  845. package/src/shared/journal-projections.ts +133 -0
  846. package/src/shared/journal-reader.ts +18 -333
  847. package/src/shared/json-projection.ts +224 -0
  848. package/src/shared/lazy-tools.ts +76 -27
  849. package/src/shared/message-output.ts +146 -0
  850. package/src/shared/model-info.ts +94 -58
  851. package/src/shared/native-import.ts +25 -0
  852. package/src/shared/native-journal.ts +172 -0
  853. package/src/shared/native-session.ts +8 -3
  854. package/src/shared/native-tui.ts +13 -3
  855. package/src/shared/native-typebox.ts +18 -3
  856. package/src/shared/output-page.ts +76 -0
  857. package/src/shared/post-exit-stdio-guard.ts +232 -172
  858. package/src/shared/prompt-sections.ts +13 -7
  859. package/src/shared/session-entries.ts +103 -44
  860. package/src/shared/session-identity.ts +17 -10
  861. package/src/shared/settings.ts +182 -367
  862. package/src/shared/status-format.ts +207 -98
  863. package/src/shared/stream-json.d.ts +10 -0
  864. package/src/shared/task-file-policy.ts +35 -0
  865. package/src/shared/temp-root.ts +122 -71
  866. package/src/shared/types/acceptance.ts +149 -0
  867. package/src/shared/types/async.ts +247 -0
  868. package/src/shared/types/config.ts +139 -0
  869. package/src/shared/types/details.ts +104 -0
  870. package/src/shared/types/history.ts +217 -0
  871. package/src/shared/types/inputs.ts +4 -0
  872. package/src/shared/types/intercom.ts +57 -0
  873. package/src/shared/types/launch.ts +39 -0
  874. package/src/shared/types/messages.ts +104 -0
  875. package/src/shared/types/nested.ts +153 -0
  876. package/src/shared/types/owned-runs.ts +148 -0
  877. package/src/shared/types/progress.ts +106 -0
  878. package/src/shared/types/questions.ts +103 -0
  879. package/src/shared/types/results.ts +119 -0
  880. package/src/shared/types/state.ts +56 -0
  881. package/src/shared/types/usage.ts +36 -0
  882. package/src/shared/types/workflow.ts +187 -0
  883. package/src/shared/types.ts +222 -1161
  884. package/src/shared/ui-mode.ts +1 -1
  885. package/src/shared/unknown.ts +59 -0
  886. package/src/shared/utils.ts +111 -305
  887. package/src/slash/command-discovery.ts +109 -0
  888. package/src/slash/command-input.ts +232 -0
  889. package/src/slash/prompt-template-bridge.ts +153 -400
  890. package/src/slash/prompt-template-contract.ts +152 -0
  891. package/src/slash/prompt-template-results.ts +189 -0
  892. package/src/slash/request-protocol.ts +87 -0
  893. package/src/slash/result-delivery.ts +312 -0
  894. package/src/slash/saved-chain.ts +115 -0
  895. package/src/slash/slash-bridge.ts +202 -156
  896. package/src/slash/slash-commands.ts +176 -598
  897. package/src/slash/slash-live-state.ts +287 -229
  898. package/src/tui/action-hints.ts +147 -61
  899. package/src/tui/activity-lines.ts +40 -0
  900. package/src/tui/agent-browser.ts +354 -0
  901. package/src/tui/agent-controls.ts +355 -0
  902. package/src/tui/agent-conversation.ts +514 -0
  903. package/src/tui/agent-dock.ts +250 -0
  904. package/src/tui/agent-history.ts +78 -203
  905. package/src/tui/agent-model.ts +78 -0
  906. package/src/tui/agent-picker.ts +325 -0
  907. package/src/tui/agent-view.ts +391 -1333
  908. package/src/tui/compact-results.ts +342 -0
  909. package/src/tui/conversation-details.ts +206 -0
  910. package/src/tui/conversation-frame.ts +184 -0
  911. package/src/tui/conversation-history.ts +246 -0
  912. package/src/tui/conversation-menu.ts +119 -0
  913. package/src/tui/conversation-notices.ts +116 -0
  914. package/src/tui/conversation-selection.ts +66 -0
  915. package/src/tui/conversation-viewport.ts +169 -0
  916. package/src/tui/direction-message.ts +35 -0
  917. package/src/tui/display.ts +409 -0
  918. package/src/tui/editor-viewport.ts +19 -0
  919. package/src/tui/expanded-content.ts +134 -0
  920. package/src/tui/expanded-multi.ts +264 -0
  921. package/src/tui/expanded-single.ts +92 -0
  922. package/src/tui/history-cards.ts +316 -0
  923. package/src/tui/history-display.ts +334 -0
  924. package/src/tui/history-json.ts +17 -0
  925. package/src/tui/history-metadata.ts +177 -0
  926. package/src/tui/history-record.ts +321 -0
  927. package/src/tui/history-text.ts +34 -0
  928. package/src/tui/indexed-history.ts +149 -0
  929. package/src/tui/nested-widget.ts +192 -0
  930. package/src/tui/picker-page.ts +80 -0
  931. package/src/tui/render.ts +100 -1546
  932. package/src/tui/result-facts.ts +99 -0
  933. package/src/tui/task-observation.ts +96 -0
  934. package/src/tui/task-store.ts +432 -0
  935. package/src/tui/text-values.ts +20 -0
  936. package/src/tui/view-connections.ts +64 -0
  937. package/src/tui/view-model.ts +181 -0
  938. package/src/tui/view-persistence.ts +57 -0
  939. package/src/tui/view-ports.ts +55 -0
  940. package/src/tui/view-session.ts +42 -0
  941. package/src/tui/widget-details.ts +220 -0
  942. package/src/tui/widget-status.ts +331 -0
  943. package/src/tui/widget.ts +208 -0
  944. package/src/tui/workflow-labels.ts +340 -0
  945. package/src/tui/workflow-outcomes.ts +150 -0
  946. package/tsconfig.build.json +11 -10
  947. package/tsconfig.json +30 -17
package/CHANGELOG.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.45.0] - 2026-10-11
4
+
5
+ ### Changed
6
+
7
+ - Refresh bundled role defaults. Claude Opus 5.5 at `xhigh` now drives planner, ui-designer, writer and reviewer-claude, with GPT-6.1 Sol as fallback. GPT-6.1 Sol at `xhigh` drives worker, fixer, debugger, researcher, context-builder, oracle and the reviewer, reviewer-gpt, reviewer-ponytail and reviewer-security roles; scout and delegate stay at `high`. Sol roles fall back to Opus 5.5, except fork-default oracle (Anthropic is ineligible for fork context) and reviewer-security (Opus refuses security review work), which fall back to `zai/glm-5.3`. Removed stale `anthropic/claude-opus-5`, `gpt-5.6-sol`, `gpt-6-astra` and `claude-fable-5-1` routes. Watcher is unchanged.
8
+ - Acceptance contracts now tell children to check early whether every criterion is verifiable in their environment and to report unreachable services, credentials, devices or tools right away instead of spending turns on workarounds; observed human-only boundaries still report as blocked. The skill tells parents to require only checks the child can run.
9
+ - Enforce strict Oxlint and Oxfmt rules through the published tools, editor configuration and CI. Refactor maintained code into focused owners, preserve native SDK contracts, and validate persisted run data at runtime boundaries. Package versions and user-facing behavior remain unchanged.
10
+
3
11
  ## [0.44.7] - 2026-10-09
4
12
 
5
13
  ### Fixed
14
+
6
15
  - Keep newer Agents history, including consumed human answers, from being overwritten by an older in-flight page. Recheck the owning session, index, selected attempt, source and published page before applying async history or saved-result reads; preserve requested paging and reading anchors when reloading an invalidated snapshot.
7
16
  - Consume refresh notifications received while the latest conversation page is loading, without pulling scrolled readers forward or automatically retrying history errors.
8
17
  - Emit the Intercom bridge `session_closed` audit record after broker disconnect completes and the closing session is removed; cancellation still rejects pending and new requests for that identity immediately.
@@ -10,6 +19,7 @@
10
19
  ## [0.44.6] - 2026-10-09
11
20
 
12
21
  ### Fixed
22
+
13
23
  - Keep full Agents pages available for long native histories by sharing bounded configuration results across rows and repeated queries. Committed publication, source generations and exact terminal/time/leaf boundaries invalidate reuse; strict errors and source integrity checks remain unchanged.
14
24
  - Restrict scoped saved-text search to eligible records before aggregating matches, retaining the complete corpus for global relevance scores, cross-field word matching, phrases, attempt boundaries and pagination.
15
25
  - Publish one settled-freshness notification for unchanged history census work instead of one per run/source. Real commits, canonical failures and source error/recovery observations still notify; polling, census and watches remain active.
@@ -17,22 +27,27 @@
17
27
  ## [0.44.5] - 2026-10-08
18
28
 
19
29
  ### Added
30
+
20
31
  - Optional loopback-only mTLS Intercom HTTPS bridge over SSH reverse forwarding, with certificate-bound remote peer identity, bounded messaging/inbox API, metadata audit logs, remote CLI, and credential issue/rotation/revocation tooling. The same-machine broker and extension startup remain unchanged.
21
32
 
22
33
  ### Fixed
34
+
23
35
  - Keep supervisor-question tool results bounded: page compact question/answer previews without repeating frozen launch metadata or native attempt baselines. Full question, interview and immutable answer files remain available; answering, cancellation and revival retain their original durable contracts.
24
36
  - Keep the history worker's cost per child append proportional to the new bytes. It used to re-hash every indexed byte of a linked session on each change, so a live child writing to a source of several hundred megabytes held the worker at full CPU for hours. Each check now re-hashes the last indexed line. Replacement, truncation and in-place rewrites of that line still start a new generation, and detail reads still verify their record digests. Indexes from earlier releases are verified in full once and then switch to the bounded check without re-indexing.
25
37
 
26
38
  ## [0.44.4] - 2026-10-04
27
39
 
28
40
  ### Added
29
- - Publish the maintained project as `@fitchmultz/pi-subagents` with public npm delivery from its repository pipeline. The unscoped npm package is unrelated; existing Git installs and release refs remain supported.
41
+
42
+ - Publish the maintained project as `@fitchmultz/pi-subagents` with public npm delivery from its repository pipeline. Existing Git installs and release refs remain supported.
30
43
  - Discover specialist profiles declared by configured packages through `subagents.agents`. Package profiles are read-only fallbacks between builtins and user/trusted-project overrides, including installed `@fitchmultz/pi-workflows` recipes. User-installed package skills remain available even in untrusted projects; project skill sources stay trust-gated.
31
44
 
32
45
  ### Changed
46
+
33
47
  - Resolve latest stable official Pi and maintained fork main once per qualification run, retaining native, Git production-build, packed-install and full CI contracts without below-floor skip routes.
34
48
 
35
49
  ### Fixed
50
+
36
51
  - Admit cold WAL conversion through SQLite's native writer lock so a briefly overlapping writer no longer causes a lost timing sample; preserve the existing bounded timeout, private storage and per-agent retention bounds.
37
52
  - Ignore delayed native filesystem hints for an already indexed physical source and replace stale directory watches before publishing catch-up readiness, preserving real pending work, forced refreshes and changed/deleted source recovery.
38
53
  - Preserve timing samples and history writes when SQLite removes another connection's WAL sidecars during a cold open, without relaxing file permissions or storage-error handling.
@@ -43,29 +58,35 @@
43
58
  ## [0.44.3] - 2026-10-02
44
59
 
45
60
  ### Changed
61
+
46
62
  - Remove the resource-ownership footer for held, released and disconnected topics. Current ownership remains available through `/intercom topics` and the Intercom tool; publication, subscriptions, saved state and release notifications are unchanged.
47
63
 
48
64
  ## [0.44.2] - 2026-10-02
49
65
 
50
66
  ### Changed
67
+
51
68
  - Simplify internal runtime boundaries by removing obsolete test-only exports and dependency-injection paths. Supported delegation, controls, receipts, continuation, shutdown and broker behavior are unchanged.
52
69
  - Audit the full test surface: retain meaningful native and security contracts, consolidate duplicate mock/helper layers, and check actual publication, readiness and rendered output. Isolate each native test process's storage so parallel fixtures cannot remove another runner's results.
53
70
 
54
71
  ## [0.44.1] - 2026-10-02
55
72
 
56
73
  ### Fixed
74
+
57
75
  - Keep saved-run browsing and Agents history available for deeply branched native sessions. Traverse each child’s indexed ancestry before joining its messages, avoiding repeated whole-index scans without changing branch selection, history boundaries, privacy or billing.
58
76
 
59
77
  ### Changed
78
+
60
79
  - Clarify the performance guide’s full-step and per-step `maxItems` alternatives.
61
80
  - Update development tooling to Node 24.21.0 typings and TypeBox 1.3.34 with a regenerated lockfile; runtime Pi and TypeBox remain optional host-provided peers.
62
81
 
63
82
  ## [0.44.0] - 2026-10-01
64
83
 
65
84
  ### Added
85
+
66
86
  - Browse owned saved runs through an off-thread private SQLite index: global task/agent/state filters, attention/newest/oldest ordering, bounded cursors, native history pages and lexical visible-text search. Index observations report catch-up/degraded freshness and never replace canonical ownership, controls, receipts or billing evidence.
67
87
 
68
88
  ### Changed
89
+
69
90
  - Load the Agents picker in 50-run pages and selected conversations in 100-physical-record pages. Retain full-assignment filtering, full validated reports/details/Reply, drafts, saved/unread anchors, exact-child controls and same-parent reload. Explicit history navigation supersedes stale loads; unavailable detail notices cannot become quoted evidence.
70
91
  - Require Pi 1.0.0 and Node 24.21.0. Pin the coherent official development cohort while keeping Pi packages optional runtime peers; runtime-only SDK and bundled CLI installations need no private Pi copy.
71
92
  - Remove retired fork checkpoint, immediate-usage, metadata/revision, sibling-branch and native pending-call branches. Keep durable detached owners, saved questions/results/delivery and legacy usage deduplication. Attribute new child usage only through finalized native tool results.
@@ -73,6 +94,7 @@
73
94
  - Share verified parent receipt snapshots within synchronous recovery batches only, refreshing after appends and never across awaits. Poll visited terminal Agents metadata only when relevant or changed, retaining drafts, unread/results and full selected history.
74
95
 
75
96
  ### Fixed
97
+
76
98
  - Preserve every admitted completion notification while any native pending batch remains, including multiple completions retained across abort and reload. A next-batch preview cannot cause a watcher resend; matching published receipts retire consumed identities, and genuinely empty queues allow recovery. Individual removal while other queue items remain is unobservable, so ambiguous admissions stay pending.
77
99
  - Retain legacy-only completion files until matching verified parent publication, not native queue admission. Recover an accepted but unpersisted completion after a process crash without replaying a published receipt or fabricating run ownership.
78
100
  - Keep session startup responsive while recovering saved runs, unanswered questions and Intercom receipts. Replay recovery and queued message delivery in small batches and use asynchronous retention cleanup without changing ownership, verified delivery or the host's performance-warning budget. Preserve directory snapshots, session-name registration and in-flight completions across asynchronous startup and shutdown.
@@ -89,12 +111,14 @@
89
111
  ## [0.43.1] - 2026-09-30
90
112
 
91
113
  ### Changed
114
+
92
115
  - Pin the development Pi cohort to 0.99.1 and selected-host TypeBox 1.3.27; preserve optional runtime peers, Node 24 and durable formats. Document current public checkpoints/usage separately from legacy retired pending-call execution.
93
116
  - Keep native journal/model/streaming checks independent of mutable catalog entries and account for early host metadata persistence and fork discovery tools.
94
117
  - Make profile model/thinking defaults visible in ordinary discovery and document warranted per-run overrides as `model: "provider/model:high"`. Explicit overrides pin the route and effort without profile fallbacks; ordinary launches retain configured backups. Saved continuations preserve that policy, while explicitly selecting a current profile adopts its current model, thinking and fallbacks.
95
118
  - Align packaged role profiles with the maintainer's personal defaults, using GPT-6.1 Sol at high effort for scout/writer/delegate and xhigh for context-builder/fixer/Ponytail review, Luna for watching, Astra for security review, and Opus for independent Claude review. Editable user/project overrides still take precedence. Consolidate runtime coordination mechanics in the extension and require exact relevant owner instructions, settled decisions or readable source references in fresh-child handoffs.
96
119
 
97
120
  ### Fixed
121
+
98
122
  - Stop rebuilding completed Agents histories and formatting collapsed tool details on every background refresh. Skip superseded continuations, cache terminal boundaries and unchanged corrupt sources, and bound conversation components to the displayed page while preserving full history, replies, drafts, pinning, transient-I/O recovery, and explicit details.
99
123
  - Consume new native observations and index message identities instead of repeatedly scanning growing child transcripts. Preserve inherited billing boundaries and exclude baseline messages from the current attempt's observation matching.
100
124
  - Check acceptance-boundary readiness before filtering accumulated messages. Keep durable nested-event deduplication for every retained event, and project nested state only once per job poll.
@@ -108,19 +132,23 @@
108
132
  ## [0.43.0] - 2026-09-27
109
133
 
110
134
  ### Changed
135
+
111
136
  - Keep fresh coordination schemas lean: delegation exposes run controls automatically; `load_subagent({ advanced: false })` discovers profiles/history without the advanced schema, and `load_intercom({})` enables peer coordination explicitly. Restore controls for actionable owned work and peer reply needs while preserving broker presence, full schemas, native selection, tool policies, and managed-child supervisor contact.
112
137
 
113
138
  ## [0.42.1] - 2026-09-26
114
139
 
115
140
  ### Changed
141
+
116
142
  - Avoid unnecessary peer-listing model rounds for routine standalone read-only tasks. Keep coordination guidance before shared-state changes or known overlapping work, with unchanged count-free prompt caching, broker presence, message delivery, approvals, and child recovery on official Pi 0.87.1 and the fork.
117
143
 
118
144
  ## [0.42.0] - 2026-09-26
119
145
 
120
146
  ### Breaking Changes
147
+
121
148
  - Require Node 24 or later. CI and the shared compatibility fleet qualify only Node 24.
122
149
 
123
150
  ### Changed
151
+
124
152
  - Install and update from Git without downloading Pi's development graph: the `prepare` lifecycle now installs only the pinned TypeScript compiler into a temporary directory and emits without typechecking, instead of installing and pruning the full Pi development graph. Emitted `dist/` is byte-identical. Typechecking moved to `npm run typecheck`, `check:compat`, and CI.
125
153
  - Build and typecheck with TypeScript 7.0.2 targeting ES2025. `verbatimModuleSyntax` and `erasableSyntaxOnly` now enforce the syntax Node's type stripping runs.
126
154
  - Develop and qualify against official Pi 0.87.1 and the `fitchmultz/pi` fork at `06a19597`, with `typebox` 1.3.34 and `@types/node` 24.19.0. Renovate keeps `@types/node` on 24.x.
@@ -129,11 +157,13 @@
129
157
  ## [0.41.0] - 2026-09-25
130
158
 
131
159
  ### Changed
160
+
132
161
  - Sync bundled role routing with the maintainer's active profiles. Every role except `reviewer-claude` and `delegate` now prefers GPT-6 Astra through a ChatGPT/Codex subscription (`openai-codex`) at medium thinking, falling back to the OpenAI API route, so either account works. `reviewer-claude` uses Claude Opus 5.5 at high thinking, falling back to Fable 5.1 and then Cloudflare AI Gateway Opus 5, the newest Claude that official Pi's gateway catalog names with a working id. Unknown gateway ids are not skipped on official Pi, so the chain avoids them.
133
162
  - Start delegation-enabled children with compact `delegate`, `agent_runs`, and `load_subagent` tools. Full advanced workflows load on demand, explicit `tools: subagent` profiles stay eager, and `compactChildTools: false` restores the prior child surface. Nested execution defaults, permissions, durable ownership, and native result accounting are preserved.
134
163
  - Stop writing streaming `message_update` deltas and cumulative `tool_execution_update` progress to durable `events.jsonl` run records. They were most of the record volume, and final `message_end` and `tool_execution_end` events still record the same content. In-process event consumers still receive every event.
135
164
 
136
165
  ### Fixed
166
+
137
167
  - Stop treating `~/.pi` agents, chains and settings as project resources for directories below home. Like Pi, they apply only when the cwd is home itself; stray files there previously replaced built-in agents such as `delegate` in every project without its own `.pi`.
138
168
  - Reserve Intercom's reply waiter before sending concurrent asks, so a rejected contender neither sends its question nor cancels the active wait.
139
169
  - Include the current run ID and predecessor in final continuation and answer results, including recovered native waits.
@@ -159,6 +189,7 @@
159
189
  ## [0.40.1] - 2026-09-22
160
190
 
161
191
  ### Fixed
192
+
162
193
  - Restore owned runs from lightweight ownership metadata and shared decoded records, avoiding full reads of unrelated history while retaining legacy recovery and late-published runs.
163
194
  - Keep restored ownership and controls ready for immediate native tool resume, including nested children.
164
195
  - Reuse native transcript snapshots for Agents status, model selection, unread markers, and conversation history. Format full conversations when opened, retaining all saved messages, tool details, and reading positions.
@@ -168,6 +199,7 @@
168
199
  ## [0.40.0] - 2026-09-22
169
200
 
170
201
  ### Changed
202
+
171
203
  - Use one durable detached owner for single, parallel, chain, and continued runs, with a shared Pi JSON CLI/Claude Code child-attempt lifecycle. Foreground calls now wait on the same saved work instead of using separate execution engines.
172
204
  - Keep Pi acceptance self-review in the same child process and submit a typed answer/report. Retain current-attempt evidence, bounded repair, human-only blockers, and cancellable owner-run verification when configured.
173
205
  - Give everyday delegation/control tools strict-compatible acceptance criteria and environment fields while retaining arbitrary schemas and detailed overrides in the lazy advanced tool.
@@ -175,20 +207,24 @@
175
207
  - Use native prompt sections and allow delegation-enabled children to use useful helpers within their assigned scope and depth limit. Retain their tool history; bundled profiles remain leaf-only.
176
208
 
177
209
  ### Added
210
+
178
211
  - Optional native asynchronous results bound to the original pending call across parent restart, compaction, and branch navigation, gated by actual host/model capability. Portable receipts and abort-aware waiting remain available; native delivery suppresses duplicate completion notices.
179
212
  - Idempotent parent usage contributions on hosts with `recordUsage`, with once-only finalized tool-result accounting on portable hosts. Inspection stays read-only; inherited history and nested usage are not counted twice.
180
213
 
181
214
  ## [0.39.1] - 2026-09-22
182
215
 
183
216
  ### Fixed
217
+
184
218
  - Recognize verified file changes from `apply_patch`, `replace_text`, and `write_files` in the completion guard, including partial publication followed by an error. Previews, unchanged files, and missing receipts do not count as completed mutations; legacy editing tools remain supported.
185
219
 
186
220
  ## [0.39.0] - 2026-09-21
187
221
 
188
222
  ### Added
223
+
189
224
  - Use the directory selected by `pi-change-working-dir` for tool and slash-command delegation, agent discovery, command completion, and relative cwd overrides. Capture the directory once before asynchronous preparation.
190
225
 
191
226
  ### Fixed
227
+
192
228
  - Initialize new forks and explicit saved-child cwd overrides through the directory owner before the first model request, without rewriting parent or child history. Ordinary continuation preserves the child's later directory selections.
193
229
  - Reject delegation when a loaded directory owner is incompatible or cannot resolve the selected directory. Fresh, forked, and resumed children validate their owner before provider or tool dispatch; run inspection and control remain available without resolving the parent's directory.
194
230
  - Undo explicit cwd requests rejected before launch so they cannot affect a later ordinary continuation.
@@ -196,18 +232,21 @@
196
232
  ## [0.38.2] - 2026-09-19
197
233
 
198
234
  ### Fixed
235
+
199
236
  - Resume saved children in a different directory on released Pi through its native SDK cwd override, preserving session identity and history. Normal launches and same-directory resumes remain unchanged.
200
237
  - Resolve explicitly selected direct MCP tools from the independent Fitch adapter's configuration and metadata namespace while retaining pre-v5 Fitch state support. Default configured tool and extension inheritance remains unchanged.
201
238
 
202
239
  ## [0.38.1] - 2026-09-18
203
240
 
204
241
  ### Fixed
242
+
205
243
  - Activate the structured-output capture tool after a saved session resumes, preserving the host's active tool selection.
206
244
  - Omit redundant `--session-cwd` overrides for preassigned new child sessions (including acceptance contracts) and saved children in the same physical directory, including symlink/trailing-slash spellings, allowing ordinary official-Pi launches and resumes. Real directory changes and uncertain existing headers still use the native override without rewriting history. Read only the session header rather than the full transcript when checking its directory.
207
245
 
208
246
  ## [0.38.0] - 2026-09-15
209
247
 
210
248
  ### Added
249
+
211
250
  - Carry the authoritative root Pi session ID through existing foreground/background launch and nested delegation without changing the parent's process environment. Saved children inherit the reviving parent's root.
212
251
  - A task-labelled Agents area, configurable Option+Shift+M (Alt+Shift+M) and `/agents`, with native-editor conversations, full saved history, contextual replies, tool details/diffs, unread navigation, preserved drafts and one optional pin. Fullscreen task clicks open the selected child; viewing finished work never starts it.
213
252
  - Verified human-origin direct messages to owned children, distinct broker and native-conversation receipts, and small parent information breadcrumbs. Waiting questions use the existing durable answer path.
@@ -216,9 +255,11 @@
216
255
  - Opt-in Intercom topics with quiet current-state records, self-contained coalesced updates and advisory resource-owner display. Only blockers, decisions, awaited explicit releases and direct messages interrupt; disconnect never implies release.
217
256
 
218
257
  ### Changed
258
+
219
259
  - **Breaking:** Preserve the backend base prompt, project instructions, and discovered skills for agents by default while keeping fresh conversation context and nested delegation disabled. Custom profiles can explicitly restore the previous isolated prompt policy.
220
260
 
221
261
  ### Fixed
262
+
222
263
  - Make `skill: false` disable inherited skills across foreground, async, parallel, chain, and resumed runs.
223
264
  - Keep Claude Code children leaf-only and map supported project-context and skill isolation settings to Claude Code CLI flags.
224
265
  - Remove the public `wait` action from `agent_runs` and `subagent`. Parents continue useful work or end the turn for automatic completion delivery, including when child evidence gates an incomplete goal; explicitly chosen foreground execution remains available.
@@ -240,21 +281,25 @@
240
281
  ## [0.37.2] - 2026-09-09
241
282
 
242
283
  ### Fixed
284
+
243
285
  - Let bundled `delegate` use Pi’s configured tools and extensions, like the other bundled profiles. Preserve configured and inherited direct MCP tools in all Pi children unless the profile explicitly selects them; explicit allowlists and nested-delegation limits remain unchanged.
244
286
 
245
287
  ## [0.37.1] - 2026-09-07
246
288
 
247
289
  ### Fixed
290
+
248
291
  - Skip unrelated sessions before nested-run discovery during startup and the first restore poll, preserving matching jobs and their reconciliation.
249
292
 
250
293
  ## [0.37.0] - 2026-09-07
251
294
 
252
295
  ### Added
296
+
253
297
  - Honor native Pi compact view for ordinary Intercom messages, subagent notifications, and slash-command results: one content row plus Pi's existing spacer. The optional mode defaults off; native expansion reveals full details, while questions, reply guidance, and needs-attention notices stay prominent. Normal presentation, message content, history, and delivery behavior are unchanged.
254
298
 
255
299
  ## [0.36.1] - 2026-09-07
256
300
 
257
301
  ### Fixed
302
+
258
303
  - Accept current validated finalization reports after successful native retries or settled-process cleanup, while preserving actual process and final assistant failures.
259
304
  - Require native Pi `952c27cd6` for correct prompt admission and settlement; verify rejected input and queued startup without receiver replay.
260
305
  - Deliver idle intercom batches in one wake while preserving the selected ask as the default reply target.
@@ -272,10 +317,12 @@
272
317
  ## [0.36.0] - 2026-09-06
273
318
 
274
319
  ### Added
320
+
275
321
  - Attention-first, paged owned-run lists and explicit parent review (`accepted` or `needs_changes`), separate from execution, acceptance checks, and notification.
276
322
  - Persistent root/predecessor/continuation history and inspectable effective launch configuration with profile provenance.
277
323
 
278
324
  ### Fixed
325
+
279
326
  - Deliver intercom messages once by reconciling native queues and full-session receipts. Recover pending steers, follow-ups, and latest milestones after a cold restart without replaying consumed messages or waking passive-only restores.
280
327
  - Remove artificial message-count caps from broker replace queues, accepted-message recovery, and pending asks; retain milestone coalescing and ordinary peer ask timeouts.
281
328
  - Share same-model retry/fallback, acceptance finalization, and execution outcome rules across foreground and detached hosts, preserving cancellation, timeout, resource-limit, fail-fast, and user-pause outcomes.
@@ -293,6 +340,7 @@
293
340
  - Stop smoke-test parents, detached workers, and their private broker before removing copied credentials or artifacts, including timeout and handled cancellation.
294
341
 
295
342
  ### Changed
343
+
296
344
  - Keep delegation receipts, subagent responses, and completion messages compact by default. Native expansion reveals full responses and receipt details without changing model-visible content.
297
345
  - Require a corrected native `fitchmultz/pi` build containing `acf4c2d98ec44de2108f16a47bf59de5193341a7` for full durable-runtime support. Stock Pi 0.84.x and 0.85.1 do not satisfy the custom-queue contract; the 0.85.1 development pins are not proof of the fix.
298
346
  - Require a full Pi process restart after code updates, then resume the same saved parent to retain ownership and pending coordination; do not rely on `/reload` to activate changed code.
@@ -301,11 +349,13 @@
301
349
  ## [0.35.0] - 2026-09-06
302
350
 
303
351
  ### Added
352
+
304
353
  - Compact `delegate` and `agent_runs` tools for ordinary delegation, owned-run discovery, inspection, nudges, continuation, and stopping without loading the advanced workflow schema.
305
354
  - Durable supervisor questions and immutable answers, recoverable by the owning saved session after reload or child exit, with launch-time acceptance, output paths, and structured schemas preserved on revival.
306
355
  - Credential-free Linux validation on the supported Node floor and current Node, plus stronger real-Pi tool, settlement, and model-identity checks.
307
356
 
308
357
  ### Fixed
358
+
309
359
  - Use one run identity across foreground, background, and clarify-to-background paths; retain completed owned work across cwd changes and keep late nudges from restarting it.
310
360
  - Share child-process lifecycle handling, wait for native Pi settlement, stop descendant processes on cancellation, and distinguish explicit supervisor-question detachment from interruption.
311
361
  - Keep the full foreground operation alive through supervisor questions during initial execution or finalization; release only the parent wait and retain real completion/control state.
@@ -315,22 +365,26 @@
315
365
  - Keep deferred material updates until delivered or superseded, distinguish busy-peer refusal from successful delivery, and expose unconsumed intercom messages.
316
366
 
317
367
  ### Changed
368
+
318
369
  - Completion mutation checks are explicitly opt-in with `completionGuard: true`; task prose no longer determines whether a valid answer must edit files.
319
370
  - Support macOS and Linux only; remove Windows-specific runtime branches and old package promotional branding while retaining required license notices.
320
371
 
321
372
  ## [0.34.18] - 2026-09-05
322
373
 
323
374
  ### Fixed
375
+
324
376
  - Pass Pi task arguments larger than 900 UTF-8 bytes through native `@file` input, counting the complete `Task: ` prefix, and keep system instructions in a separate `system.md` within each unique temporary directory, avoiding task collisions and filename limits for long agent names. Thanks to @tribble for [#54](https://github.com/fitchmultz/pi-subagents/pull/54).
325
377
 
326
378
  ## [0.34.17] - 2026-09-04
327
379
 
328
380
  ### Fixed
381
+
329
382
  - Reuse rendered inline intercom messages at unchanged terminal widths instead of rewrapping and recoloring every frame; refresh on resize and theme changes without shortening messages.
330
383
 
331
384
  ## [0.34.16] - 2026-09-03
332
385
 
333
386
  ### Changed
387
+
334
388
  - Sync the bundled role profiles with the current Fitch overrides, including Astra routes, Claude Fable 5.1, Grok 4.6, fallback order, and thinking levels; preserve scout and watcher routes and delegate's inherited model.
335
389
  - Ground reviewer findings in the original request and concrete evidence, without speculative findings or a mandatory disposition taxonomy.
336
390
  - Explicitly disable nested delegation in every bundled profile and keep reviewer delegation with the parent.
@@ -339,63 +393,75 @@
339
393
  ## [0.34.15] - 2026-08-27
340
394
 
341
395
  ### Changed
396
+
342
397
  - Disable nested child delegation by default: the main session may launch subagents, but those children cannot launch more sessions; bundled orchestration guidance now keeps all fanout parent-owned.
343
398
 
344
399
  ## [0.34.14] - 2026-08-26
345
400
 
346
401
  ### Fixed
402
+
347
403
  - Suppress npm stderr while probing global packages so npm config warnings do not leak into the Pi TUI during skill discovery.
348
404
 
349
405
  ## [0.34.13] - 2026-08-26
350
406
 
351
407
  ### Changed
408
+
352
409
  - Scope intercom list/status discovery and the session overlay to the current Git repository and its worktrees by default, with explicit `scope: "all"` and `/intercom all` paths for intentional cross-project discovery.
353
410
 
354
411
  ## [0.34.12] - 2026-08-25
355
412
 
356
413
  ### Changed
414
+
357
415
  - Route the six agents that previously used `openai/gpt-5.6-sol` through `cloudflare-ai-gateway/gpt-5.6-sol`, with direct OpenAI moved to the front of each existing fallback list.
358
416
 
359
417
  ## [0.34.11] - 2026-08-25
360
418
 
361
419
  ### Fixed
420
+
362
421
  - Ignore reserved `AGENTS.md` instruction files during recursive subagent discovery.
363
422
 
364
423
  ## [0.34.10] - 2026-08-20
365
424
 
366
425
  ### Changed
426
+
367
427
  - Sync the bundled role routes with the active Fitch profile overrides: `context-builder` defaults to gateway Fable at medium thinking; `debugger`, `fixer`, `planner`, `reviewer`, `reviewer-claude`, and `ui-designer` default to gateway Fable at high thinking.
368
428
 
369
429
  ## [0.34.9] - 2026-08-18
370
430
 
371
431
  ### Changed
432
+
372
433
  - Load the full `subagent` tool schema only when delegation is requested, while keeping the small `load_subagent` discovery tool active and preserving the existing orchestration guidance at load time.
373
434
  - Respect Pi tool allowlists and exclusions, and reset deferred activation after compaction so guidance is restored on the next load.
374
435
 
375
436
  ## [0.34.8] - 2026-08-16
376
437
 
377
438
  ### Changed
439
+
378
440
  - Rename the foreground control module so it no longer shares a filename with shared control helpers, and move the four run-path functions into their own files. Public tool behavior is unchanged.
379
441
 
380
442
  ## [0.34.7] - 2026-08-16
381
443
 
382
444
  ### Changed
445
+
383
446
  - Split the foreground executor into params, control, and path modules, and moved shared worktree-summary and duplicate-output-path helpers into the existing worktree and single-output modules. Public tool behavior is unchanged.
384
447
  - Drop the resolved per-agent context note and the leftover peer-hint "counts only" wording now that the hint is a constant string.
385
448
 
386
449
  ## [0.34.6] - 2026-08-16
387
450
 
388
451
  ### Fixed
452
+
389
453
  - Count mutating-tool failures for `needs_attention` only when the tool result sets `isError: true`. Successful commands whose output happens to contain words like `error` or `failed` (for example `git diff > /tmp/...`) no longer page the parent.
390
454
 
391
455
  ## [0.34.5] - 2026-08-16
392
456
 
393
457
  ### Changed
458
+
394
459
  - Sync bundled Fitch role profiles to the current user routes: Claude primaries go through `cloudflare-ai-gateway/` with direct Anthropic fallbacks, `reviewer-claude` and `writer` use Fable, `researcher` uses `openai/gpt-5.6-sol`, and `oracle`, `reviewer-gpt`, `reviewer-claude`, and `worker` use `xhigh` thinking.
395
460
 
396
461
  ## [0.34.4] - 2026-08-14
397
462
 
398
463
  ### Changed
464
+
399
465
  - Build cleanup is uniformly best-effort, so a locked staging tree cannot turn a successful concurrent race loss into failure or mask the compiler/publish error that matters.
400
466
  - `scripts/build.mjs` now separates stranded-tree reaping, compilation, and publication behind named retry/cleanup constants and helpers while preserving the cross-repo build contract.
401
467
  - `scripts/prepare.mjs` structurally preserves the original build error when the final dev-dependency prune also fails; the prune warns and may leave the dev toolchain for manual cleanup.
@@ -405,6 +471,7 @@
405
471
  ## [0.34.3] - 2026-08-14
406
472
 
407
473
  ### Changed
474
+
408
475
  - `dist/` is now published by retrying this build's own `rename` instead of waiting on another build. A rename failure yields only when `dist/` already exists (an existence check, not an errno check, so platforms that report a different code for rename-onto-existing-directory still behave correctly); otherwise the staging tree is retained and the rename retried, so this build can publish its own output rather than wait on a concurrent winner's scheduling. This replaces the bounded poll shipped in 0.34.2, which could still fail a build whose concurrent winner was descheduled past the poll window.
409
476
  - Staging-reaper documentation now states its precise guarantee: only pids already gone at probe time are eligible; pid reuse between probe and removal remains inherent to pid-based reaping.
410
477
  - Swap coverage now includes the deterministic slow-winner regression, and concurrent-storm failures surface the build's stderr instead of only its exit code.
@@ -412,6 +479,7 @@
412
479
  ## [0.34.2] - 2026-08-14
413
480
 
414
481
  ### Changed
482
+
415
483
  - `scripts/build.mjs` now reaps `dist.staging.<pid>` directories stranded by dead builds (SIGKILL or crash mid-emit) at the start of every build, using a signal-0 liveness probe so live concurrent builds are never touched. Reaping is best-effort: an unreapable strand warns instead of failing the build.
416
484
  - The race-loss check now polls briefly for a mid-swap concurrent winner before declaring failure, closing the review-identified window where a losing build could spuriously exit 1 while the winner was between its own `rm` and `rename` (reproduced by the new storm test before the fix).
417
485
  - `scripts/prepare.mjs` prunes the dev toolchain in a `finally` (even when the build fails) and forwards build output on success, so install-time diagnostics such as the concurrent-swap race-loss warning are no longer swallowed.
@@ -420,11 +488,13 @@
420
488
  ## [0.34.1] - 2026-08-14
421
489
 
422
490
  ### Changed
491
+
423
492
  - `scripts/build.mjs` now emits into a pid-scoped `dist.staging.<pid>` directory and atomically swaps it into `dist/`. A failed build preserves the previous working dist, concurrent builds cannot clobber each other or swap a partial emit into place, and a build that loses the swap race to a concurrent winner normally exits 0 (the winner's tree is an equivalent fresh emit; a narrow timing window can still surface the loss as a loud failure). `rm(dist)` failures always fail loudly. Ports the build hardening reviewed in pi-cursor-sdk v0.3.0.
424
493
 
425
494
  ## [0.34.0] - 2026-08-13
426
495
 
427
496
  ### Changed
497
+
428
498
  - The Pi extension manifest now loads precompiled `dist/extension/index.js` and `dist/pi-intercom/index.js` instead of transpiling the ~32kloc TypeScript graph at every pi startup. A `prepare` lifecycle script builds `dist/` on install and update, including Pi's `npm install --omit=dev` git-install flow.
429
499
  - Runtime sibling-module paths (intercom bundled extension, broker, async runner/launcher, local fork start command, and the child `--extension` paths in `pi-args.ts`) now resolve `.ts` vs `.js` from the running module's own extension, so both source and compiled layouts work. The package smoke asserts the compiled child `--extension` paths exist.
430
500
  - Install-lifecycle hardening: the dependency probe checks `node_modules` paths directly, npm runs through `process.execPath` with no shell, prepare fails closed without `npm_execpath`, and the dev toolchain is pruned back to runtime-only dependencies after install-time builds.
@@ -432,25 +502,30 @@
432
502
  ## [0.33.7] - 2026-08-13
433
503
 
434
504
  ### Fixed
505
+
435
506
  - Bound outstanding inbound redelivery to the same 100-message recipient queue limit.
436
507
 
437
508
  ### Changed
509
+
438
510
  - Document that Esc before consume re-delivers steered intercom messages after the turn settles.
439
511
 
440
512
  ## [0.33.6] - 2026-08-13
441
513
 
442
514
  ### Fixed
515
+
443
516
  - Re-deliver inbound intercom steers and follow-ups after the recipient aborts, including a second Esc, so unconsumed peer messages are not dropped.
444
517
  - Retry detached runner startup when an in-place extension update temporarily removes its runtime dependencies.
445
518
 
446
519
  ## [0.33.5] - 2026-08-11
447
520
 
448
521
  ### Fixed
522
+
449
523
  - Isolate the temp-root cleanup unit test even when run directly, preventing its fake active async run and nested routes from leaking into the shared startup-discovery directory.
450
524
 
451
525
  ## [0.33.4] - 2026-08-11
452
526
 
453
527
  ### Fixed
528
+
454
529
  - Garbage-collect `nested-subagent-events` route directories in startup retention: they accumulated forever, and startup job restore readdir'd the pile once per async run (O(runs × routes)), putting most of startup CPU in `readdir` on a bloated temp root. Routes are removed after the same 7-day window, but stay while writes still land inside them (live nested descendants, foreground roots) or while their root run is active, and operational read failures now fail closed instead of deleting live state.
455
530
  - Stop the peer-awareness hint from invalidating the provider prompt cache: the hint is now a constant count-free string, pinned for the rest of the session once peers are first seen, so fleet churn (session spawns/exits, subagent children joining the broker) no longer rewrites the system prompt between turns. Pinned turns also skip the per-turn broker list round trip. Measured on 2026-08-10 (13:12-19:12Z) across one fleet: 52 run-boundary full-context hot-cache misses (~$91, upper bound) attributable to the varying count; a further 38 mid-run misses (~$66) were provider-side eviction/routing and are unaffected by this fix.
456
531
  - Keep composed tool-schema constraints compatible with Fireworks-hosted models without weakening validation for other providers.
@@ -458,17 +533,20 @@
458
533
  ## [0.33.3] - 2026-08-09
459
534
 
460
535
  ### Changed
536
+
461
537
  - Sync the bundled Fitch role profiles to the current tuned model, fallback, and thinking defaults while preserving role-specific model diversity and reserving `openai-codex/` routes for fallback billing pools.
462
538
  - Treat `context-builder`, `reviewer`, and `reviewer-ponytail` as fresh-context-only after their synced routes gained Anthropic primaries or fallbacks; use a fork-eligible role such as `oracle` or `scout` for branched-session work.
463
539
 
464
540
  ## [0.33.2] - 2026-08-08
465
541
 
466
542
  ### Fixed
543
+
467
544
  - Stop children that repeat an identical failed `subagent` call five times within the recent subagent-call window, including rejected nested delegations that previously ran until timeout, without blocking successful repeated calls.
468
545
 
469
546
  ## [0.33.1] - 2026-08-08
470
547
 
471
548
  ### Fixed
549
+
472
550
  - Keep the required `structured_output` tool enabled when a child agent defines an explicit tool allowlist.
473
551
  - Render multiline doctor and management results as readable, expandable slash-command cards instead of truncating the whole report as one terminal line.
474
552
  - Tell nested orchestrators when a foreground child call has completed so model-sensitive loops do not relaunch the same successful task.
@@ -477,14 +555,17 @@
477
555
  ## [0.33.0] - 2026-08-08
478
556
 
479
557
  ### Added
558
+
480
559
  - Deliver the eventual grouped result when a foreground child detaches for a blocking supervisor reply and later exits, retain a compact remembered fallback when intercom delivery is unavailable, and keep isolated worktrees alive until detached children finish so their final changes are captured before cleanup.
481
560
 
482
561
  ### Changed
562
+
483
563
  - Align the bundled agent model, fallback, and thinking defaults with the current user profiles: lower `reviewer-gpt` and `reviewer-claude` to high thinking, route `reviewer-security` through Grok first, and move `watcher` to GPT-5.6 Sol at medium thinking.
484
564
  - Tighten the public tool schema, saved workflow parsing, agent scope handling, and management config validation so malformed or ambiguous requests fail before child launch while preserving acceptance overrides on resume. Unknown tool fields and empty explicit task strings now fail validation instead of being ignored.
485
565
  - Make the async widget reflow against its live width and Ctrl+O state, keep terminal failures visible, and bound expanded rows more conservatively on short terminals.
486
566
 
487
567
  ### Fixed
568
+
488
569
  - Terminate complete child process groups with guarded SIGKILL escalation, route async interrupts through run-owned control files instead of persisted PIDs, interrupt every active parallel child, and keep a real failure authoritative when fail-fast cancels running static or dynamic parallel siblings.
489
570
  - Honor custom `chainDir` in detached chains and use the shared chain directory consistently for default async chain reads, outputs, `{chain_dir}`, and progress; resolve top-level parallel reads, outputs, and progress in each task cwd; handle empty dynamic fanout without leaking phantom status rows; create `progress.md` without clobbering concurrent work; and fail runs when requested outputs cannot be saved.
490
571
  - Preserve Claude Code structured output through native JSON Schema mode, enforce per-criterion acceptance evidence, bound verifier output accumulation, and detect content changes to pre-existing output files.
@@ -496,12 +577,15 @@
496
577
  ## [0.32.0] - 2026-08-06
497
578
 
498
579
  ### Added
580
+
499
581
  - New builtin `reviewer-ponytail` agent: reviews a diff for over-engineering and slop, governed by the user-installed `ponytail` skill when present. Findings proposing a cut must name a behavior-preserving replacement; intended functionality always wins over compliance.
500
582
 
501
583
  ### Fixed
584
+
502
585
  - Restore active async runs to the TUI widget after `/reload` and after reopening the originating Pi session, using the existing on-disk status files instead of losing them with the extension's in-memory tracker.
503
586
 
504
587
  ### Changed
588
+
505
589
  - Require Pi 0.84.0 or later, pin development validation to the released 0.84.0 packages, and verify the extension/package APIs against the 0.84.0 docs, implementation, and emitted types while retaining optional wildcard Pi peers for package loading.
506
590
  - Consume Pi 0.84 child JSON streams through authoritative `message_end` events, including `toolResult` messages, instead of the removed `tool_result_end` compatibility event so mutation tracking and completion guards see finalized tool results.
507
591
  - Use Pi 0.84's default `pi-ai` type exports, required context methods, and readonly session manager contract instead of compatibility entrypoints, pre-0.84 context fallbacks, and private session persistence internals.
@@ -513,39 +597,47 @@
513
597
  ## [0.31.0] - 2026-08-04
514
598
 
515
599
  ### Changed
600
+
516
601
  - Default top-level single, parallel, chain, and slash subagent launches to async execution when `async` is omitted. Child-safe nested calls retain their foreground default so nested evidence returns in the calling child's report. Existing `asyncByDefault: false`, explicit `async: false`, clarify UI, and foreground timeout escapes remain supported.
517
602
  - Add `--fg` to slash execution commands, show the effective async mode in tool calls, and align parent guidance around ending the turn for automatic completion delivery instead of blocking or polling.
518
603
 
519
604
  ## [0.30.0] - 2026-08-04
520
605
 
521
606
  ### Added
607
+
522
608
  - Added a read-only `watcher` agent for async monitoring. It uses `openai/gpt-5.6-luna:high` with `xai/grok-4.5:medium` fallback, queues the latest non-terminal material change through the deferred supervisor bridge, suppresses unchanged heartbeats, and relies on terminal async completion to wake the parent.
523
609
 
524
610
  ### Changed
611
+
525
612
  - Aligned `contact_supervisor` progress guidance around concise material updates while preserving deferred/coalesced delivery and normal completion handoffs.
526
613
 
527
614
  ## [0.29.2] - 2026-08-04
528
615
 
529
616
  ### Changed
617
+
530
618
  - Route the bundled `reviewer-claude` profile through `anthropic/claude-opus-5`, with Fable and Grok as fallbacks.
531
619
  - Remove fixed artifact-policy plumbing while preserving the supported behavior: `artifacts: false` disables artifacts; otherwise input, output, and metadata are written, artifact JSONL remains off, and cleanup remains seven days.
532
620
 
533
621
  ### Removed
622
+
534
623
  - Replaced the local `StringEnum` implementation and duplicate thinking-level declarations with TypeBox's native enum and the shared model helper.
535
624
  - Deleted the unreachable artifact JSONL writer and its isolated tests.
536
625
 
537
626
  ## [0.29.1] - 2026-08-04
538
627
 
539
628
  ### Changed
629
+
540
630
  - Collapse successful `intercom list` results to a session count in the TUI by default while keeping the full list available through the standard tool-expansion keybinding.
541
631
 
542
632
  ### Removed
633
+
543
634
  - Deleted two non-shipped, planning-only refactor documents.
544
635
  - Removed the legacy result-animation timer cleanup path and its synthetic test; the current renderer never creates that timer.
545
636
 
546
637
  ## [0.29.0] - 2026-08-04
547
638
 
548
639
  ### Changed
640
+
549
641
  - Absorbed the pi-intercom extension, broker, skill, and tests into this package, replacing required two-package pairing with one manifest, install, and update while preserving the existing intercom protocol, config directory, and child wiring.
550
642
  - Run the bundled broker directly with the package's existing native Node TypeScript baseline, removing the separate `tsx` runtime dependency while mapping the old default broker command to the native path for compatibility.
551
643
  - Removed Cursor-hosted fallback routes from the seven affected bundled agent profiles while preserving their remaining direct-provider routes.
@@ -575,6 +667,7 @@
575
667
  - Run local test scripts through a small wrapper that clears inherited `PI_SUBAGENT_*` runtime variables before starting the Node test runner.
576
668
 
577
669
  ### Fixed
670
+
578
671
  - Accept either response order in the live async smoke while still requiring the launch confirmation, exact async run ID, and an exact child completion line.
579
672
  - Clear inherited `PI_SUBAGENT_*` child metadata from isolated install and real-Pi smokes so running validation from a subagent still loads the top-level subagent extension and doctor command.
580
673
  - Preserve the user's Ctrl+O tool-output expansion setting when subagent tools and slash commands run instead of forcing it collapsed.
@@ -599,43 +692,52 @@
599
692
  ## [0.28.0] - 2026-06-03
600
693
 
601
694
  ### Added
695
+
602
696
  - Added foreground-only `timeoutMs`/`maxRuntimeMs` for single, parallel, and chain subagent runs. Timed-out children are soft-interrupted, keep completed sibling/prior results, and return `timedOut: true` with a stable timeout message.
603
697
  - Added per-agent `maxExecutionTimeMs` and `maxTokens` resource limits. Foreground and async children stop with a clear `resourceLimitExceeded` result when the configured runtime or observed token budget is reached.
604
698
 
605
699
  ### Changed
700
+
606
701
  - Strengthened tool and skill guidance so writer subagents launched from plans, specs, issues, or broad fixes proactively use structured `acceptance` instead of burying validation requirements only in task prose.
607
702
 
608
703
  ### Fixed
704
+
609
705
  - Removed a provider-unfriendly required-only subschema from the public `acceptance` tool schema so Kimi models served through OpenCode Go can load the `subagent` tool, while keeping runtime validation for empty acceptance contracts.
610
706
  - Clarified acceptance-report prompts so required evidence like `diff-summary` must be copied into structured JSON fields such as `diffSummary`, not only described in visible prose.
611
707
 
612
708
  ## [0.27.0] - 2026-05-30
613
709
 
614
710
  ### Changed
711
+
615
712
  - Reworked public acceptance config to be object-only and evidence-driven, removing public `level`/disable shorthands. Explicit acceptance now triggers a same-session self-review/repair finalization loop, with `maxFinalizationTurns` controlling the cap.
616
713
  - Documented goal-style acceptance guidance so `/goal`, “active goal”, and “work until evidence says done” requests map to run-scoped `acceptance` contracts.
617
714
  - Refined acceptance finalization prompts and status output to emphasize evidence, blockers, stop rules, and finalization progress such as `completed after 1/3 turns`.
618
715
 
619
716
  ### Fixed
717
+
620
718
  - Treat explicit acceptance as the completion contract for acceptance-enabled runs, avoiding implementation completion-guard false positives when the visible output is only an `acceptance-report` or a finalization self-review turn does not need a repair edit.
621
719
 
622
720
  ## [0.26.0] - 2026-05-29
623
721
 
624
722
  ### Added
723
+
625
724
  - Added first-wave acceptance gates with optional public `acceptance` config, inferred effective policies, structured child reports, provenance ledgers, checked evidence gates, explicit runtime verification commands, async/status persistence, and saved `.chain.json` validation.
626
725
  - Added chain step metadata (`phase`, `label`), named outputs (`as` with `{outputs.name}`), workflow graph snapshots, and strict `outputSchema` structured-output contracts across foreground and async chain execution.
627
726
  - Added dynamic chain fanout with `expand`/single-template `parallel`/`collect`, structured named-output sources, bounded item expansion, collected result outputs, async status graph persistence, and saved `.chain.json` support.
628
727
 
629
728
  ### Fixed
729
+
630
730
  - Fixed dynamic fanout acceptance blockers around real `structured_output` tool validation, malformed dynamic-like chain rejection, async dynamic failure status/details, dynamic child intercom target indexing, and saved `.chain.json` management diagnostics.
631
731
  - Fixed acceptance-gate semantics so reviewed status requires an independent reviewer result, required criteria must be reported as satisfied, only fenced `acceptance-report` blocks satisfy attestation, malformed reports preserve parse errors, `{ level: "none", reason }` disables inferred gates, and zero-child dynamic aggregates no longer fabricate evidence.
632
732
 
633
733
  ## [0.25.0] - 2026-05-21
634
734
 
635
735
  ### Added
736
+
636
737
  - Allow child agents whose resolved builtin tools explicitly include `subagent` to run child-safe nested fanout, with parent-visible nested status trees and nested `status`/`interrupt`/`resume` by id.
637
738
 
638
739
  ### Fixed
740
+
639
741
  - Preserve compact nested child summaries in grouped result/intercom payloads and async completion metadata before ordinary result files are processed and deleted.
640
742
  - Keep async result files retryable when nested registry enrichment temporarily fails, instead of marking them seen before a successful delivery pass.
641
743
  - Require an explicit id for child-safe nested `status` when no local foreground run is active, preventing fanout children from listing unrelated top-level async runs.
@@ -645,6 +747,7 @@
645
747
  ## [0.24.4] - 2026-05-20
646
748
 
647
749
  ### Fixed
750
+
648
751
  - Treat provider-coerced single-run `output: "false"` the same as boolean `false`, preventing literal `false` output files in foreground and async runs.
649
752
  - Include selected direct MCP tool names in explicit child `--tools` allowlists when metadata cache/config resolution is available.
650
753
  - Honor `PI_CODING_AGENT_DIR` for runtime config, agent/chain/settings discovery, skills, run history, artifact cleanup, and intercom defaults.
@@ -658,30 +761,36 @@
658
761
  ## [0.24.3] - 2026-05-14
659
762
 
660
763
  ### Added
764
+
661
765
  - Show provider-free model and thinking labels in async subagent widgets and status views.
662
766
  - Added a packaged `/review-loop` prompt for parent-controlled worker, fresh-reviewer, and fix-worker cycles that can run as an initial async chain or as follow-up subagent runs after async worker completions, stopping when reviewers find no fixes worth doing now or the review-round cap is reached.
663
767
 
664
768
  ### Fixed
769
+
665
770
  - Let `async: true` chain tool calls run in the background when `clarify` is omitted, and avoid showing the async badge for explicit foreground clarify runs.
666
771
 
667
772
  ## [0.24.2] - 2026-05-10
668
773
 
669
774
  ### Fixed
775
+
670
776
  - Show the `Ctrl+O` live-detail affordance for running single async subagent widgets when step details are available, while keeping the generic activity fallback before step status arrives.
671
777
 
672
778
  ## [0.24.1] - 2026-05-10
673
779
 
674
780
  ### Changed
781
+
675
782
  - Migrated Pi package imports and package metadata to the `@earendil-works/*` scope, switched async TypeScript execution discovery to Pi's `jiti`, and hardened forked-session creation to use the public `SessionManager.open()` path.
676
783
 
677
784
  ## [0.24.0] - 2026-05-03
678
785
 
679
786
  ### Changed
787
+
680
788
  - Consolidated async step activity and parallel-outcome formatting used by widgets and `subagent({ action: "status" })` output.
681
789
  - Updated `/parallel-review` and `/parallel-cleanup` to end review synthesis with numbered follow-up choices, plus an `autofix` mode for automatically applying fixes worth doing now.
682
790
  - Include async run output paths in `subagent({ action: "status" })` output so the remaining inspection path covers the logs previously surfaced by the removed overlay.
683
791
 
684
792
  ### Removed
793
+
685
794
  - Removed the unnecessary `/agents` manager overlay, its `Ctrl+Shift+A` shortcut, and the `agentManager.newShortcut` setting to cut unnecessary UI surface area; agent and chain management remains available through tool actions, settings, and markdown files.
686
795
  - Removed persistent save actions from the chain clarify UI: `S` no longer writes runtime overrides back to agent frontmatter, and `W` no longer saves `.chain.md` files. Clarify now only edits the imminent run.
687
796
  - Removed the `/subagents-status` read-only overlay and its slash command; async runs remain inspectable through `subagent({ action: "status" })`, completion notifications, logs, and the async widget.
@@ -690,9 +799,11 @@
690
799
  ## [0.23.1] - 2026-05-02
691
800
 
692
801
  ### Added
802
+
693
803
  - Persist async per-child session metadata and remember recent foreground child session metadata so `resume` can revive multi-child async runs and foreground children by index.
694
804
 
695
805
  ### Fixed
806
+
696
807
  - Keep foreground children alive when they call `contact_supervisor` for a blocking decision by treating it as intercom coordination during parent detach, matching the generic `intercom` handoff path.
697
808
  - Pause foreground parallel and chain flows when a child detaches for intercom coordination instead of counting the child as a successful completed result and continuing the workflow, and suppress grouped completion receipts for detached chains.
698
809
  - Tighten resume/revive safety by rejecting pending async children, detached foreground children that may still be live, ambiguous foreground/async id prefixes, and exact invalid resume matches that would otherwise be masked by a prefix match in the other namespace.
@@ -707,9 +818,11 @@
707
818
  ## [0.23.0] - 2026-05-02
708
819
 
709
820
  ### Fixed
821
+
710
822
  - Detect `pi-intercom` when installed through the documented `pi install npm:pi-intercom` package flow, instead of only checking the legacy local extension path.
711
823
 
712
824
  ### Changed
825
+
713
826
  - Store and discover saved chain workflows from dedicated chain directories: user chains in `~/.pi/agent/chains/**/*.chain.md` and project chains in `.pi/chains/**/*.chain.md`.
714
827
  - Retry foreground subagent fallback models when Pi reports a retryable provider error, such as 429/quota, even if the child process exits successfully.
715
828
  - Align single-run async subagent widgets and `/subagents-status` rendering with foreground subagent result styling for parallel, chain, and grouped chain runs, including inline live detail when tool output expansion is enabled, while keeping multi-job async widgets compact.
@@ -719,21 +832,25 @@
719
832
  ## [0.22.0] - 2026-05-02
720
833
 
721
834
  ### Added
835
+
722
836
  - Added child-only supervisor contact support for delegated subagents through `contact_supervisor`, with `need_decision` for blocking supervisor replies and `progress_update` for concise non-blocking updates.
723
837
  - Pass supervisor intercom metadata into foreground, chain, parallel, and background child runs so the child-facing pi-intercom tool can resolve the delegating session automatically.
724
838
 
725
839
  ### Changed
840
+
726
841
  - Builtin agents now inherit the user's configured default model instead of pinning `openai-codex/gpt-5.5`; use builtin overrides to pin a model for a role.
727
842
  - Hide unsupported thinking levels in subagent clarify and agent-manager pickers when Pi exposes per-model thinking metadata.
728
843
  - Updated builtin agent prompts, README, and bundled skill docs to prefer `contact_supervisor` for blocked decisions and avoid child-side routine completion handoffs.
729
844
  - Teach reviewer agents that repo-local `progress.md` files are intentional scratch files that should remain untracked and covered by `.gitignore`.
730
845
 
731
846
  ### Fixed
847
+
732
848
  - Added regression coverage for supervisor metadata propagation into child process environments.
733
849
 
734
850
  ## [0.21.5] - 2026-05-02
735
851
 
736
852
  ### Fixed
853
+
737
854
  - Show top-level async parallel runs as `parallel` instead of `chain`, with foreground-style running/done wording in widgets and status output, and group running async chain detail by chain step.
738
855
  - Scoped `/subagents-status` to async runs launched from the current pi session instead of showing prior or unrelated sessions.
739
856
  - Declared the Pi TUI package as a direct dev dependency and added a manifest guard so CI installs do not rely on transitive optional peer dependencies for tests.
@@ -742,30 +859,36 @@
742
859
  ## [0.21.4] - 2026-05-01
743
860
 
744
861
  ### Added
862
+
745
863
  - Added explicit frontmatter `package` identifiers for agents and saved chains, registering runtime names like `code-analysis.scout` while preserving separate `name` and `package` fields on save.
746
864
  - Added recursive subdirectory discovery for user and project agent and chain definitions.
747
865
  - Added `outputMode: "inline" | "file-only"` for saved subagent outputs. `inline` remains the default, while `file-only` returns a concise saved-file reference instead of injecting full saved output back into the parent context.
748
866
 
749
867
  ### Fixed
868
+
750
869
  - Marked Pi runtime peer dependencies as optional so npm package installs do not auto-install duplicate Pi packages or emit unrelated transitive dependency warnings.
751
870
 
752
871
  ## [0.21.3] - 2026-04-30
753
872
 
754
873
  ### Fixed
874
+
755
875
  - Debounce foreground `needs_attention` notices, make them non-triggering, and cancel them when the run finishes so stale chain-step alerts do not launch parent turns after completion.
756
876
 
757
877
  ## [0.21.2] - 2026-04-30
758
878
 
759
879
  ### Added
880
+
760
881
  - Added a packaged `/parallel-context-build` prompt for parallel `context-builder` handoff passes.
761
882
  - Added a packaged `/parallel-handoff-plan` prompt for external-reference research plus local `context-builder` passes that produce an implementation handoff meta-prompt.
762
883
 
763
884
  ### Changed
885
+
764
886
  - Strengthened `context-builder` guidance so handoffs require reading all relevant files and doing needed tool-available research before summarizing.
765
887
  - Expanded the bundled `pi-subagents` skill with tool-level recipes for the packaged prompt workflows, including context-build and handoff-plan patterns that parent agents can apply without slash commands.
766
888
  - Updated `README.md` to explain the bundled `pi-subagents` skill, what it covers, and how it helps the orchestrating agent.
767
889
 
768
890
  ### Fixed
891
+
769
892
  - Make active-long-running notices time-based by default, with turn and token thresholds available only as explicit opt-in budget guards.
770
893
  - Stop async status listing from inventing `needs_attention` with default thresholds when the runner has not persisted a control state.
771
894
  - Treat string `"false"` output settings as disabled output so parallel reviewers do not collide on a `/false` output path, including chain-parallel agent defaults.
@@ -776,9 +899,11 @@
776
899
  ## [0.21.1] - 2026-04-30
777
900
 
778
901
  ### Changed
902
+
779
903
  - Changed the `/agents` new-agent shortcut from `Alt+N` to `Shift+Ctrl+N`, and added `agentManager.newShortcut` config for overriding it.
780
904
 
781
905
  ### Fixed
906
+
782
907
  - Fall back to polling async result files when native result watching is unavailable due to `EMFILE` or `ENOSPC`.
783
908
  - Treat forced final-drain termination after a valid final assistant output as cleanup success instead of failing the subagent run.
784
909
  - Hide disabled builtin agents from `subagent({ action: "list" })` output so agent-facing choices match executable runtime discovery.
@@ -788,11 +913,13 @@
788
913
  ## [0.21.0] - 2026-04-29
789
914
 
790
915
  ### Changed
916
+
791
917
  - Document the recommended parent-agent workflow as `clarify → planner → worker → fresh reviewers → worker` in the docs and bundled skill.
792
918
  - Packaged `planner`, `worker`, and `oracle` now default to forked session context when the launch omits `context`; explicit `context: "fresh"` still overrides the agent default.
793
919
  - Expanded builtin subagent guidance so agents with a safe pi-intercom target can hand results back with blocking `intercom ask`, documented the self-orchestrated clarify → plan → implement → review workflow, and added GPT-5.5-oriented subagent prompt guidance to the bundled skill and `context-builder`.
794
920
 
795
921
  ### Fixed
922
+
796
923
  - Prevent child subagents from receiving parent orchestration tooling/history, and inject boundary instructions that forbid sub-delegation and pseudo tool calls.
797
924
  - Added active-long-running and repeated mutating-tool failure notices so supervised/forked workers cannot burn turns silently while still appearing healthy.
798
925
  - Fixed task editor wrapping so wide characters cannot push text past the right border.
@@ -809,35 +936,43 @@
809
936
  ## [0.20.1] - 2026-04-27
810
937
 
811
938
  ### Fixed
939
+
812
940
  - Made the packaged `/parallel-cleanup` prompt self-contained instead of referencing local-only cleanup skills.
813
941
 
814
942
  ## [0.20.0] - 2026-04-27
815
943
 
816
944
  ### Added
945
+
817
946
  - Added a packaged `/parallel-cleanup` prompt for focused cleanup review passes.
818
947
 
819
948
  ### Changed
949
+
820
950
  - Consolidated the `oracle-executor` role into `worker`: `worker` now uses `openai-codex/gpt-5.3-codex` with high thinking and stricter approved-direction guardrails, while `researcher` and `context-builder` now use medium thinking.
821
951
  - Updated the bundled `scout` agent model/thinking defaults.
822
952
  - Hard-cut over grouped intercom bridge result delivery: with the bridge active, parent-side `pi-subagents` emits one grouped `subagent:result-intercom` message per foreground parent run (single, top-level parallel, or chain) and one per completed async result file. Acknowledged foreground delivery returns a compact receipt instead of duplicating full output in the normal tool result; unacknowledged delivery preserves the normal full output. Grouped messages include child intercom targets and full child summaries.
823
953
 
824
954
  ### Fixed
955
+
825
956
  - Fixed status and manager row rendering so multiline or tabbed content cannot overflow table rows.
826
957
 
827
958
  ### Removed
959
+
828
960
  - Removed the bundled `oracle-executor` agent and `/oracle-executor` prompt template in favor of using `worker` for approved oracle handoffs.
829
961
 
830
962
  ## [0.19.3] - 2026-04-27
831
963
 
832
964
  ### Changed
965
+
833
966
  - Updated the packaged `/parallel-review` prompt so reviewer angles are generated dynamically from the user's intent, plan, implemented code, and current diff, with the listed angles framed as examples rather than fixed defaults.
834
967
 
835
968
  ## [0.19.2] - 2026-04-27
836
969
 
837
970
  ### Added
971
+
838
972
  - Added packaged prompt templates for common subagent workflows: `/parallel-research`, `/gather-context-and-clarify`, and `/oracle-executor`.
839
973
 
840
974
  ### Changed
975
+
841
976
  - Tightened the packaged `/parallel-review` prompt so fresh-context reviewers get distinct angles and return evidence-backed findings.
842
977
  - Refreshed the packaged `pi-subagents` skill with doctor diagnostics, saved-chain launches, prompt shortcuts, builtin overrides, intercom bridge guidance, fresh-context review defaults, and parallel task behavior.
843
978
  - Reworked the README around plain-language usage, good first prompts, packaged prompt shortcuts, builtin agent guidance, intercom setup, model overrides, and optional reference material.
@@ -845,27 +980,32 @@
845
980
  ## [0.19.1] - 2026-04-26
846
981
 
847
982
  ### Added
983
+
848
984
  - Added `subagent({ action: "doctor" })` and `/subagents-doctor` for read-only subagent environment diagnostics.
849
985
  - Added `/run-chain` to launch saved `.chain.md` workflows directly from slash commands with completion, shared task input, and `--bg`/`--fork` support.
850
986
 
851
987
  ## [0.19.0] - 2026-04-26
852
988
 
853
989
  ### Added
990
+
854
991
  - Added top-level parallel task support for per-task `output`, `reads`, and `progress`, including `/parallel` inline forwarding and async preservation.
855
992
  - Added `/agents` launch toggles for forked context, background execution, and worktree-isolated parallel runs.
856
993
  - Added a read-only detail view to `/subagents-status` for inspecting selected async runs, including recent events, output tails, and useful run paths.
857
994
  - Added a packaged `/parallel-review` prompt template for launching fresh-context adversarial review subagents.
858
995
 
859
996
  ### Fixed
997
+
860
998
  - Parallel and chain child runs now detach cleanly when a child uses intercom, preventing incoming handoff messages from aborting the parent foreground run.
861
999
 
862
1000
  ## [0.18.1] - 2026-04-25
863
1001
 
864
1002
  ### Changed
1003
+
865
1004
  - Restyled live subagent rendering, async widgets, and background completion notifications with compact Claude-style visual grammar while preserving existing observability paths.
866
1005
  - Parallel subagent result rendering now labels parallel workers as `Agent N` instead of `Step N`, while chain rendering keeps step terminology.
867
1006
 
868
1007
  ### Fixed
1008
+
869
1009
  - `/run` and single-agent tool calls now allow self-contained agents to run without a task string.
870
1010
  - The `subagent` tool description no longer advertises hardcoded builtin agent names and management list output now separates disabled builtins from executable agents.
871
1011
  - Flexible `subagent` tool schema fields now include explicit JSON Schema types so llama.cpp and local OpenAI-compatible providers accept them.
@@ -875,57 +1015,70 @@
875
1015
  ## [0.18.0] - 2026-04-23
876
1016
 
877
1017
  ### Added
1018
+
878
1019
  - Added subagent control notifications so `needs_attention` signals push structured parent events, persist async control events to `events.jsonl`, show visible transcript notices for the user and parent agent, include proactive `nudge`/`status`/`interrupt` commands when a child appears blocked, and show each visible notice at most once per child run and attention state.
879
1020
  - Added stable child intercom session names for controlled subagents so needs-attention pings can tell the orchestrator which agent needs attention and how to message it when intercom is available.
880
1021
 
881
1022
  ### Changed
1023
+
882
1024
  - Replaced the unreleased `starting`/`active`/`quiet`/`stalled`/`paused` activity labels with factual activity reporting and a single `needs_attention` control signal, keeping `paused` as lifecycle state only.
883
1025
  - Added `subagent({ action: "status", id })` and `subagent({ action: "status" })` as the control-surface status checks, replacing the separate `subagent_status(...)` tool.
884
1026
  - Adjusted bundled agent defaults: most builtins now use `openai-codex/gpt-5.5`, while `scout` uses `openai-codex/gpt-5.4-mini`.
885
1027
  - Removed the incomplete e2e suite and stale `@marcfargas/pi-test-harness` dev dependency; `test:all` now runs the maintained unit and integration suites.
886
1028
 
887
1029
  ### Fixed
1030
+
888
1031
  - Paused async runs now render `Background task paused` notifications instead of failed/completed copy, including after extension reloads with stale legacy listeners still present.
889
1032
  - Async status output no longer shows stale activity-age lines for paused or completed runs.
890
1033
 
891
1034
  ## [0.17.5] - 2026-04-23
892
1035
 
893
1036
  ### Added
1037
+
894
1038
  - Added subagent control activity state for foreground and async runs, including `starting`/`active`/`quiet`/`stalled`/`paused` tracking, compact stalled/recovered/paused control events, and an in-tool `action: "interrupt"` soft interrupt that pauses the current child turn without adding another top-level tool.
895
1039
 
896
1040
  ### Changed
1041
+
897
1042
  - Updated bundled agents to use `openai-codex/gpt-5.5` defaults, with `scout` on `openai-codex/gpt-5.5-mini` and `oracle-executor` on `openai-codex/gpt-5.5:xhigh`.
898
1043
 
899
1044
  ### Fixed
1045
+
900
1046
  - Async/background status token reporting now falls back to in-memory model-attempt usage when detached runs do not produce session `.jsonl` files, which also preserves token totals across model fallback retries.
901
1047
  - Non-Windows subagent launches now use plain `pi` again instead of reusing the current CLI script path, avoiding runs that get confused by installed `dist/cli.js` entrypoints.
902
1048
 
903
1049
  ## [0.17.4] - 2026-04-22
904
1050
 
905
1051
  ### Added
1052
+
906
1053
  - Bundled a `pi-subagents` skill that teaches agents how to use builtin subagents, slash-command vs tool workflows, management-mode agent creation/editing, fork/intercom coordination, clarify mode, worktrees, async status inspection, and chain templating.
907
1054
 
908
1055
  ### Changed
1056
+
909
1057
  - Tightened the builtin `oracle` prompt so intercom-enabled forked reviews now prefer concise conversational handoffs during the review and send a short final recommendation via `pi-intercom` before returning the full structured result.
910
1058
  - Tightened `oracle-executor` so it explicitly frames itself as the single writer thread and escalates gaps in the approved direction instead of silently patching around them.
911
1059
 
912
1060
  ## [0.17.3] - 2026-04-22
913
1061
 
914
1062
  ### Added
1063
+
915
1064
  - Added builtin `oracle` and `oracle-executor` agents for the `main -> oracle -> main decision -> oracle-executor` workflow, plus README guidance for invoking the oracle pair with forked context.
916
1065
 
917
1066
  ### Fixed
1067
+
918
1068
  - Migrated extension tool schemas from `@sinclair/typebox` to `typebox` 1.x so packaged installs follow Pi's current extension runtime contract.
919
1069
 
920
1070
  ### Changed
1071
+
921
1072
  - Moved TypeBox from `peerDependencies` to a real `dependencies` entry so `pi install` production installs keep the schema package available at runtime.
922
1073
 
923
1074
  ## [0.17.2] - 2026-04-21
924
1075
 
925
1076
  ### Added
1077
+
926
1078
  - Added `forceTopLevelAsync` so depth-0 delegated runs can be forced into background mode with `clarify: false`, while nested runs keep their existing behavior.
927
1079
 
928
1080
  ### Fixed
1081
+
929
1082
  - Background completion notifications now render `(no output)` instead of a blank body when a completion summary is empty or whitespace-only.
930
1083
  - Async status and token reporting now rerender more reliably when cleanup state changes, read token usage from `message.usage`, and prefer the newest session file when multiple async session files exist.
931
1084
  - Async/background startup now fails fast for invalid resolved `cwd` values and spawn failures instead of reporting false launch success.
@@ -934,23 +1087,28 @@
934
1087
  ## [0.17.1] - 2026-04-20
935
1088
 
936
1089
  ### Added
1090
+
937
1091
  - Foreground subagent runs now make deeper live detail easier to discover. Running cards show an explicit `Ctrl+O` hint, lightweight live-state signals like recent activity, current-tool durations, and artifact output paths when available. Common array-heavy tool previews such as `web_search.queries` and `fetch_content.urls` are now summarized more clearly instead of collapsing into opaque fallback text.
938
1092
 
939
1093
  ### Changed
1094
+
940
1095
  - Forked delegated runs now use stronger prompt-side guidance for `pi-intercom` coordination instead of runtime policing. The default fork preamble and intercom bridge instructions now explicitly treat inherited fork history as reference-only context, tell children not to continue the parent conversation in normal assistant text, and steer supervisor questions or handoffs through `intercom` when needed.
941
1096
  - Documented an opt-in custom agent pattern for forked chat-back workflows so users can make that coordination contract explicit without changing builtin agents.
942
1097
  - Slash-run status text and `/subagents-status` summary output now use the same more explicit observability language, including clearer live-detail hints and surfaced output/session paths in the async status overlay.
943
1098
  - Builtin agent defaults now prefer `openai-codex` models for `planner`, `scout`, `researcher`, `context-builder`, and `worker`.
944
1099
 
945
1100
  ### Fixed
1101
+
946
1102
  - Removed the short-lived foreground intercom enforcement/retry layer from delegated fork runs. Coordination behavior is now shaped by prompt and agent design only, avoiding hidden retries, heuristic output inspection, and failure paths based on guessed intent.
947
1103
 
948
1104
  ## [0.17.0] - 2026-04-16
949
1105
 
950
1106
  ### Added
1107
+
951
1108
  - Builtin agents can now be disabled through `subagents.agentOverrides.<name>.disabled` or the bulk `subagents.disableBuiltins` setting, with `/agents` keeping disabled builtins visible so they can be re-enabled from the manager. This builds on PR `#81`. Thanks @danielcherubini.
952
1109
 
953
1110
  ### Fixed
1111
+
954
1112
  - Builtin disable precedence is now coherent across user and project settings: project overrides beat user overrides, project bulk disable beats user re-enable attempts, and same-scope per-agent overrides can opt an agent out of bulk disable.
955
1113
  - `/agents` now blocks launching disabled builtins, shows their disabled state in list/detail views and management output, and avoids exposing the builtin-only `disabled` field when editing normal user/project agents.
956
1114
  - Multi-agent chain launches from `/agents` now collect a task before dispatching instead of emitting an empty task, and settings read failures now surface as read errors instead of being mislabeled as parse failures.
@@ -958,17 +1116,21 @@
958
1116
  ## [0.16.1] - 2026-04-16
959
1117
 
960
1118
  ### Changed
1119
+
961
1120
  - Parallel subagent startup no longer applies any worker-start stagger in `mapConcurrent()`. `pi-subagents` now relies on Pi core's settings/auth lock retry behavior instead of carrying its own startup-delay workaround.
962
1121
 
963
1122
  ## [0.16.0] - 2026-04-16
964
1123
 
965
1124
  ### Added
1125
+
966
1126
  - Top-level parallel `tasks` mode now supports a per-call `concurrency` override, matching the existing chain parallel-step concurrency control. This ships part of issue `#91`. Thanks @Gabrielgvl.
967
1127
 
968
1128
  ### Changed
1129
+
969
1130
  - Top-level parallel defaults and limits can now be configured through `~/.pi/agent/extensions/subagent/config.json` under `parallel.maxTasks` and `parallel.concurrency`, while keeping the existing defaults of 8 tasks and concurrency 4 when unset. This completes issue `#91`. Thanks @Gabrielgvl.
970
1131
 
971
1132
  ### Fixed
1133
+
972
1134
  - `context: "fork"` sync runs now create child sessions from a throwaway session-manager instance opened on the persisted parent session file, instead of mutating the live parent session manager. This keeps the parent session writing to its own file so the matching `toolResult(subagent)` no longer lands in a descendant session by accident. This fixes issue `#87`. Thanks @asmisha.
973
1135
  - Project agent and chain discovery now reads both `.agents/` and `.pi/agents/`, while preferring `.pi/agents/` when both locations define the same parsed name and keeping manager writes on the `.pi/agents/` path. This fixes issue `#88`. Thanks @desek.
974
1136
  - Ctrl+O expanded subagent results now actually show expanded content. Previously the `expanded` flag was received but ignored, so task text and tool-call args were identically truncated in both views. Now expanded mode shows the full task and longer (but still bounded) tool-call previews. Additionally, tool calls are no longer lost after foreground compaction: compact display summaries are preserved and shown in expanded view even after `messages` are stripped. This addresses issue `#90`. Thanks @asagajda.
@@ -976,15 +1138,18 @@
976
1138
  ## [0.15.0] - 2026-04-16
977
1139
 
978
1140
  ### Added
1141
+
979
1142
  - Added `systemPromptMode` so subagents can replace Pi's base prompt with `--system-prompt` instead of always appending with `--append-system-prompt`, shipping the core of issue `#85` from @isvlasov.
980
1143
  - Added `inheritProjectContext` and `inheritSkills` so child runs can keep or strip inherited project instruction files (`AGENTS.md`, `CLAUDE.md`, etc.) and Pi's discovered skills block.
981
1144
 
982
1145
  ### Changed
1146
+
983
1147
  - Builtin subagents now default to `systemPromptMode: replace`, with builtin `delegate` staying on `append`.
984
1148
  - Builtin agents now inherit project-level instruction files by default unless the user overrides them.
985
1149
  - Builtin agent prompts were rewritten for the new prompt-assembly model, and builtin `reviewer` / `context-builder` tool lists now match their documented behaviors. This rounds out the prompt-assembly work merged in PR `#92`, which closed issue `#85`. Thanks @isvlasov.
986
1150
 
987
1151
  ### Fixed
1152
+
988
1153
  - Cross-platform tests now avoid machine-specific Pi install paths, align homedir-sensitive settings discovery on Windows CI, and use deterministic async config-write failure fixtures.
989
1154
  - Request-level `cwd` handling is now consistent across management and execution paths. `subagent` requests that target a worktree or nested checkout now resolve project agents, project settings, and builtin agent overrides from the requested `cwd` instead of accidentally inheriting the parent session's repo. This fixes issue `#83`. Thanks @hakin19 for the report.
990
1155
  - Relative child `cwd` values now resolve from the already-selected request/shared `cwd` across sync runs, async/background runs, chain steps, and top-level parallel tasks. This fixes cases where values like `packages/app` were interpreted from the wrong base directory, which could break skill lookup, output paths, and child process spawning.
@@ -994,6 +1159,7 @@
994
1159
  ## [0.14.1] - 2026-04-14
995
1160
 
996
1161
  ### Fixed
1162
+
997
1163
  - Completed foreground subagent results now return compact payloads instead of inlining full raw message histories and per-result progress objects, preventing long tool-heavy sync runs from overwhelming the parent agent return path.
998
1164
  - Prompt-template delegation now rebuilds minimal assistant messages from compact foreground results when raw message arrays are intentionally omitted.
999
1165
  - UI/status wording now uses plain text labels instead of glyph-heavy markers across foreground rendering, parallel summaries, save-result receipts, installer output, agent manager views, clarify screens, and the corresponding README/CHANGELOG examples.
@@ -1002,9 +1168,11 @@
1002
1168
  ## [0.14.0] - 2026-04-14
1003
1169
 
1004
1170
  ### Added
1171
+
1005
1172
  - Builtin agents can now be customized through settings-backed field overrides in `~/.pi/agent/settings.json` and `.pi/settings.json` under `subagents.agentOverrides`, with `/agents` exposing a create/edit override flow instead of forcing full-file copies for model/thinking/tool/prompt tweaks.
1006
1173
 
1007
1174
  ### Fixed
1175
+
1008
1176
  - Shared temp paths are now scoped under a user-specific temp root across async result storage, async run state, chain directories, artifact fallback storage, and detached async config files, avoiding cross-user collisions on shared machines while still handling arbitrary-UID/container environments where `os.userInfo()` can throw.
1009
1177
  - Async/background runs now launch child `pi` processes in JSON mode, stream child events into `events.jsonl` with step metadata while the run is active, keep `output-<n>.log` live with human-readable child output, and document that `subagent-log-<id>.md` is a completion artifact.
1010
1178
  - Bare model IDs now prefer the active parent-session provider when that provider actually exposes the model, across sync, chain, parallel, async, and clarify flows. Ambiguous bare IDs still fall back to conservative resolution.
@@ -1013,6 +1181,7 @@
1013
1181
  ## [0.13.4] - 2026-04-13
1014
1182
 
1015
1183
  ### Fixed
1184
+
1016
1185
  - Intercom orchestration now uses a runtime-only `subagent-chat-<id>` fallback target for unnamed sessions instead of persisting a generic session title, so `pi --resume` keeps showing transcript snippets while delegated intercom routing still works.
1017
1186
  - GitHub Actions test workflow now uses `actions/checkout@v5` and `actions/setup-node@v5`, removing Node 20 action-runtime deprecation warnings ahead of the enforced Node 24 transition.
1018
1187
  - Worktree cwd mapping now derives repo-relative prefixes from `git rev-parse --show-prefix` instead of `path.relative(realpath, realpath)`, fixing Windows 8.3/canonical-path mismatches that could map `agentCwd` back to the source repo instead of the created worktree.
@@ -1023,9 +1192,11 @@
1023
1192
  ## [0.13.3] - 2026-04-13
1024
1193
 
1025
1194
  ### Added
1195
+
1026
1196
  - Added `intercomBridge.instructionFile` so subagent intercom guidance can be overridden from a Markdown template with `{orchestratorTarget}` interpolation.
1027
1197
 
1028
1198
  ### Fixed
1199
+
1029
1200
  - Intercom-enabled delegated runs now detach only after the child actually starts the `intercom` tool, preserving clean sync behavior until coordination is needed.
1030
1201
  - Graceful intercom coordination no longer leaves detached child runs vulnerable to later parent abort listeners, and reply confirmation follow-ups avoid unnecessary orchestrator aborts.
1031
1202
  - Child process spawn failures now preserve the original error message instead of collapsing to a generic failure.
@@ -1033,43 +1204,52 @@
1033
1204
  ## [0.13.2] - 2026-04-13
1034
1205
 
1035
1206
  ### Changed
1207
+
1036
1208
  - `intercomBridge` now defaults to `always` so intercom coordination instructions are injected for both `fresh` and `fork` delegated runs when `pi-intercom` is available.
1037
1209
 
1038
1210
  ## [0.13.1] - 2026-04-13
1039
1211
 
1040
1212
  ### Added
1213
+
1041
1214
  - Added optional intercom orchestration bridge for delegated runs. When enabled via `intercomBridge` (default `fork-only`) and `pi-intercom` is available, child subagents get runtime coordination instructions for contacting the orchestrator session via `intercom`, and `intercom` is auto-added to the child tool allowlist when needed.
1042
1215
  - Added unit coverage for intercom bridge activation, config handling, and extension allowlist behavior.
1043
1216
 
1044
1217
  ### Changed
1218
+
1045
1219
  - Normalized `subagent-executor.ts` relative imports to `.ts` specifiers to match direct TypeScript runtime loading.
1046
1220
  - Documented `pi-intercom` installation and activation requirements in README.
1047
1221
 
1048
1222
  ### Fixed
1223
+
1049
1224
  - Tightened intercom extension allowlist matching to avoid false positives from similarly named extension paths.
1050
1225
 
1051
1226
  ## [0.13.0] - 2026-04-11
1052
1227
 
1053
1228
  ### Added
1229
+
1054
1230
  - Added native agent `fallbackModels` support. Agents can now declare ordered backup models, and single, chain, parallel, and async/background runs retry on provider/model-style failures such as quota, auth, timeout, or provider/model unavailability.
1055
1231
 
1056
1232
  ### Fixed
1233
+
1057
1234
  - Fallback attempts now preserve observability across sync and async execution: results, artifact metadata, async status, and run logs record attempted models and per-attempt outcomes instead of only the final pass.
1058
1235
  - Child subagent runs now pass model selections through `--model` instead of `--models`, so live execution pins the intended model correctly and end-to-end fallback behavior matches the validated test path.
1059
1236
 
1060
1237
  ## [0.12.5] - 2026-04-09
1061
1238
 
1062
1239
  ### Fixed
1240
+
1063
1241
  - Slash-command result cards now finalize through the extension's own snapshot timing instead of relying on core to treat hidden custom messages as in-place updates. The final slash snapshot and hidden persisted message are written before the last status-clear redraw, so live `/run`, `/chain`, and `/parallel` cards update to their final state more reliably.
1064
1242
  - Added focused slash-command regression coverage for the success/error ordering around visible placeholder messages, hidden final messages, and the final status-clear redraw.
1065
1243
 
1066
1244
  ## [0.12.4] - 2026-04-04
1067
1245
 
1068
1246
  ### Added
1247
+
1069
1248
  - Added configurable subagent recursion depth controls with global `maxSubagentDepth` config and per-agent `maxSubagentDepth` frontmatter overrides. Child delegation now honors stricter inherited limits while still allowing per-agent tightening.
1070
1249
  - Added optional worktree setup hooks via extension config (`worktreeSetupHook`, `worktreeSetupHookTimeoutMs`). Hooks run once per created worktree, receive JSON over stdin, return JSON on stdout, and can declare synthetic helper paths (e.g. `.venv`, copied local config files) to exclude from patch capture.
1071
1250
 
1072
1251
  ### Fixed
1252
+
1073
1253
  - Added support for loading agents and skills from `.agents/` and `~/.agents/` directories.
1074
1254
  - Switched internal source imports from `.js` to `.ts` so the extension can be loaded directly from TypeScript sources under the strip-types/transform-types runtime path.
1075
1255
  - Declared pi runtime packages and `@sinclair/typebox` as peer dependencies so direct source-loading environments fail less often from missing package resolution.
@@ -1077,21 +1257,25 @@
1077
1257
  - Async/background runs now reuse the current Node executable and prefer the resolved current pi CLI path on all platforms, avoiding PATH drift from wrapped or version-pinned parent launches.
1078
1258
 
1079
1259
  ### Changed
1260
+
1080
1261
  - Added release documentation for TypeScript direct-runtime loading support and related package requirements.
1081
1262
 
1082
1263
  ## [0.12.2] - 2026-04-04
1083
1264
 
1084
1265
  ### Changed
1266
+
1085
1267
  - Bumped pi package devDependencies to `^0.65.0` (`@mariozechner/pi-agent-core`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`) to stay aligned with current pi SDK/runtime.
1086
1268
 
1087
1269
  ## [0.12.1] - 2026-04-03
1088
1270
 
1089
1271
  ### Changed
1272
+
1090
1273
  - Updated session lifecycle handling for pi 0.65.0 by removing legacy post-transition resets and relying on `session_start` reinitialization, matching pi's removal of `session_switch` and `session_fork` extension events.
1091
1274
 
1092
1275
  ## [0.12.0] - 2026-03-31
1093
1276
 
1094
1277
  ### Added
1278
+
1095
1279
  - Added git worktree isolation for parallel execution via `worktree: true`. Applies to top-level parallel `tasks`, chain steps with `{ parallel: [...] }`, and async/background chain execution. Each parallel task gets its own temporary git worktree, and the aggregated output now includes per-task diff stats plus the directory path containing full patch files.
1096
1280
  - Added `worktree.ts` to manage worktree lifecycle, diff capture, patch generation, and cleanup for isolated parallel runs.
1097
1281
  - Added `count: N` shorthand for top-level parallel `tasks` and chain `parallel` entries so one authored task can expand into repeated identical runs without manual duplication.
@@ -1100,11 +1284,13 @@
1100
1284
  - Documented worktree isolation, async status surfaces, and the reorganized test layout in the README.
1101
1285
 
1102
1286
  ### Changed
1287
+
1103
1288
  - Consolidated tests under `test/unit`, `test/integration`, `test/e2e`, and `test/support`, replacing the old mixed root-level and `test/` layout. Test scripts now target those directories explicitly.
1104
1289
  - Integration tests now use a tiny local file-based mock `pi` harness instead of relying on the external subprocess harness for normal subagent execution.
1105
1290
  - Removed legacy extra session lifecycle resets and now rely on immutable-session `session_start` reinitialization, matching pi's removal of post-transition `session_switch`/`session_fork` events.
1106
1291
 
1107
1292
  ### Fixed
1293
+
1108
1294
  - Loader-based tests now resolve `.js` → `.ts` imports correctly when the repository path contains spaces or other URL-escaped characters. Added a focused regression test for the custom test loader.
1109
1295
  - Worktree-isolated parallel runs now reject task-level `cwd` overrides that differ from the shared batch/step `cwd`, instead of silently ignoring them. Applies to foreground parallel runs, chain parallel steps, and async/background execution.
1110
1296
  - Worktree diff capture now includes committed, modified, and newly created files without accidentally including the synthetic `node_modules` symlink used inside temporary worktrees.
@@ -1118,6 +1304,7 @@
1118
1304
  ## [0.11.12] - 2026-03-28
1119
1305
 
1120
1306
  ### Changed
1307
+
1121
1308
  - Tool history (`recentTools`) in execution progress is now chronological (oldest first) and uncapped, replacing the old newest-first order with a 5-entry cap. Affects all execution paths (tool, slash commands, chains, parallel, async, delegation). Both single-task and chain-step render paths in `render.ts` now consistently use `slice(-3)` for most-recent display.
1122
1309
  - Removed 50ms throttle on execution progress updates. `onUpdate` now fires immediately on every tool start, tool end, message end, and tool result. Affects all execution paths.
1123
1310
  - Delegation bridge now passes through full `recentOutputLines` arrays, `recentTools` history, and resolved `model` to prompt-template consumers, replacing the old stripped-down single-line updates.
@@ -1125,25 +1312,30 @@
1125
1312
  ## [0.11.11] - 2026-03-23
1126
1313
 
1127
1314
  ### Changed
1315
+
1128
1316
  - Updated for pi 0.62.0 compatibility. `Skill.source` replaced with `Skill.sourceInfo` for skill provenance, `Widget` type replaced with `Component`. Bumped devDependencies to `^0.62.0`.
1129
1317
 
1130
1318
  ## [0.11.10] - 2026-03-21
1131
1319
 
1132
1320
  ### Changed
1321
+
1133
1322
  - Trimmed tool schema and description to reduce per-turn token cost by ~166 tokens (13%). Removed `maxOutput` from the LLM-facing schema (still accepted internally), shortened `context` and `output` descriptions, removed redundant CHAIN DATA FLOW section from tool description, condensed MANAGEMENT bullet points.
1134
1323
 
1135
1324
  ## [0.11.9] - 2026-03-21
1136
1325
 
1137
1326
  ### Fixed
1327
+
1138
1328
  - `/agents` overlay launches (single, chain, parallel) and slash commands (`/run`, `/chain`, `/parallel`) now render an inline result card in chat instead of relaying through `sendUserMessage`.
1139
1329
  - `/agents` overlay chain launches no longer bypass the executor for async fallback, fixing a path where async chain errors were silently swallowed.
1140
1330
 
1141
1331
  ### Changed
1332
+
1142
1333
  - All slash and overlay subagent execution now routes through an event bus request/response protocol (`slash-bridge.ts`), matching the pattern used by pi-prompt-template-model. This replaces both the old `sendUserMessage` relay and the direct `executeChain` call in the overlay handler.
1143
1334
  - Slash launches show a live inline card immediately on start that streams current tool, recent tools, and output in real time, rather than appearing only after completion.
1144
1335
  - `/parallel` now uses the native `tasks` parameter directly instead of wrapping through `{ chain: [{ parallel: tasks }] }`.
1145
1336
 
1146
1337
  ### Added
1338
+
1147
1339
  - `slash-bridge.ts` — event bus bridge for slash command execution. Manages AbortController lifecycle, cancel-before-start races, and progress streaming via `subagent:slash:*` events.
1148
1340
  - `slash-live-state.ts` — request-id keyed snapshot store that drives live inline card rendering during execution and restores finalized results from session entries on reload.
1149
1341
  - Clarified README Usage section to distinguish LLM tool parameters from user-facing slash commands.
@@ -1151,43 +1343,51 @@
1151
1343
  ## [0.11.8] - 2026-03-21
1152
1344
 
1153
1345
  ### Added
1346
+
1154
1347
  - Prompt-template delegation bridge now supports parallel task execution: accepts `tasks` array payloads, emits per-task `parallelResults` with individual error/success states, and streams per-task progress updates with `taskProgress` entries.
1155
1348
 
1156
1349
  ## [0.11.7] - 2026-03-20
1157
1350
 
1158
1351
  ### Changed
1352
+
1159
1353
  - Removed the cwd mismatch guard from the prompt-template delegation bridge, allowing delegated requests to specify a working directory different from the active session's cwd.
1160
1354
 
1161
1355
  ## [0.11.6] - 2026-03-20
1162
1356
 
1163
1357
  ### Added
1358
+
1164
1359
  - Added `delegate` builtin agent — a lightweight subagent with no model, output, or default reads. Inherits the parent session's model, making it the natural target for prompt-template delegated execution.
1165
1360
 
1166
1361
  ## [0.11.5] - 2026-03-20
1167
1362
 
1168
1363
  ### Added
1364
+
1169
1365
  - Added fork context preamble: tasks run with `context: "fork"` are now wrapped with a default preamble that anchors the subagent to its task, preventing it from continuing the parent conversation. The default is `DEFAULT_FORK_PREAMBLE` in `types.ts`. Internal/programmatic callers can use `wrapForkTask(task, false)` to disable it or pass a custom string (this is not exposed as a tool parameter).
1170
1366
  - Added a prompt-template delegation bridge (`prompt-template-bridge.ts`) on the shared extension event bus. The subagent extension now listens for `prompt-template:subagent:request` and emits correlated `started`/`response`/`update` events, with cwd safety checks and race-safe cancellation handling.
1171
1367
  - Added delegated progress streaming via `prompt-template:subagent:update`, mapped from subagent executor `onUpdate` progress payloads.
1172
1368
 
1173
1369
  ### Changed
1370
+
1174
1371
  - Session lifecycle reset now preserves the latest extension context for event-bus delegated runs.
1175
1372
  - `[fork]` badge is now shown only on the result row, not duplicated on both the tool-call and result rows.
1176
1373
 
1177
1374
  ## [0.11.4] - 2026-03-19
1178
1375
 
1179
1376
  ### Added
1377
+
1180
1378
  - Added explicit execution context mode for tool calls: `context: "fresh" | "fork"` (default: `fresh`).
1181
1379
  - Added true forked-context execution for single, parallel, and chain runs. In `fork` mode each child run now starts from a real branched session file created from the parent session's current leaf.
1182
1380
  - Added `--fork` slash-command flag for `/run`, `/chain`, and `/parallel` to forward `context: "fork"`.
1183
1381
  - Added regression coverage for fork execution/session wiring and fork badge rendering, including slash command forwarding tests.
1184
1382
 
1185
1383
  ### Changed
1384
+
1186
1385
  - Session argument wiring now supports `--session <file>` in addition to `--session-dir`, enabling exact leaf-preserving forks without summary injection.
1187
1386
  - Async runner step payloads now carry per-step session files so background single/chain/parallel executions can also honor `context: "fork"`.
1188
1387
  - Clarified docs for foreground vs background semantics so `--bg` behavior is explicit.
1189
1388
 
1190
1389
  ### Fixed
1390
+
1191
1391
  - `context: "fork"` now fails fast with explicit errors when parent session state is unavailable (missing persisted session, missing current leaf, or failed branch extraction), with no silent fallback to `fresh`.
1192
1392
  - Fork-session creation errors are now surfaced as tool errors instead of bubbling as uncaught exceptions during execution.
1193
1393
  - Session directory preparation now fails loudly with actionable errors (instead of silently swallowing mkdir failures).
@@ -1199,6 +1399,7 @@
1199
1399
  ## [0.11.3] - 2026-03-17
1200
1400
 
1201
1401
  ### Changed
1402
+
1202
1403
  - Decomposed `index.ts` (1,450 → ~350 lines) into focused modules: `subagent-executor.ts`, `async-job-tracker.ts`, `result-watcher.ts`, `slash-commands.ts`. Shared mutable state centralized in `SubagentState` interface. Three identical session handlers collapsed into one.
1203
1404
  - Extracted shared pi CLI arg-builder (`pi-args.ts`) from duplicated logic in `execution.ts` and `subagent-runner.ts`.
1204
1405
  - Consolidated `mapConcurrent` (canonical in `parallel-utils.ts`, re-exported from `utils.ts`), `aggregateParallelOutputs` (canonical in `parallel-utils.ts` with optional header formatter, re-exported from `settings.ts`), and `parseFrontmatter` (extracted to `frontmatter.ts`).
@@ -1206,38 +1407,46 @@
1206
1407
  ## [0.11.2] - 2026-03-11
1207
1408
 
1208
1409
  ### Fixed
1410
+
1209
1411
  - `--no-skills` was missing from the async runner (`subagent-runner.ts`). PR #41 added skill scoping to the sync path but the async runner spawns pi through its own code path, so background subagents with explicit skills still got the full `<available_skills>` catalog injected.
1210
1412
  - `defaultSessionDir` and `sessionDir` with `~` paths (e.g. `"~/.pi/agent/sessions/subagent/"`) were not expanded — `path.resolve("~/...")` treats `~` as a literal directory name. Added tilde expansion matching the existing pattern in `skills.ts`.
1211
1413
  - Multiple subagent calls within a session would collide when `defaultSessionDir` was configured, since it wasn't appending a unique `runId`. Both `defaultSessionDir` and parent-session-derived paths now get `runId` appended.
1212
1414
 
1213
1415
  ### Removed
1416
+
1214
1417
  - Removed exported `resolveSessionRoot()` function and `SessionRootInput` interface. These were introduced by PR #46 but never called in production — the inline resolution logic diverged (always-on sessions, `runId` appended) making the function's contract misleading. Associated tests and dead code from PR #47 scaffolding also removed from `path-handling.test.ts`.
1215
1418
 
1216
1419
  ## [0.11.1] - 2026-03-08
1217
1420
 
1218
1421
  ### Changed
1422
+
1219
1423
  - **Session persistence**: Subagent sessions are now stored alongside the parent session file instead of in `/tmp`. If the parent session is `~/.pi/agent/sessions/abc123.jsonl`, subagent sessions go to `~/.pi/agent/sessions/abc123/{runId}/run-{N}/`. This enables tracking subagent performance over time, analyzing token usage patterns, and debugging past delegations. Falls back to a unique temp directory when no parent session exists (API/headless mode).
1220
1424
 
1221
1425
  ## [0.11.0] - 2026-02-23
1222
1426
 
1223
1427
  ### Added
1428
+
1224
1429
  - **Background mode toggle in clarify TUI**: Press `b` to toggle background/async execution for any mode (single, parallel, chain). Shows `[b]g:ON` in footer when enabled. Previously async execution required programmatic `clarify: false, async: true` — now users can interactively choose background mode after previewing/editing parameters.
1225
1430
  - **`--bg` flag for slash commands**: `/run scout "task" --bg`, `/chain scout "task" -> planner --bg`, `/parallel scout "a" -> scout "b" --bg` now run in background without needing the TUI.
1226
1431
 
1227
1432
  ### Fixed
1433
+
1228
1434
  - Task edits in clarify TUI were lost when launching in background mode if no other behavior (model, output, reads) was modified. The async handoff now always applies the edited template.
1229
1435
 
1230
1436
  ## [0.10.0] - 2026-02-23
1231
1437
 
1232
1438
  ### Added
1439
+
1233
1440
  - **Async parallel chain support**: Chains with `{ parallel: [...] }` steps now work in async mode. Previously they were rejected with "Async mode doesn't support chains with parallel steps." The async runner now spawns concurrent pi processes for parallel step groups with configurable `concurrency` and `failFast` options. Inspired by PR #31 from @marcfargas.
1234
1441
  - **Comprehensive test suite**: 85 integration tests and 12 E2E tests covering all execution modes (single, parallel, chain, async), error handling, template resolution, and tool validation. Uses `@marcfargas/pi-test-harness` for subprocess mocking and in-process session testing. Thanks @marcfargas for PR #32.
1235
1442
  - GitHub Actions CI workflow running tests on both Ubuntu and Windows with Node.js 24.
1236
1443
 
1237
1444
  ### Changed
1445
+
1238
1446
  - **BREAKING:** `share` parameter now defaults to `false`. Previously, sessions were silently uploaded to GitHub Gists without user consent. Users who want session sharing must now explicitly pass `share: true`. Added documentation explaining what the feature does and its privacy implications.
1239
1447
 
1240
1448
  ### Fixed
1449
+
1241
1450
  - `mapConcurrent` with `limit=0` returned array of undefined values instead of processing items sequentially. Now clamps limit to at least 1.
1242
1451
  - ANSI background color bleed in truncated text. The `truncLine` function now properly tracks and re-applies all active ANSI styles (bold, colors, etc.) before the ellipsis, preventing style leakage. Also uses `Intl.Segmenter` for correct Unicode/emoji handling. Thanks @monotykamary for identifying the issue.
1243
1452
  - `detectSubagentError` no longer produces false positives when the agent recovers from tool errors. Previously, any error in the last tool result would override exitCode 0→1, even if the agent had already produced complete output. Now only errors AFTER the agent's final text response are flagged. Thanks @marcfargas for the fix and comprehensive test coverage.
@@ -1254,12 +1463,14 @@
1254
1463
  ## [0.9.2] - 2026-02-19
1255
1464
 
1256
1465
  ### Fixed
1466
+
1257
1467
  - TUI crash on async subagent completion: "Rendered line exceeds terminal width." `render.ts` never truncated output to fit the terminal — widget lines (`agents.join(" -> ")`), chain visualizations, skills lists, and task previews could all exceed the terminal width. Added `truncLine` helper using pi-tui's `truncateToWidth`/`visibleWidth` and applied it to every `Text` widget and widget string. Task preview lengths are now dynamic based on terminal width instead of hardcoded.
1258
1468
  - Agent Manager scope badge showed `[built]` instead of `[builtin]` in list and detail views. Widened scope column to fit.
1259
1469
 
1260
1470
  ## [0.9.1] - 2026-02-17
1261
1471
 
1262
1472
  ### Fixed
1473
+
1263
1474
  - Builtin agents were silently excluded from management listings, chain validation, and agent resolution. Added `allAgents()` helper that includes all three tiers (builtin, user, project) and applied it to `handleList`, `findAgents`, `availableNames`, and `unknownChainAgents`.
1264
1475
  - `resolveTarget` now blocks mutation of builtin agents with a clear error message suggesting the user create a same-named override, instead of allowing `fs.unlinkSync` or `fs.writeFileSync` on extension files.
1265
1476
  - Agent Manager TUI guards: delete and edit actions on builtin agents are blocked with an error status. Detail screen hides `[e]dit` from the footer for builtins. Scope badge shows `[builtin]` instead of falling through to `[proj]`.
@@ -1269,6 +1480,7 @@
1269
1480
  - `handleCreate` now warns when creating an agent that shadows a builtin (informational, not an error).
1270
1481
 
1271
1482
  ### Changed
1483
+
1272
1484
  - Simplified Agent Manager header from per-scope breakdown to total count (per-row badges already show scope).
1273
1485
  - Reviewer builtin model changed from `openai/gpt-5.2` to `openai-codex/gpt-5.3-codex`.
1274
1486
  - Removed `code-reviewer` builtin agent (redundant with `reviewer`).
@@ -1276,6 +1488,7 @@
1276
1488
  ## [0.9.0] - 2026-02-17
1277
1489
 
1278
1490
  ### Added
1491
+
1279
1492
  - **Builtin agents** — the extension now ships with a default set of agent definitions in `agents/`. These are loaded with lowest priority so user and project agents always override them. New users get a useful set of agents out of the box without manual setup.
1280
1493
  - `scout` — fast codebase recon (claude-haiku-4-5)
1281
1494
  - `planner` — implementation plans from context (claude-opus-4-6, thinking: high)
@@ -1286,17 +1499,20 @@
1286
1499
  - **`"builtin"` agent source** — new third tier in agent discovery. Priority: builtin < user < project. Builtin agents appear in listings with a `[builtin]` badge and cannot be modified or deleted through management actions (create a same-named user agent to override instead).
1287
1500
 
1288
1501
  ### Fixed
1502
+
1289
1503
  - Async subagent session sharing no longer fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`. The runner tried `require.resolve("@mariozechner/pi-coding-agent/package.json")` to find pi's HTML export module, but pi's `exports` map doesn't include that subpath. The fix resolves the package root in the main pi process by walking up from `process.argv[1]` and passes it to the spawned runner through the config, bypassing `require.resolve` entirely. The Windows CLI resolution fallback in `getPiSpawnCommand` benefits from the same walk-up function.
1290
1504
 
1291
1505
  ## [0.8.5] - 2026-02-16
1292
1506
 
1293
1507
  ### Fixed
1508
+
1294
1509
  - Async subagent execution no longer fails with "jiti not found" on machines without a global `jiti` install. The jiti resolution now tries three strategies: vanilla `jiti`, the `@mariozechner/jiti` fork, and finally resolves `@mariozechner/jiti` from pi's own installation via `process.argv[1]`. Since pi always ships the fork as a dependency, async mode now works out of the box.
1295
1510
  - Improved the "jiti not found" error message to explain what's needed and how to fix it.
1296
1511
 
1297
1512
  ## [0.8.4] - 2026-02-13
1298
1513
 
1299
1514
  ### Fixed
1515
+
1300
1516
  - JSONL artifact files no longer written by default — they duplicated pi's own session files and were the sole cause of `subagent-artifacts` directories growing to 10+ GB. Changed `includeJsonl` default from `true` to `false`. `_output.md` and `_meta.json` still capture the useful data.
1301
1517
  - Artifact cleanup now covers session-based directories, not just the temp dir. Previously `cleanupOldArtifacts` only ran on `os.tmpdir()/pi-subagent-artifacts` at startup, while sync runs (the common path) wrote to `<session-dir>/subagent-artifacts/` which was never cleaned. Now scans all `~/.pi/agent/sessions/*/subagent-artifacts/` dirs on startup and cleans the current session's artifacts dir on session lifecycle events.
1302
1518
  - JSONL writer now enforces a 50 MB size cap (`maxBytes` on `JsonlWriterDeps`) as defense-in-depth for users who opt into JSONL. Silently stops writing at the cap without pausing the source stream, so the progress tracker keeps working.
@@ -1304,9 +1520,11 @@
1304
1520
  ## [0.8.3] - 2026-02-11
1305
1521
 
1306
1522
  ### Added
1523
+
1307
1524
  - Agent `extensions` frontmatter support for extension sandboxing: absent field keeps default extension discovery, empty value disables all extensions, and comma-separated values create an explicit extension allowlist.
1308
1525
 
1309
1526
  ### Fixed
1527
+
1310
1528
  - Parallel chain aggregation now surfaces step failures and warnings in `{previous}` instead of silently passing empty output.
1311
1529
  - Empty-output warnings are now context-aware: runs that intentionally write to explicit output paths are not flagged as warning-only successes in the renderer.
1312
1530
  - Async execution now respects agent `extensions` sandbox settings, matching sync behavior.
@@ -1319,6 +1537,7 @@
1319
1537
  - Async notifications now standardize on canonical `subagent:started` and `subagent:complete` events (legacy enhanced event emissions removed).
1320
1538
 
1321
1539
  ### Changed
1540
+
1322
1541
  - Reworked `skills.ts` to resolve skills through Pi core skill loading with explicit project-first precedence and support for project/user package and settings skill paths.
1323
1542
  - Skill discovery now normalizes and prioritizes collisions by source so project-scoped skills consistently win over user-scoped skills.
1324
1543
  - Documentation now references `<tmpdir>` instead of hardcoded `/tmp` paths for cross-platform clarity.
@@ -1326,16 +1545,19 @@
1326
1545
  ## [0.8.2] - 2026-02-11
1327
1546
 
1328
1547
  ### Added
1548
+
1329
1549
  - Recursion depth guard (`PI_SUBAGENT_MAX_DEPTH`) to prevent runaway nested subagent spawning. Default max depth is 2 (main -> subagent -> sub-subagent). Deeper calls are blocked with guidance to the calling agent.
1330
1550
 
1331
1551
  ## [0.8.1] - 2026-02-10
1332
1552
 
1333
1553
  ### Added
1554
+
1334
1555
  - **`chainDir` param** for persistent chain artifacts — specify a directory to keep artifacts beyond the default 24-hour temp-directory cleanup. Relative paths are resolved to absolute via `path.resolve()` for safe use in `{chain_dir}` template substitutions.
1335
1556
 
1336
1557
  ## [0.8.0] - 2026-02-09
1337
1558
 
1338
1559
  ### Added
1560
+
1339
1561
  - **Management mode for `subagent` tool** via `action` field — the LLM can now discover, create, modify, and delete agent/chain definitions at runtime without manual file editing or restarts. Five actions:
1340
1562
  - `list` — discover agents and chains with scope + description
1341
1563
  - `get` — full detail for agent or chain, including path and system prompt/steps
@@ -1359,6 +1581,7 @@
1359
1581
  ## [0.7.0] - 2026-02-09
1360
1582
 
1361
1583
  ### Added
1584
+
1362
1585
  - **Agents Manager overlay** — browse, view, edit, create, and delete agent definitions from a TUI opened via `Ctrl+Shift+A` or the `/agents` command
1363
1586
  - List screen with search/filter, scope badges (user/project), chain badges
1364
1587
  - Detail screen showing resolved prompt, recent runs, all frontmatter fields
@@ -1396,10 +1619,11 @@
1396
1619
  - Displayed on agent detail screen
1397
1620
 
1398
1621
  ### Fixed
1622
+
1399
1623
  - **Parallel live progress** — top-level parallel execution (`tasks: [...]`) now shows live progress for all concurrent tasks. Each task's `onUpdate` updates its slot in a shared array and emits a merged view, so the renderer can display per-task status, current tools, recent output, and timing in real time. Previously only showed results after all tasks completed.
1400
1624
  - **Slash commands frozen with no progress** — `/run`, `/chain`, and `/parallel` called `runSync`/`executeChain` directly, bypassing the tool framework. No `onUpdate` meant zero live progress, and `await`-ing execution blocked the command handler, making inputs unresponsive. Now all three route through `sendToolCall` → LLM → tool handler, getting full live progress rendering and responsive input for free.
1401
1625
  - **`/run` model override silently dropped** — `/run scout[model=gpt-4o] task` now correctly passes the model through to the tool handler. Added `model` field to the tool schema for single-agent runs.
1402
- - **Quoted tasks with `--` inside split incorrectly** — the segment parser now checks for quoted strings before the `--` delimiter, so tasks like `scout "analyze login -- flow"` parse correctly instead of splitting on the embedded ` -- `.
1626
+ - **Quoted tasks with `--` inside split incorrectly** — the segment parser now checks for quoted strings before the `--` delimiter, so tasks like `scout "analyze login -- flow"` parse correctly instead of splitting on the embedded `--`.
1403
1627
  - **Chain first-step validation in per-step mode** — `/chain scout -> planner "task"` now correctly errors instead of silently assigning planner's task to scout. The first step must have its own task when using `->` syntax.
1404
1628
  - **Thinking level ignored in async mode** — `async-execution.ts` now applies thinking suffix to the model string before serializing to the runner, matching sync behavior
1405
1629
  - **Step-level model override ignored in async mode** — `executeAsyncChain` now uses `step.model ?? agent.model` as the base for thinking suffix, matching the sync path in `chain-execution.ts`
@@ -1409,6 +1633,7 @@
1409
1633
  - **Clarify toggle determinism** — all four ManagerResult paths (single, chain, saved chain, parallel) now use deterministic JSON with `clarify: !result.skipClarify`, eliminating silent breakage from natural language variants
1410
1634
 
1411
1635
  ### Changed
1636
+
1412
1637
  - Agents Manager single-agent and saved-chain launches default to quick run (skip clarify TUI) — the user already reviewed config in the overlay. Multi-agent ad-hoc chains default to showing the clarify TUI so users can configure per-step tasks, models, output files, and skills before execution. Toggle with `Tab` in the task-input screen.
1413
1638
  - Extracted `applyThinkingSuffix(model, thinking)` helper from inline logic in `execution.ts`, shared with `async-execution.ts`
1414
1639
  - Text editor: added word navigation (Alt+Left/Right, Ctrl+Left/Right), word delete (Alt+Backspace), paste support
@@ -1417,17 +1642,20 @@
1417
1642
  ## [0.6.0] - 2026-02-02
1418
1643
 
1419
1644
  ### Added
1645
+
1420
1646
  - **MCP direct tools for subagents** - Agents can request specific MCP tools as first-class tools via `mcp:` prefix in frontmatter: `tools: read, bash, mcp:chrome-devtools` or `tools: read, bash, mcp:github/search_repositories`. Requires pi-mcp-adapter.
1421
1647
  - **`MCP_DIRECT_TOOLS` env var** - Subagent processes receive their direct tool config via environment variable. Agents without `mcp:` items get a `__none__` sentinel to prevent config leaking from the parent process.
1422
1648
 
1423
1649
  ## [0.5.3] - 2026-02-01
1424
1650
 
1425
1651
  ### Fixed
1652
+
1426
1653
  - Adapt execute signatures to pi v0.51.0: reorder signal, onUpdate, ctx parameters for subagent tool; add missing parameters to subagent_status tool
1427
1654
 
1428
1655
  ## [0.5.2] - 2026-01-28
1429
1656
 
1430
1657
  ### Improved
1658
+
1431
1659
  - **README: Added agent file locations** - New "Agents" section near top of README clearly documents:
1432
1660
  - User agents: `~/.pi/agent/agents/{name}.md`
1433
1661
  - Project agents: `.pi/agents/{name}.md` (searches up directory tree)
@@ -1438,11 +1666,13 @@
1438
1666
  ## [0.5.1] - 2026-01-27
1439
1667
 
1440
1668
  ### Fixed
1669
+
1441
1670
  - Google API compatibility: Use `Type.Any()` for mixed-type unions (`SkillOverride`, `output`, `reads`, `ChainItem`) to avoid unsupported `anyOf`/`const` JSON Schema patterns
1442
1671
 
1443
1672
  ## [0.5.0] - 2026-01-27
1444
1673
 
1445
1674
  ### Added
1675
+
1446
1676
  - **Skill support** - Agents can declare skills in frontmatter that get injected into system prompts
1447
1677
  - Agent frontmatter: `skill: tmux, chrome-devtools` (comma-separated)
1448
1678
  - Runtime override: `skill: "name"` or `skill: false` to disable all skills
@@ -1458,6 +1688,7 @@
1458
1688
  - **Parallel task skills** - Each parallel task can specify its own skills via `skill` parameter
1459
1689
 
1460
1690
  ### Fixed
1691
+
1461
1692
  - **Chain summary formatting** - Fixed extra blank line when no skills are present
1462
1693
  - **Duplicate skill deduplication** - `skill: "foo,foo"` now correctly deduplicates to `["foo"]`
1463
1694
  - **Consistent skill tracking in async mode** - Both chain and single modes now track only resolved skills
@@ -1465,11 +1696,13 @@
1465
1696
  ## [0.4.1] - 2026-01-26
1466
1697
 
1467
1698
  ### Changed
1699
+
1468
1700
  - Added `pi-package` keyword for npm discoverability (pi v0.50.0 package system)
1469
1701
 
1470
1702
  ## [0.4.0] - 2026-01-25
1471
1703
 
1472
1704
  ### Added
1705
+
1473
1706
  - **Clarify TUI for single and parallel modes** - Use `clarify: true` to preview/edit before execution
1474
1707
  - Single mode: Edit task, model, thinking level, output file
1475
1708
  - Parallel mode: Edit each task independently, model, thinking level
@@ -1478,15 +1711,18 @@
1478
1711
  - **Model override for single/parallel** - TUI model selection now works for all modes
1479
1712
 
1480
1713
  ### Fixed
1714
+
1481
1715
  - **MAX_PARALLEL error mode** - Now correctly returns `mode: 'parallel'` (was incorrectly `mode: 'single'`)
1482
1716
  - **`output: true` handling** - Now correctly treats `true` as "use agent's default output" instead of creating a file literally named "true"
1483
1717
 
1484
1718
  ### Changed
1719
+
1485
1720
  - **Schema description** - `clarify` parameter now documents all modes: "default: true for chains, false for single/parallel"
1486
1721
 
1487
1722
  ## [0.3.3] - 2026-01-25
1488
1723
 
1489
1724
  ### Added
1725
+
1490
1726
  - **Thinking level selector in chain TUI** - Press `[t]` to set thinking level for any step
1491
1727
  - Options: off, minimal, low, medium, high, xhigh (ultrathink)
1492
1728
  - Appends to model as suffix (e.g., `anthropic/claude-sonnet-4-5:high`)
@@ -1505,6 +1741,7 @@
1505
1741
  - Example: Change scout's output from `context.md` to `summary.md`, planner's reads updates automatically
1506
1742
 
1507
1743
  ### Changed
1744
+
1508
1745
  - **Progress is now chain-level** - `[p]` toggles progress for ALL steps at once
1509
1746
  - Progress setting shown at chain level (not per-step)
1510
1747
  - Chains share a single progress.md, so chain-wide toggle is more intuitive
@@ -1517,6 +1754,7 @@
1517
1754
  - Chain TUI footer updated: `[e]dit [m]odel [t]hinking [w]rites [r]eads [p]rogress`
1518
1755
 
1519
1756
  ### Fixed
1757
+
1520
1758
  - **Chain READ/WRITE instructions now prepended** - Instructions restructured:
1521
1759
  - `[Read from: /path/file.md]` and `[Write to: /path/file.md]` prepended BEFORE task
1522
1760
  - Overrides any hardcoded filenames in task text from parent agent
@@ -1530,6 +1768,7 @@
1530
1768
  now correctly resolve to `anthropic/claude-sonnet-4-5:high` instead of losing the provider prefix
1531
1769
 
1532
1770
  ### Improved
1771
+
1533
1772
  - **Per-step progress indicators** - When progress is enabled, each step shows its role:
1534
1773
  - Step 1: `writes progress.md`
1535
1774
  - Step 2+: `reads progress.md`
@@ -1542,6 +1781,7 @@
1542
1781
  ## [0.3.2] - 2026-01-25
1543
1782
 
1544
1783
  ### Performance
1784
+
1545
1785
  - **4x faster polling** - Reduced poll interval from 1000ms to 250ms (efficient with mtime caching)
1546
1786
  - **Mtime-based caching** - status.json and output tail reads cached to avoid redundant I/O
1547
1787
  - **Unified throttled updates** - All onUpdate calls consolidated under 50ms throttle
@@ -1549,13 +1789,15 @@
1549
1789
  - **Array optimizations** - Use concat instead of spread for chain progress updates
1550
1790
 
1551
1791
  ### Fixed
1792
+
1552
1793
  - **Timer leaks** - Track and clear pendingTimer and cleanupTimers properly
1553
- - **Updates after close** - processClosed flag prevents updates after process terminates
1794
+ - **Updates after close** - processClosed flag prevents updates after process terminates
1554
1795
  - **Session cleanup** - Clear cleanup timers on session_start/switch/branch/shutdown
1555
1796
 
1556
1797
  ## [0.3.1] - 2026-01-24
1557
1798
 
1558
1799
  ### Changed
1800
+
1559
1801
  - **Major code refactor** - Split monolithic index.ts into focused modules:
1560
1802
  - `execution.ts` - Core runSync function for single agent execution
1561
1803
  - `chain-execution.ts` - Chain orchestration (sequential + parallel steps)
@@ -1567,6 +1809,7 @@
1567
1809
  - `types.ts` - Shared type definitions and constants
1568
1810
 
1569
1811
  ### Fixed
1812
+
1570
1813
  - **Expanded view visibility** - Running chains now properly show:
1571
1814
  - Task preview (truncated to 80 chars) for each step
1572
1815
  - Recent tools fallback when between tool calls
@@ -1577,6 +1820,7 @@
1577
1820
  ## [0.3.0] - 2026-01-24
1578
1821
 
1579
1822
  ### Added
1823
+
1580
1824
  - **Full edit mode for chain TUI** - Press `e`, `o`, or `r` to enter a full-screen editor with:
1581
1825
  - Word wrapping for long text that spans multiple display lines
1582
1826
  - Scrolling viewport (12 lines visible) with scroll indicators (↑↓)
@@ -1586,6 +1830,7 @@
1586
1830
  - Esc saves, Ctrl+C discards changes
1587
1831
 
1588
1832
  ### Improved
1833
+
1589
1834
  - **Tool description now explicitly shows the three modes** (SINGLE, CHAIN, PARALLEL) with syntax - helps agents pick the right mode when user says "scout → planner"
1590
1835
  - **Chain execution observability** - Now shows:
1591
1836
  - Chain visualization with status labels: `done scout → running planner` (`done`, `running`, `pending`, `failed`) - sequential chains only
@@ -1594,17 +1839,15 @@
1594
1839
 
1595
1840
  ## [0.2.0] - 2026-01-24
1596
1841
 
1597
- ### Changed
1598
- - **Rebranded to `pi-subagents`** (was `pi-async-subagents`)
1599
- - Historical upstream installer: `npx pi-subagents` (not this maintained project; use `npm:@fitchmultz/pi-subagents` today).
1600
-
1601
1842
  ### Added
1843
+
1602
1844
  - Chain TUI now supports editing output paths, reads lists, and toggling progress per step
1603
1845
  - New keybindings: `o` (output), `r` (reads), `p` (progress toggle)
1604
1846
  - Output and reads support full file paths, not just relative to chain_dir
1605
1847
  - Each step shows all editable fields: task, output, reads, progress
1606
1848
 
1607
1849
  ### Fixed
1850
+
1608
1851
  - Chain clarification TUI edit mode now properly re-renders after state changes (was unresponsive)
1609
1852
  - Changed edit shortcut from Tab to 'e' (Tab can be problematic in terminals)
1610
1853
  - Edit mode cursor now starts at beginning of first line for better UX
@@ -1615,6 +1858,7 @@
1615
1858
  - Absolute paths for output/reads now work correctly (were incorrectly prepended with chainDir)
1616
1859
 
1617
1860
  ### Added
1861
+
1618
1862
  - Parallel-in-chain execution with `{ parallel: [...] }` step syntax for fan-out/fan-in patterns
1619
1863
  - Configurable concurrency and fail-fast options for parallel steps
1620
1864
  - Output aggregation with clear separators (`=== Parallel Task N (agent) ===`) for `{previous}`
@@ -1622,11 +1866,13 @@
1622
1866
  - Pre-created progress.md for parallel steps to avoid race conditions
1623
1867
 
1624
1868
  ### Changed
1869
+
1625
1870
  - TUI clarification skipped for chains with parallel steps (runs directly in sync mode)
1626
1871
  - Async mode rejects chains with parallel steps with clear error message
1627
1872
  - Chain completion now returns summary blurb with progress.md and artifacts paths instead of raw output
1628
1873
 
1629
1874
  ### Added
1875
+
1630
1876
  - Live progress display for sync subagents (single and chain modes)
1631
1877
  - Shows current tool, recent output lines, token count, and duration during execution
1632
1878
  - Ctrl+O hint during sync execution to expand full streaming view
@@ -1634,10 +1880,12 @@
1634
1880
  - Updates on tool_execution_start/end events for more responsive feedback
1635
1881
 
1636
1882
  ### Fixed
1883
+
1637
1884
  - Async widget elapsed time now freezes when job completes instead of continuing to count up
1638
1885
  - Progress data now correctly linked to results during execution (was showing "ok" instead of "...")
1639
1886
 
1640
1887
  ### Added
1888
+
1641
1889
  - Extension API support (registerTool) with `subagent` tool name
1642
1890
  - Session logs (JSONL + HTML export) and optional share links via GitHub Gist
1643
1891
  - `share` and `sessionDir` parameters for session retention control
@@ -1648,11 +1896,13 @@
1648
1896
  - Async TUI widget for background runs
1649
1897
 
1650
1898
  ### Changed
1899
+
1651
1900
  - Parallel mode auto-downgrades to sync when async:true is passed (with note in output)
1652
1901
  - TUI now shows "parallel (no live progress)" label to set expectations
1653
1902
  - Tools passed via agent config can include extension paths (forwarded via `--extension`)
1654
1903
 
1655
1904
  ### Fixed
1905
+
1656
1906
  - Chain mode now sums step durations instead of taking max (was showing incorrect total time)
1657
1907
  - Async notifications no longer leak across pi sessions in different directories
1658
1908
 
@@ -1661,6 +1911,7 @@
1661
1911
  Initial release.
1662
1912
 
1663
1913
  ### Added
1914
+
1664
1915
  - Output truncation with configurable byte/line limits
1665
1916
  - Real-time progress tracking (tools, tokens, duration)
1666
1917
  - Debug artifacts (input, output, JSONL, metadata)