@fitchmultz/pi-subagents 0.44.7 → 0.46.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 (955) hide show
  1. package/CHANGELOG.md +264 -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 +89 -0
  111. package/dist/pi-intercom/bridge-http.js +86 -0
  112. package/dist/pi-intercom/bridge-launch-policy.js +88 -0
  113. package/dist/pi-intercom/bridge-launch.js +217 -0
  114. package/dist/pi-intercom/bridge-protocol.js +106 -0
  115. package/dist/pi-intercom/bridge-routes.js +72 -0
  116. package/dist/pi-intercom/bridge-rpc-process.js +264 -0
  117. package/dist/pi-intercom/bridge-session.js +420 -0
  118. package/dist/pi-intercom/bridge.js +221 -606
  119. package/dist/pi-intercom/broker/broker.js +236 -244
  120. package/dist/pi-intercom/broker/client.js +189 -304
  121. package/dist/pi-intercom/broker/connection.js +165 -0
  122. package/dist/pi-intercom/broker/framing.js +5 -3
  123. package/dist/pi-intercom/broker/paths.js +4 -1
  124. package/dist/pi-intercom/broker/pid.js +53 -25
  125. package/dist/pi-intercom/broker/snapshot-reader.js +78 -0
  126. package/dist/pi-intercom/broker/snapshots.js +188 -0
  127. package/dist/pi-intercom/broker/spawn.js +36 -25
  128. package/dist/pi-intercom/config.js +85 -71
  129. package/dist/pi-intercom/connection.js +297 -0
  130. package/dist/pi-intercom/identity.js +58 -0
  131. package/dist/pi-intercom/inbound-delivery.js +356 -0
  132. package/dist/pi-intercom/inbound-journal.js +303 -0
  133. package/dist/pi-intercom/inbound-record.js +113 -0
  134. package/dist/pi-intercom/inbound.js +179 -0
  135. package/dist/pi-intercom/index.js +79 -2933
  136. package/dist/pi-intercom/inspection.js +62 -0
  137. package/dist/pi-intercom/interview.js +236 -0
  138. package/dist/pi-intercom/lifecycle.js +168 -0
  139. package/dist/pi-intercom/message-format.js +69 -0
  140. package/dist/pi-intercom/outbound.js +304 -0
  141. package/dist/pi-intercom/peer-awareness.js +66 -0
  142. package/dist/pi-intercom/reply-tracker.js +62 -43
  143. package/dist/pi-intercom/reply-wait.js +201 -0
  144. package/dist/pi-intercom/runtime-types.js +3 -0
  145. package/dist/pi-intercom/session-events.js +180 -0
  146. package/dist/pi-intercom/session-targets.js +42 -34
  147. package/dist/pi-intercom/subagent-events.js +238 -0
  148. package/dist/pi-intercom/subagent-live-events.js +129 -86
  149. package/dist/pi-intercom/supervisor.js +282 -0
  150. package/dist/pi-intercom/tool-arguments.js +74 -0
  151. package/dist/pi-intercom/tool-registration.js +95 -0
  152. package/dist/pi-intercom/tool-results.js +38 -0
  153. package/dist/pi-intercom/tool-schemas.js +82 -0
  154. package/dist/pi-intercom/tools.js +51 -0
  155. package/dist/pi-intercom/topic-actions.js +177 -0
  156. package/dist/pi-intercom/topics.js +177 -92
  157. package/dist/pi-intercom/transport.js +1 -0
  158. package/dist/pi-intercom/types.js +151 -114
  159. package/dist/pi-intercom/ui/compose-paste.js +93 -0
  160. package/dist/pi-intercom/ui/compose.js +121 -143
  161. package/dist/pi-intercom/ui/inline-message.js +59 -59
  162. package/dist/pi-intercom/ui/message-renderers.js +147 -0
  163. package/dist/pi-intercom/ui/overlay.js +181 -0
  164. package/dist/pi-intercom/ui/session-format.js +124 -0
  165. package/dist/pi-intercom/ui/session-list.js +76 -43
  166. package/dist/pi-intercom/ui/tool-renderers.js +110 -0
  167. package/dist/pi-intercom/ui/topic-view.js +88 -0
  168. package/dist/pi-intercom/validation.js +59 -0
  169. package/dist/runs/background/async-chain-plan.js +265 -0
  170. package/dist/runs/background/async-control.js +134 -58
  171. package/dist/runs/background/async-execution.js +136 -633
  172. package/dist/runs/background/async-job-admission.js +40 -0
  173. package/dist/runs/background/async-job-projection.js +169 -0
  174. package/dist/runs/background/async-job-tracker.js +297 -327
  175. package/dist/runs/background/async-launch.js +216 -0
  176. package/dist/runs/background/async-plan.js +116 -0
  177. package/dist/runs/background/async-result-file.js +47 -23
  178. package/dist/runs/background/async-resume.js +195 -253
  179. package/dist/runs/background/async-run-discovery.js +213 -0
  180. package/dist/runs/background/async-run-location.js +135 -0
  181. package/dist/runs/background/async-run-record.js +1 -0
  182. package/dist/runs/background/async-run-repair.js +223 -0
  183. package/dist/runs/background/async-run-summary.js +1 -0
  184. package/dist/runs/background/async-single-plan.js +105 -0
  185. package/dist/runs/background/async-status-projection.js +155 -0
  186. package/dist/runs/background/async-status-render.js +117 -0
  187. package/dist/runs/background/async-status-validation.js +181 -0
  188. package/dist/runs/background/async-status.js +3 -442
  189. package/dist/runs/background/async-value.js +21 -0
  190. package/dist/runs/background/completion-dedupe.js +36 -12
  191. package/dist/runs/background/completion-delivery.js +211 -205
  192. package/dist/runs/background/completion-receipts.js +237 -0
  193. package/dist/runs/background/legacy-status-acceptance.js +34 -0
  194. package/dist/runs/background/notify.js +96 -48
  195. package/dist/runs/background/parallel-groups.js +36 -19
  196. package/dist/runs/background/result-payload.js +178 -0
  197. package/dist/runs/background/result-watcher.js +348 -339
  198. package/dist/runs/background/run-id-resolver.js +53 -33
  199. package/dist/runs/background/run-schemas.js +189 -0
  200. package/dist/runs/background/run-status-contracts.js +14 -0
  201. package/dist/runs/background/run-status-render.js +270 -0
  202. package/dist/runs/background/run-status.js +231 -339
  203. package/dist/runs/background/runner-attempt-output.js +155 -0
  204. package/dist/runs/background/runner-attempt.js +263 -0
  205. package/dist/runs/background/runner-child-executor.js +166 -0
  206. package/dist/runs/background/runner-child-observer.js +192 -0
  207. package/dist/runs/background/runner-completion-summary.js +71 -0
  208. package/dist/runs/background/runner-completion.js +211 -0
  209. package/dist/runs/background/runner-config.js +1 -0
  210. package/dist/runs/background/runner-contract.js +1 -0
  211. package/dist/runs/background/runner-dynamic.js +121 -0
  212. package/dist/runs/background/runner-finalization.js +149 -0
  213. package/dist/runs/background/runner-graph.js +68 -0
  214. package/dist/runs/background/runner-initial-status.js +60 -0
  215. package/dist/runs/background/runner-lifecycle.js +142 -0
  216. package/dist/runs/background/runner-monitor.js +309 -0
  217. package/dist/runs/background/runner-parallel.js +204 -0
  218. package/dist/runs/background/runner-prepare-step.js +86 -0
  219. package/dist/runs/background/runner-reporting.js +153 -0
  220. package/dist/runs/background/runner-status.js +148 -0
  221. package/dist/runs/background/runner-step-output.js +92 -0
  222. package/dist/runs/background/runner-step-record.js +45 -0
  223. package/dist/runs/background/runner-step.js +112 -0
  224. package/dist/runs/background/runner-streaming.js +173 -0
  225. package/dist/runs/background/runner-workflow.js +213 -0
  226. package/dist/runs/background/stale-run-reconciler.js +155 -292
  227. package/dist/runs/background/subagent-runner-launcher.js +33 -13
  228. package/dist/runs/background/subagent-runner.js +51 -1842
  229. package/dist/runs/background/top-level-async.js +2 -1
  230. package/dist/runs/foreground/chain-clarify.js +293 -1017
  231. package/dist/runs/foreground/clarification-draft.js +87 -0
  232. package/dist/runs/foreground/clarify-contracts.js +1 -0
  233. package/dist/runs/foreground/clarify-invocation.js +129 -38
  234. package/dist/runs/foreground/clarify-text-editor.js +210 -0
  235. package/dist/runs/foreground/clarify-view.js +167 -0
  236. package/dist/runs/foreground/execution-input.js +226 -353
  237. package/dist/runs/foreground/execution-routing.js +33 -0
  238. package/dist/runs/foreground/execution-timeout.js +81 -0
  239. package/dist/runs/foreground/foreground-control.js +222 -763
  240. package/dist/runs/foreground/foreground-memory.js +99 -0
  241. package/dist/runs/foreground/invocation-context.js +55 -0
  242. package/dist/runs/foreground/invocation-execution.js +331 -0
  243. package/dist/runs/foreground/invocation-expansion.js +48 -0
  244. package/dist/runs/foreground/management-actions.js +295 -0
  245. package/dist/runs/foreground/nested-control.js +179 -0
  246. package/dist/runs/foreground/question-continuation.js +78 -0
  247. package/dist/runs/foreground/question-control.js +155 -50
  248. package/dist/runs/foreground/resume-target.js +221 -0
  249. package/dist/runs/foreground/revival-launch-policy.js +58 -0
  250. package/dist/runs/foreground/run-async-path.js +190 -178
  251. package/dist/runs/foreground/run-interrupt.js +164 -0
  252. package/dist/runs/foreground/run-nudge.js +278 -0
  253. package/dist/runs/foreground/saved-revival.js +251 -0
  254. package/dist/runs/foreground/subagent-executor.js +135 -424
  255. package/dist/runs/foreground/subagent-params.js +67 -30
  256. package/dist/runs/foreground/wait-observation.js +104 -0
  257. package/dist/runs/foreground/wait-registration.js +17 -0
  258. package/dist/runs/foreground/wait-run.js +283 -123
  259. package/dist/runs/shared/acceptance-contract.js +193 -99
  260. package/dist/runs/shared/acceptance-defaults.js +1 -0
  261. package/dist/runs/shared/acceptance-evaluation.js +201 -181
  262. package/dist/runs/shared/acceptance-finalization.js +256 -180
  263. package/dist/runs/shared/acceptance-outcome.js +53 -0
  264. package/dist/runs/shared/acceptance-reports.js +137 -72
  265. package/dist/runs/shared/acceptance-submission.js +167 -0
  266. package/dist/runs/shared/acceptance-verification.js +100 -0
  267. package/dist/runs/shared/chain-outputs.js +80 -52
  268. package/dist/runs/shared/child-attempt-types.js +1 -0
  269. package/dist/runs/shared/child-attempt.js +314 -667
  270. package/dist/runs/shared/child-boundaries.js +173 -0
  271. package/dist/runs/shared/child-context-filter.js +44 -0
  272. package/dist/runs/shared/child-event-observer.js +390 -0
  273. package/dist/runs/shared/child-execution-cwd.js +73 -43
  274. package/dist/runs/shared/child-execution-outcome.js +72 -0
  275. package/dist/runs/shared/child-invocation.js +54 -0
  276. package/dist/runs/shared/child-message-validation.js +215 -0
  277. package/dist/runs/shared/child-native-accounting.js +106 -0
  278. package/dist/runs/shared/child-native-observation.js +69 -0
  279. package/dist/runs/shared/child-observation-spool.js +164 -0
  280. package/dist/runs/shared/child-observations.js +157 -76
  281. package/dist/runs/shared/child-presence.js +3 -0
  282. package/dist/runs/shared/child-route-env.js +119 -0
  283. package/dist/runs/shared/child-stream-observer.js +221 -0
  284. package/dist/runs/shared/child-stream-projection.js +137 -0
  285. package/dist/runs/shared/child-structured-tool.js +27 -0
  286. package/dist/runs/shared/claude-code.js +121 -158
  287. package/dist/runs/shared/claude-model.js +42 -0
  288. package/dist/runs/shared/claude-session.js +83 -0
  289. package/dist/runs/shared/claude-types.js +1 -0
  290. package/dist/runs/shared/completion-guard.js +18 -18
  291. package/dist/runs/shared/control-event-policy.js +8 -0
  292. package/dist/runs/shared/control-notification-owner.js +13 -0
  293. package/dist/runs/shared/dynamic-fanout.js +188 -173
  294. package/dist/runs/shared/dynamic-item.js +102 -0
  295. package/dist/runs/shared/history-index.js +62 -36
  296. package/dist/runs/shared/legacy-async-recovery.js +114 -0
  297. package/dist/runs/shared/legacy-output-recovery.js +148 -0
  298. package/dist/runs/shared/mcp-config-schema.js +36 -0
  299. package/dist/runs/shared/mcp-direct-tool-allowlist.js +147 -116
  300. package/dist/runs/shared/model-fallback.js +97 -38
  301. package/dist/runs/shared/mutating-tool-guard.js +128 -88
  302. package/dist/runs/shared/native-finalization-types.js +1 -0
  303. package/dist/runs/shared/native-finalization.js +155 -76
  304. package/dist/runs/shared/native-usage.js +238 -98
  305. package/dist/runs/shared/nested-control-records.js +128 -0
  306. package/dist/runs/shared/nested-events.js +8 -700
  307. package/dist/runs/shared/nested-path.js +32 -28
  308. package/dist/runs/shared/nested-projection.js +155 -0
  309. package/dist/runs/shared/nested-protocol.js +18 -0
  310. package/dist/runs/shared/nested-registry.js +191 -0
  311. package/dist/runs/shared/nested-render.js +106 -58
  312. package/dist/runs/shared/nested-route.js +220 -0
  313. package/dist/runs/shared/nested-validation.js +216 -0
  314. package/dist/runs/shared/owned-child-evidence.js +125 -0
  315. package/dist/runs/shared/owned-run-list.js +146 -0
  316. package/dist/runs/shared/owned-run-observation.js +267 -0
  317. package/dist/runs/shared/owned-run-progress.js +109 -0
  318. package/dist/runs/shared/owned-run-read-state.js +1 -0
  319. package/dist/runs/shared/owned-run-results.js +202 -0
  320. package/dist/runs/shared/owned-run-status.js +180 -0
  321. package/dist/runs/shared/owned-run-view.js +51 -0
  322. package/dist/runs/shared/owned-workflow-details.js +17 -0
  323. package/dist/runs/shared/owner-output.js +43 -0
  324. package/dist/runs/shared/parallel-utils.js +36 -28
  325. package/dist/runs/shared/parent-receipts.js +90 -32
  326. package/dist/runs/shared/parent-usage.js +169 -57
  327. package/dist/runs/shared/pi-args.js +108 -201
  328. package/dist/runs/shared/pi-launch-input.js +1 -0
  329. package/dist/runs/shared/pi-session-launch.js +86 -0
  330. package/dist/runs/shared/pi-spawn.js +35 -21
  331. package/dist/runs/shared/run-history-queries.js +126 -35
  332. package/dist/runs/shared/run-history.js +101 -35
  333. package/dist/runs/shared/run-metadata-paths.js +14 -0
  334. package/dist/runs/shared/run-metadata.js +158 -0
  335. package/dist/runs/shared/run-persistence.js +131 -0
  336. package/dist/runs/shared/run-records.js +9 -679
  337. package/dist/runs/shared/run-restoration.js +338 -0
  338. package/dist/runs/shared/run-state-owner.js +26 -0
  339. package/dist/runs/shared/session-cwd-preload.js +27 -18
  340. package/dist/runs/shared/single-output.js +148 -70
  341. package/dist/runs/shared/stable-value.js +15 -0
  342. package/dist/runs/shared/streaming-text.js +23 -12
  343. package/dist/runs/shared/structured-output.js +25 -13
  344. package/dist/runs/shared/subagent-control.js +167 -100
  345. package/dist/runs/shared/subagent-prompt-runtime.js +27 -130
  346. package/dist/runs/shared/subagent-tool-loop-guard.js +81 -52
  347. package/dist/runs/shared/supervisor-question-state.js +145 -0
  348. package/dist/runs/shared/supervisor-questions.js +185 -254
  349. package/dist/runs/shared/workflow-graph.js +259 -167
  350. package/dist/runs/shared/workflow-policy.js +120 -48
  351. package/dist/runs/shared/worktree-contract.js +1 -0
  352. package/dist/runs/shared/worktree-hook.js +138 -0
  353. package/dist/runs/shared/worktree-location.js +47 -0
  354. package/dist/runs/shared/worktree-preservation.js +8 -0
  355. package/dist/runs/shared/worktree-process.js +107 -0
  356. package/dist/runs/shared/worktree.js +183 -322
  357. package/dist/shared/agent-context-policy.js +34 -44
  358. package/dist/shared/agent-dir.js +14 -0
  359. package/dist/shared/artifacts.js +30 -12
  360. package/dist/shared/atomic-json.js +4 -1
  361. package/dist/shared/chain-files.js +72 -0
  362. package/dist/shared/concurrency.js +18 -0
  363. package/dist/shared/content-preview.js +115 -0
  364. package/dist/shared/cooperative.js +5 -2
  365. package/dist/shared/execution-cwd.js +13 -5
  366. package/dist/shared/file-coalescer.js +2 -1
  367. package/dist/shared/fork-context.js +10 -12
  368. package/dist/shared/formatters.js +45 -19
  369. package/dist/shared/journal-frames.js +164 -0
  370. package/dist/shared/journal-projections.js +121 -0
  371. package/dist/shared/journal-reader.js +6 -407
  372. package/dist/shared/json-projection.js +191 -0
  373. package/dist/shared/lazy-tools.js +19 -8
  374. package/dist/shared/message-output.js +116 -0
  375. package/dist/shared/model-info.js +31 -14
  376. package/dist/shared/native-import.js +20 -0
  377. package/dist/shared/native-journal.js +140 -0
  378. package/dist/shared/native-session-loader.js +17 -0
  379. package/dist/shared/native-session.js +2 -13
  380. package/dist/shared/native-tui.js +7 -2
  381. package/dist/shared/native-typebox.js +15 -3
  382. package/dist/shared/output-page.js +63 -0
  383. package/dist/shared/post-exit-stdio-guard.js +128 -88
  384. package/dist/shared/prompt-sections.js +2 -0
  385. package/dist/shared/session-entries.js +70 -35
  386. package/dist/shared/session-identity.js +5 -3
  387. package/dist/shared/settings.js +62 -192
  388. package/dist/shared/status-format.js +97 -37
  389. package/dist/shared/task-file-policy.js +24 -0
  390. package/dist/shared/temp-root.js +44 -15
  391. package/dist/shared/types/acceptance.js +1 -0
  392. package/dist/shared/types/async.js +1 -0
  393. package/dist/shared/types/config.js +1 -0
  394. package/dist/shared/types/details.js +1 -0
  395. package/dist/shared/types/history.js +1 -0
  396. package/dist/shared/types/inputs.js +1 -0
  397. package/dist/shared/types/intercom.js +1 -0
  398. package/dist/shared/types/launch.js +1 -0
  399. package/dist/shared/types/messages.js +1 -0
  400. package/dist/shared/types/nested.js +1 -0
  401. package/dist/shared/types/owned-runs.js +1 -0
  402. package/dist/shared/types/progress.js +1 -0
  403. package/dist/shared/types/questions.js +1 -0
  404. package/dist/shared/types/results.js +1 -0
  405. package/dist/shared/types/state.js +1 -0
  406. package/dist/shared/types/usage.js +1 -0
  407. package/dist/shared/types/workflow.js +1 -0
  408. package/dist/shared/types.js +75 -30
  409. package/dist/shared/unknown.js +52 -0
  410. package/dist/shared/utils.js +54 -260
  411. package/dist/slash/command-discovery.js +82 -0
  412. package/dist/slash/command-input.js +190 -0
  413. package/dist/slash/prompt-template-bridge.js +94 -270
  414. package/dist/slash/prompt-template-contract.js +77 -0
  415. package/dist/slash/prompt-template-results.js +125 -0
  416. package/dist/slash/request-protocol.js +68 -0
  417. package/dist/slash/result-delivery.js +237 -0
  418. package/dist/slash/saved-chain.js +78 -0
  419. package/dist/slash/slash-bridge.js +123 -89
  420. package/dist/slash/slash-commands.js +101 -572
  421. package/dist/slash/slash-live-state.js +68 -47
  422. package/dist/tui/action-hints.js +50 -22
  423. package/dist/tui/activity-lines.js +32 -0
  424. package/dist/tui/agent-browser.js +290 -0
  425. package/dist/tui/agent-controls.js +289 -0
  426. package/dist/tui/agent-conversation.js +444 -0
  427. package/dist/tui/agent-dock.js +171 -0
  428. package/dist/tui/agent-history.js +50 -183
  429. package/dist/tui/agent-model.js +62 -0
  430. package/dist/tui/agent-picker.js +262 -0
  431. package/dist/tui/agent-view.js +232 -1564
  432. package/dist/tui/compact-results.js +193 -0
  433. package/dist/tui/conversation-details.js +190 -0
  434. package/dist/tui/conversation-frame.js +135 -0
  435. package/dist/tui/conversation-history.js +201 -0
  436. package/dist/tui/conversation-menu.js +78 -0
  437. package/dist/tui/conversation-notices.js +79 -0
  438. package/dist/tui/conversation-selection.js +58 -0
  439. package/dist/tui/conversation-viewport.js +129 -0
  440. package/dist/tui/direction-message.js +27 -0
  441. package/dist/tui/display.js +282 -0
  442. package/dist/tui/editor-viewport.js +18 -0
  443. package/dist/tui/expanded-content.js +87 -0
  444. package/dist/tui/expanded-multi.js +170 -0
  445. package/dist/tui/expanded-single.js +65 -0
  446. package/dist/tui/history-cards.js +216 -0
  447. package/dist/tui/history-display.js +238 -0
  448. package/dist/tui/history-json.js +16 -0
  449. package/dist/tui/history-metadata.js +152 -0
  450. package/dist/tui/history-record.js +251 -0
  451. package/dist/tui/history-text.js +34 -0
  452. package/dist/tui/indexed-history.js +116 -0
  453. package/dist/tui/nested-widget.js +120 -0
  454. package/dist/tui/picker-page.js +59 -0
  455. package/dist/tui/render.js +58 -1501
  456. package/dist/tui/result-facts.js +64 -0
  457. package/dist/tui/task-observation.js +59 -0
  458. package/dist/tui/task-store.js +366 -0
  459. package/dist/tui/text-values.js +16 -0
  460. package/dist/tui/view-connections.js +47 -0
  461. package/dist/tui/view-model.js +94 -0
  462. package/dist/tui/view-persistence.js +51 -0
  463. package/dist/tui/view-ports.js +1 -0
  464. package/dist/tui/view-session.js +37 -0
  465. package/dist/tui/widget-details.js +144 -0
  466. package/dist/tui/widget-status.js +245 -0
  467. package/dist/tui/widget.js +145 -0
  468. package/dist/tui/workflow-labels.js +223 -0
  469. package/dist/tui/workflow-outcomes.js +124 -0
  470. package/docs/code-quality.md +38 -0
  471. package/docs/development.md +99 -0
  472. package/docs/intercom-bridge.md +77 -22
  473. package/docs/intercom.md +132 -106
  474. package/docs/performance.md +19 -17
  475. package/docs/reference.md +1472 -0
  476. package/generated/RunValidators.d.ts +28 -0
  477. package/generated/RunValidators.js +2 -0
  478. package/package.json +27 -6
  479. package/prompts/parallel-cleanup.md +3 -0
  480. package/prompts/parallel-context-build.md +3 -0
  481. package/prompts/parallel-handoff-plan.md +6 -0
  482. package/prompts/parallel-research.md +4 -0
  483. package/prompts/parallel-review.md +2 -0
  484. package/prompts/review-loop.md +2 -0
  485. package/scripts/build.mjs +129 -85
  486. package/scripts/check-compat.mjs +48 -11
  487. package/scripts/compat-host.mjs +35 -7
  488. package/scripts/generate-run-schemas.mjs +210 -0
  489. package/scripts/intercom-bridge-credentials.mjs +158 -29
  490. package/scripts/intercom-remote.mjs +213 -52
  491. package/scripts/local-install-smoke.mjs +47 -37
  492. package/scripts/native-package-smoke.mjs +135 -25
  493. package/scripts/package-smoke.mjs +360 -140
  494. package/scripts/prepare.mjs +54 -34
  495. package/scripts/real-pi-processes.mjs +261 -0
  496. package/scripts/real-pi-smoke.mjs +432 -351
  497. package/scripts/run-tests.mjs +29 -15
  498. package/skills/pi-intercom/SKILL.md +11 -11
  499. package/skills/pi-intercom/references/peer-sessions.md +7 -2
  500. package/skills/pi-subagents/SKILL.md +1 -1
  501. package/skills/pi-subagents/references/full-orchestration-guide.md +254 -112
  502. package/src/agents/agent-defaults.ts +13 -0
  503. package/src/agents/agent-definition.ts +253 -0
  504. package/src/agents/agent-management.ts +111 -808
  505. package/src/agents/agent-scope.ts +7 -3
  506. package/src/agents/agent-selection.ts +26 -16
  507. package/src/agents/agent-serializer.ts +84 -93
  508. package/src/agents/agents.ts +199 -906
  509. package/src/agents/builtin-overrides.ts +297 -0
  510. package/src/agents/chain-serializer.ts +3 -329
  511. package/src/agents/config-values.ts +57 -0
  512. package/src/agents/discovery-paths.ts +134 -0
  513. package/src/agents/frontmatter.ts +35 -17
  514. package/src/agents/identity.ts +49 -18
  515. package/src/agents/json-chain.ts +305 -0
  516. package/src/agents/management-config.ts +342 -0
  517. package/src/agents/management-format.ts +243 -0
  518. package/src/agents/management-persistence.ts +408 -0
  519. package/src/agents/management-targets.ts +260 -0
  520. package/src/agents/management-warnings.ts +115 -0
  521. package/src/agents/markdown-chain.ts +237 -0
  522. package/src/agents/package-agents.ts +231 -0
  523. package/src/agents/skill-files.ts +182 -0
  524. package/src/agents/skill-search-paths.ts +289 -0
  525. package/src/agents/skill-types.ts +31 -0
  526. package/src/agents/skills.ts +152 -610
  527. package/src/extension/acceptance-schema.ts +88 -0
  528. package/src/extension/chain-schema.ts +276 -0
  529. package/src/extension/child-runtime.ts +302 -0
  530. package/src/extension/compact-tools.ts +259 -102
  531. package/src/extension/config-schema.ts +59 -0
  532. package/src/extension/config.ts +39 -17
  533. package/src/extension/control-notice-schema.ts +55 -0
  534. package/src/extension/control-notices.ts +57 -33
  535. package/src/extension/delegation-bridges.ts +59 -0
  536. package/src/extension/doctor.ts +171 -135
  537. package/src/extension/everyday-schemas.ts +252 -0
  538. package/src/extension/fanout-child.ts +29 -308
  539. package/src/extension/index.ts +17 -642
  540. package/src/extension/message-renderers.ts +334 -0
  541. package/src/extension/nested-control-inbox.ts +196 -0
  542. package/src/extension/parent-runtime.ts +405 -0
  543. package/src/extension/primary-tool.ts +130 -0
  544. package/src/extension/result-snapshot.ts +35 -0
  545. package/src/extension/runtime-reload.ts +72 -0
  546. package/src/extension/runtime-storage.ts +49 -0
  547. package/src/extension/schema-overrides.ts +114 -0
  548. package/src/extension/schemas.ts +451 -418
  549. package/src/extension/tool-input.ts +40 -13
  550. package/src/extension/tool-result.ts +45 -14
  551. package/src/history/answer-texts.ts +74 -0
  552. package/src/history/canonical-result.ts +127 -51
  553. package/src/history/canonical-selection.ts +54 -0
  554. package/src/history/database-generation.ts +86 -0
  555. package/src/history/database.ts +86 -48
  556. package/src/history/entry-ingestion.ts +129 -0
  557. package/src/history/index.ts +426 -148
  558. package/src/history/ingest.ts +372 -342
  559. package/src/history/output-digests.ts +41 -0
  560. package/src/history/preview.ts +235 -0
  561. package/src/history/prune.ts +48 -0
  562. package/src/history/queries.ts +122 -256
  563. package/src/history/query-scope.ts +278 -0
  564. package/src/history/rows.ts +118 -0
  565. package/src/history/run-projection.ts +164 -0
  566. package/src/history/run-queries.ts +199 -0
  567. package/src/history/schema.ts +34 -0
  568. package/src/history/search-queries.ts +216 -0
  569. package/src/history/selected-record.ts +140 -0
  570. package/src/history/source-file.ts +51 -0
  571. package/src/history/source-watches.ts +156 -0
  572. package/src/history/store.ts +310 -197
  573. package/src/history/text-chunks.ts +181 -0
  574. package/src/history/text.ts +43 -0
  575. package/src/history/transcript-queries.ts +251 -0
  576. package/src/history/types.ts +27 -164
  577. package/src/history/values.ts +36 -0
  578. package/src/history/wire-inputs.ts +141 -0
  579. package/src/history/wire-models.ts +51 -0
  580. package/src/history/worker-runtime.ts +502 -0
  581. package/src/history/worker.ts +94 -336
  582. package/src/intercom/intercom-bridge.ts +136 -69
  583. package/src/intercom/live-intercom.ts +197 -92
  584. package/src/intercom/nested-result-tree.ts +213 -0
  585. package/src/intercom/result-delivery.ts +56 -0
  586. package/src/intercom/result-intercom.ts +364 -382
  587. package/src/pi-intercom/agent-dir.ts +9 -3
  588. package/src/pi-intercom/async.ts +33 -0
  589. package/src/pi-intercom/bridge-ask.ts +64 -0
  590. package/src/pi-intercom/bridge-config.ts +120 -0
  591. package/src/pi-intercom/bridge-http.ts +97 -0
  592. package/src/pi-intercom/bridge-launch-policy.ts +109 -0
  593. package/src/pi-intercom/bridge-launch.ts +317 -0
  594. package/src/pi-intercom/bridge-protocol.ts +123 -0
  595. package/src/pi-intercom/bridge-routes.ts +105 -0
  596. package/src/pi-intercom/bridge-rpc-process.ts +293 -0
  597. package/src/pi-intercom/bridge-session.ts +510 -0
  598. package/src/pi-intercom/bridge.ts +305 -549
  599. package/src/pi-intercom/broker/broker.ts +326 -263
  600. package/src/pi-intercom/broker/client.ts +273 -354
  601. package/src/pi-intercom/broker/connection.ts +192 -0
  602. package/src/pi-intercom/broker/framing.ts +11 -6
  603. package/src/pi-intercom/broker/paths.ts +28 -25
  604. package/src/pi-intercom/broker/pid.ts +68 -24
  605. package/src/pi-intercom/broker/snapshot-reader.ts +91 -0
  606. package/src/pi-intercom/broker/snapshots.ts +241 -0
  607. package/src/pi-intercom/broker/spawn.ts +58 -34
  608. package/src/pi-intercom/config.ts +113 -108
  609. package/src/pi-intercom/connection.ts +346 -0
  610. package/src/pi-intercom/identity.ts +71 -0
  611. package/src/pi-intercom/inbound-delivery.ts +450 -0
  612. package/src/pi-intercom/inbound-journal.ts +350 -0
  613. package/src/pi-intercom/inbound-record.ts +141 -0
  614. package/src/pi-intercom/inbound.ts +237 -0
  615. package/src/pi-intercom/index.ts +86 -2923
  616. package/src/pi-intercom/inspection.ts +82 -0
  617. package/src/pi-intercom/interview.ts +295 -0
  618. package/src/pi-intercom/lifecycle.ts +183 -0
  619. package/src/pi-intercom/message-format.ts +77 -0
  620. package/src/pi-intercom/outbound.ts +418 -0
  621. package/src/pi-intercom/peer-awareness.ts +84 -0
  622. package/src/pi-intercom/reply-tracker.ts +121 -59
  623. package/src/pi-intercom/reply-wait.ts +247 -0
  624. package/src/pi-intercom/runtime-types.ts +97 -0
  625. package/src/pi-intercom/session-events.ts +247 -0
  626. package/src/pi-intercom/session-targets.ts +124 -72
  627. package/src/pi-intercom/subagent-events.ts +299 -0
  628. package/src/pi-intercom/subagent-live-events.ts +212 -109
  629. package/src/pi-intercom/supervisor.ts +362 -0
  630. package/src/pi-intercom/tool-arguments.ts +120 -0
  631. package/src/pi-intercom/tool-registration.ts +121 -0
  632. package/src/pi-intercom/tool-results.ts +54 -0
  633. package/src/pi-intercom/tool-schemas.ts +134 -0
  634. package/src/pi-intercom/tools.ts +80 -0
  635. package/src/pi-intercom/topic-actions.ts +243 -0
  636. package/src/pi-intercom/topics.ts +267 -121
  637. package/src/pi-intercom/transport.ts +14 -0
  638. package/src/pi-intercom/types.ts +288 -190
  639. package/src/pi-intercom/ui/compose-paste.ts +109 -0
  640. package/src/pi-intercom/ui/compose.ts +173 -157
  641. package/src/pi-intercom/ui/inline-message.ts +80 -62
  642. package/src/pi-intercom/ui/message-renderers.ts +182 -0
  643. package/src/pi-intercom/ui/overlay.ts +238 -0
  644. package/src/pi-intercom/ui/session-format.ts +146 -0
  645. package/src/pi-intercom/ui/session-list.ts +145 -62
  646. package/src/pi-intercom/ui/tool-renderers.ts +148 -0
  647. package/src/pi-intercom/ui/topic-view.ts +107 -0
  648. package/src/pi-intercom/validation.ts +69 -0
  649. package/src/runs/background/async-chain-plan.ts +451 -0
  650. package/src/runs/background/async-control.ts +201 -71
  651. package/src/runs/background/async-execution.ts +206 -829
  652. package/src/runs/background/async-job-admission.ts +54 -0
  653. package/src/runs/background/async-job-projection.ts +225 -0
  654. package/src/runs/background/async-job-tracker.ts +416 -360
  655. package/src/runs/background/async-launch.ts +319 -0
  656. package/src/runs/background/async-plan.ts +285 -0
  657. package/src/runs/background/async-result-file.ts +79 -37
  658. package/src/runs/background/async-resume.ts +338 -285
  659. package/src/runs/background/async-run-discovery.ts +270 -0
  660. package/src/runs/background/async-run-location.ts +194 -0
  661. package/src/runs/background/async-run-record.ts +14 -0
  662. package/src/runs/background/async-run-repair.ts +307 -0
  663. package/src/runs/background/async-run-summary.ts +71 -0
  664. package/src/runs/background/async-single-plan.ts +168 -0
  665. package/src/runs/background/async-status-projection.ts +188 -0
  666. package/src/runs/background/async-status-render.ts +164 -0
  667. package/src/runs/background/async-status-validation.ts +238 -0
  668. package/src/runs/background/async-status.ts +9 -481
  669. package/src/runs/background/async-value.ts +29 -0
  670. package/src/runs/background/completion-dedupe.ts +103 -54
  671. package/src/runs/background/completion-delivery.ts +313 -187
  672. package/src/runs/background/completion-receipts.ts +309 -0
  673. package/src/runs/background/legacy-status-acceptance.ts +38 -0
  674. package/src/runs/background/notify.ts +167 -106
  675. package/src/runs/background/parallel-groups.ts +95 -46
  676. package/src/runs/background/result-payload.ts +268 -0
  677. package/src/runs/background/result-watcher.ts +484 -387
  678. package/src/runs/background/run-id-resolver.ts +126 -57
  679. package/src/runs/background/run-schemas.ts +240 -0
  680. package/src/runs/background/run-status-contracts.ts +46 -0
  681. package/src/runs/background/run-status-render.ts +364 -0
  682. package/src/runs/background/run-status.ts +338 -356
  683. package/src/runs/background/runner-attempt-output.ts +281 -0
  684. package/src/runs/background/runner-attempt.ts +354 -0
  685. package/src/runs/background/runner-child-executor.ts +232 -0
  686. package/src/runs/background/runner-child-observer.ts +270 -0
  687. package/src/runs/background/runner-completion-summary.ts +106 -0
  688. package/src/runs/background/runner-completion.ts +274 -0
  689. package/src/runs/background/runner-config.ts +52 -0
  690. package/src/runs/background/runner-contract.ts +51 -0
  691. package/src/runs/background/runner-dynamic.ts +185 -0
  692. package/src/runs/background/runner-finalization.ts +203 -0
  693. package/src/runs/background/runner-graph.ts +91 -0
  694. package/src/runs/background/runner-initial-status.ts +72 -0
  695. package/src/runs/background/runner-lifecycle.ts +159 -0
  696. package/src/runs/background/runner-monitor.ts +399 -0
  697. package/src/runs/background/runner-parallel.ts +280 -0
  698. package/src/runs/background/runner-prepare-step.ts +128 -0
  699. package/src/runs/background/runner-reporting.ts +192 -0
  700. package/src/runs/background/runner-status.ts +220 -0
  701. package/src/runs/background/runner-step-output.ts +158 -0
  702. package/src/runs/background/runner-step-record.ts +76 -0
  703. package/src/runs/background/runner-step.ts +150 -0
  704. package/src/runs/background/runner-streaming.ts +220 -0
  705. package/src/runs/background/runner-workflow.ts +284 -0
  706. package/src/runs/background/stale-run-reconciler.ts +279 -336
  707. package/src/runs/background/subagent-runner-launcher.ts +67 -35
  708. package/src/runs/background/subagent-runner.ts +80 -2048
  709. package/src/runs/background/top-level-async.ts +9 -7
  710. package/src/runs/foreground/chain-clarify.ts +499 -1334
  711. package/src/runs/foreground/clarification-draft.ts +92 -0
  712. package/src/runs/foreground/clarify-contracts.ts +33 -0
  713. package/src/runs/foreground/clarify-invocation.ts +192 -65
  714. package/src/runs/foreground/clarify-text-editor.ts +229 -0
  715. package/src/runs/foreground/clarify-view.ts +222 -0
  716. package/src/runs/foreground/execution-input.ts +358 -424
  717. package/src/runs/foreground/execution-routing.ts +41 -0
  718. package/src/runs/foreground/execution-timeout.ts +92 -0
  719. package/src/runs/foreground/foreground-control.ts +333 -812
  720. package/src/runs/foreground/foreground-memory.ts +132 -0
  721. package/src/runs/foreground/invocation-context.ts +88 -0
  722. package/src/runs/foreground/invocation-execution.ts +465 -0
  723. package/src/runs/foreground/invocation-expansion.ts +58 -0
  724. package/src/runs/foreground/management-actions.ts +360 -0
  725. package/src/runs/foreground/nested-control.ts +248 -0
  726. package/src/runs/foreground/question-continuation.ts +112 -0
  727. package/src/runs/foreground/question-control.ts +297 -70
  728. package/src/runs/foreground/resume-target.ts +330 -0
  729. package/src/runs/foreground/revival-launch-policy.ts +112 -0
  730. package/src/runs/foreground/run-async-path.ts +307 -223
  731. package/src/runs/foreground/run-interrupt.ts +202 -0
  732. package/src/runs/foreground/run-nudge.ts +355 -0
  733. package/src/runs/foreground/saved-revival.ts +356 -0
  734. package/src/runs/foreground/subagent-executor.ts +195 -493
  735. package/src/runs/foreground/subagent-params.ts +314 -242
  736. package/src/runs/foreground/wait-observation.ts +160 -0
  737. package/src/runs/foreground/wait-registration.ts +18 -0
  738. package/src/runs/foreground/wait-run.ts +361 -119
  739. package/src/runs/shared/acceptance-contract.ts +410 -209
  740. package/src/runs/shared/acceptance-defaults.ts +1 -0
  741. package/src/runs/shared/acceptance-evaluation.ts +314 -240
  742. package/src/runs/shared/acceptance-finalization.ts +447 -305
  743. package/src/runs/shared/acceptance-outcome.ts +69 -0
  744. package/src/runs/shared/acceptance-reports.ts +220 -126
  745. package/src/runs/shared/acceptance-submission.ts +251 -0
  746. package/src/runs/shared/acceptance-verification.ts +118 -0
  747. package/src/runs/shared/acceptance.ts +25 -25
  748. package/src/runs/shared/chain-outputs.ts +190 -98
  749. package/src/runs/shared/child-attempt-types.ts +118 -0
  750. package/src/runs/shared/child-attempt.ts +372 -608
  751. package/src/runs/shared/child-boundaries.ts +217 -0
  752. package/src/runs/shared/child-context-filter.ts +53 -0
  753. package/src/runs/shared/child-event-observer.ts +496 -0
  754. package/src/runs/shared/child-execution-cwd.ts +139 -68
  755. package/src/runs/shared/child-execution-outcome.ts +103 -0
  756. package/src/runs/shared/child-invocation.ts +74 -0
  757. package/src/runs/shared/child-message-validation.ts +233 -0
  758. package/src/runs/shared/child-native-accounting.ts +154 -0
  759. package/src/runs/shared/child-native-observation.ts +79 -0
  760. package/src/runs/shared/child-observation-spool.ts +188 -0
  761. package/src/runs/shared/child-observations.ts +219 -89
  762. package/src/runs/shared/child-presence.ts +6 -0
  763. package/src/runs/shared/child-route-env.ts +142 -0
  764. package/src/runs/shared/child-stream-observer.ts +302 -0
  765. package/src/runs/shared/child-stream-projection.ts +160 -0
  766. package/src/runs/shared/child-structured-tool.ts +38 -0
  767. package/src/runs/shared/claude-code.ts +201 -228
  768. package/src/runs/shared/claude-model.ts +67 -0
  769. package/src/runs/shared/claude-session.ts +124 -0
  770. package/src/runs/shared/claude-types.ts +31 -0
  771. package/src/runs/shared/completion-guard.ts +35 -26
  772. package/src/runs/shared/control-event-policy.ts +15 -0
  773. package/src/runs/shared/control-notification-owner.ts +20 -0
  774. package/src/runs/shared/dynamic-fanout.ts +402 -238
  775. package/src/runs/shared/dynamic-item.ts +114 -0
  776. package/src/runs/shared/history-index.ts +112 -51
  777. package/src/runs/shared/legacy-async-recovery.ts +153 -0
  778. package/src/runs/shared/legacy-output-recovery.ts +214 -0
  779. package/src/runs/shared/mcp-config-schema.ts +46 -0
  780. package/src/runs/shared/mcp-direct-tool-allowlist.ts +396 -307
  781. package/src/runs/shared/model-fallback.ts +302 -180
  782. package/src/runs/shared/mutating-tool-guard.ts +259 -158
  783. package/src/runs/shared/native-finalization-types.ts +29 -0
  784. package/src/runs/shared/native-finalization.ts +233 -109
  785. package/src/runs/shared/native-usage.ts +379 -96
  786. package/src/runs/shared/nested-control-records.ts +178 -0
  787. package/src/runs/shared/nested-events.ts +45 -752
  788. package/src/runs/shared/nested-path.ts +47 -34
  789. package/src/runs/shared/nested-projection.ts +230 -0
  790. package/src/runs/shared/nested-protocol.ts +67 -0
  791. package/src/runs/shared/nested-registry.ts +273 -0
  792. package/src/runs/shared/nested-render.ts +198 -100
  793. package/src/runs/shared/nested-route.ts +292 -0
  794. package/src/runs/shared/nested-validation.ts +291 -0
  795. package/src/runs/shared/owned-child-evidence.ts +184 -0
  796. package/src/runs/shared/owned-run-list.ts +187 -0
  797. package/src/runs/shared/owned-run-observation.ts +368 -0
  798. package/src/runs/shared/owned-run-progress.ts +172 -0
  799. package/src/runs/shared/owned-run-read-state.ts +7 -0
  800. package/src/runs/shared/owned-run-results.ts +289 -0
  801. package/src/runs/shared/owned-run-status.ts +239 -0
  802. package/src/runs/shared/owned-run-view.ts +65 -0
  803. package/src/runs/shared/owned-workflow-details.ts +24 -0
  804. package/src/runs/shared/owner-output.ts +73 -0
  805. package/src/runs/shared/parallel-utils.ts +93 -129
  806. package/src/runs/shared/parent-receipts.ts +177 -50
  807. package/src/runs/shared/parent-usage.ts +314 -91
  808. package/src/runs/shared/pi-args.ts +241 -311
  809. package/src/runs/shared/pi-launch-input.ts +48 -0
  810. package/src/runs/shared/pi-session-launch.ts +94 -0
  811. package/src/runs/shared/pi-spawn.ts +57 -33
  812. package/src/runs/shared/run-history-queries.ts +189 -38
  813. package/src/runs/shared/run-history.ts +197 -76
  814. package/src/runs/shared/run-id-ambiguity.ts +7 -3
  815. package/src/runs/shared/run-metadata-paths.ts +17 -0
  816. package/src/runs/shared/run-metadata.ts +240 -0
  817. package/src/runs/shared/run-persistence.ts +181 -0
  818. package/src/runs/shared/run-records.ts +19 -607
  819. package/src/runs/shared/run-restoration.ts +455 -0
  820. package/src/runs/shared/run-state-owner.ts +31 -0
  821. package/src/runs/shared/session-cwd-preload.ts +39 -19
  822. package/src/runs/shared/single-output.ts +358 -205
  823. package/src/runs/shared/stable-value.ts +15 -0
  824. package/src/runs/shared/streaming-text.ts +39 -12
  825. package/src/runs/shared/structured-output.ts +76 -46
  826. package/src/runs/shared/subagent-control.ts +330 -197
  827. package/src/runs/shared/subagent-prompt-runtime.ts +92 -174
  828. package/src/runs/shared/subagent-tool-loop-guard.ts +118 -68
  829. package/src/runs/shared/supervisor-question-state.ts +221 -0
  830. package/src/runs/shared/supervisor-questions.ts +396 -401
  831. package/src/runs/shared/workflow-graph.ts +400 -198
  832. package/src/runs/shared/workflow-policy.ts +245 -110
  833. package/src/runs/shared/worktree-contract.ts +29 -0
  834. package/src/runs/shared/worktree-hook.ts +181 -0
  835. package/src/runs/shared/worktree-location.ts +61 -0
  836. package/src/runs/shared/worktree-preservation.ts +10 -0
  837. package/src/runs/shared/worktree-process.ts +132 -0
  838. package/src/runs/shared/worktree.ts +459 -587
  839. package/src/shared/agent-context-policy.ts +176 -145
  840. package/src/shared/agent-dir.ts +15 -0
  841. package/src/shared/artifacts.ts +99 -68
  842. package/src/shared/atomic-json.ts +14 -11
  843. package/src/shared/chain-files.ts +72 -0
  844. package/src/shared/concurrency.ts +27 -0
  845. package/src/shared/content-preview.ts +117 -0
  846. package/src/shared/cooperative.ts +17 -13
  847. package/src/shared/execution-cwd.ts +34 -9
  848. package/src/shared/file-coalescer.ts +24 -22
  849. package/src/shared/fork-context.ts +52 -48
  850. package/src/shared/formatters.ts +88 -47
  851. package/src/shared/journal-frames.ts +197 -0
  852. package/src/shared/journal-projections.ts +133 -0
  853. package/src/shared/journal-reader.ts +18 -333
  854. package/src/shared/json-projection.ts +224 -0
  855. package/src/shared/lazy-tools.ts +76 -27
  856. package/src/shared/message-output.ts +146 -0
  857. package/src/shared/model-info.ts +94 -58
  858. package/src/shared/native-import.ts +25 -0
  859. package/src/shared/native-journal.ts +172 -0
  860. package/src/shared/native-session-loader.ts +13 -0
  861. package/src/shared/native-session.ts +3 -5
  862. package/src/shared/native-tui.ts +13 -3
  863. package/src/shared/native-typebox.ts +18 -3
  864. package/src/shared/output-page.ts +76 -0
  865. package/src/shared/post-exit-stdio-guard.ts +232 -172
  866. package/src/shared/prompt-sections.ts +13 -7
  867. package/src/shared/session-entries.ts +103 -44
  868. package/src/shared/session-identity.ts +17 -10
  869. package/src/shared/settings.ts +182 -367
  870. package/src/shared/status-format.ts +207 -98
  871. package/src/shared/stream-json.d.ts +10 -0
  872. package/src/shared/task-file-policy.ts +35 -0
  873. package/src/shared/temp-root.ts +122 -71
  874. package/src/shared/types/acceptance.ts +149 -0
  875. package/src/shared/types/async.ts +247 -0
  876. package/src/shared/types/config.ts +139 -0
  877. package/src/shared/types/details.ts +104 -0
  878. package/src/shared/types/history.ts +217 -0
  879. package/src/shared/types/inputs.ts +4 -0
  880. package/src/shared/types/intercom.ts +57 -0
  881. package/src/shared/types/launch.ts +39 -0
  882. package/src/shared/types/messages.ts +104 -0
  883. package/src/shared/types/nested.ts +153 -0
  884. package/src/shared/types/owned-runs.ts +148 -0
  885. package/src/shared/types/progress.ts +106 -0
  886. package/src/shared/types/questions.ts +103 -0
  887. package/src/shared/types/results.ts +119 -0
  888. package/src/shared/types/state.ts +56 -0
  889. package/src/shared/types/usage.ts +36 -0
  890. package/src/shared/types/workflow.ts +187 -0
  891. package/src/shared/types.ts +222 -1161
  892. package/src/shared/ui-mode.ts +1 -1
  893. package/src/shared/unknown.ts +59 -0
  894. package/src/shared/utils.ts +111 -305
  895. package/src/slash/command-discovery.ts +109 -0
  896. package/src/slash/command-input.ts +232 -0
  897. package/src/slash/prompt-template-bridge.ts +153 -400
  898. package/src/slash/prompt-template-contract.ts +152 -0
  899. package/src/slash/prompt-template-results.ts +189 -0
  900. package/src/slash/request-protocol.ts +87 -0
  901. package/src/slash/result-delivery.ts +312 -0
  902. package/src/slash/saved-chain.ts +115 -0
  903. package/src/slash/slash-bridge.ts +202 -156
  904. package/src/slash/slash-commands.ts +176 -598
  905. package/src/slash/slash-live-state.ts +287 -229
  906. package/src/tui/action-hints.ts +147 -61
  907. package/src/tui/activity-lines.ts +40 -0
  908. package/src/tui/agent-browser.ts +354 -0
  909. package/src/tui/agent-controls.ts +355 -0
  910. package/src/tui/agent-conversation.ts +514 -0
  911. package/src/tui/agent-dock.ts +250 -0
  912. package/src/tui/agent-history.ts +78 -203
  913. package/src/tui/agent-model.ts +78 -0
  914. package/src/tui/agent-picker.ts +325 -0
  915. package/src/tui/agent-view.ts +391 -1333
  916. package/src/tui/compact-results.ts +342 -0
  917. package/src/tui/conversation-details.ts +206 -0
  918. package/src/tui/conversation-frame.ts +184 -0
  919. package/src/tui/conversation-history.ts +246 -0
  920. package/src/tui/conversation-menu.ts +119 -0
  921. package/src/tui/conversation-notices.ts +116 -0
  922. package/src/tui/conversation-selection.ts +66 -0
  923. package/src/tui/conversation-viewport.ts +169 -0
  924. package/src/tui/direction-message.ts +35 -0
  925. package/src/tui/display.ts +409 -0
  926. package/src/tui/editor-viewport.ts +19 -0
  927. package/src/tui/expanded-content.ts +134 -0
  928. package/src/tui/expanded-multi.ts +264 -0
  929. package/src/tui/expanded-single.ts +92 -0
  930. package/src/tui/history-cards.ts +316 -0
  931. package/src/tui/history-display.ts +334 -0
  932. package/src/tui/history-json.ts +17 -0
  933. package/src/tui/history-metadata.ts +177 -0
  934. package/src/tui/history-record.ts +321 -0
  935. package/src/tui/history-text.ts +34 -0
  936. package/src/tui/indexed-history.ts +149 -0
  937. package/src/tui/nested-widget.ts +192 -0
  938. package/src/tui/picker-page.ts +80 -0
  939. package/src/tui/render.ts +100 -1546
  940. package/src/tui/result-facts.ts +99 -0
  941. package/src/tui/task-observation.ts +96 -0
  942. package/src/tui/task-store.ts +432 -0
  943. package/src/tui/text-values.ts +20 -0
  944. package/src/tui/view-connections.ts +64 -0
  945. package/src/tui/view-model.ts +181 -0
  946. package/src/tui/view-persistence.ts +57 -0
  947. package/src/tui/view-ports.ts +55 -0
  948. package/src/tui/view-session.ts +42 -0
  949. package/src/tui/widget-details.ts +220 -0
  950. package/src/tui/widget-status.ts +331 -0
  951. package/src/tui/widget.ts +208 -0
  952. package/src/tui/workflow-labels.ts +340 -0
  953. package/src/tui/workflow-outcomes.ts +150 -0
  954. package/tsconfig.build.json +11 -10
  955. package/tsconfig.json +30 -17
package/CHANGELOG.md CHANGED
@@ -1,8 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.46.0] - 2026-10-11
4
+
5
+ ### Added
6
+
7
+ - Opt-in controlled destination Pi-session launching over the secure Intercom bridge: locally pinned native RPC sessions, private native journals and inference-free startup, actual peer readiness, name reuse, own-session status/stop, caps, and remote CLI commands. Cancellation, expiry, revocation and shutdown reap the helper-owned process group, including unresponsive native workers, while retaining journals and observing actual closure. Cleanup deadlines report `stop_timeout` and remain retryable; cleanup failures preserve the original startup fault. Messaging-only and standalone credential installs remain independent of Pi SDK imports.
8
+
9
+ ## [0.45.0] - 2026-10-11
10
+
11
+ ### Changed
12
+
13
+ - 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.
14
+ - 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.
15
+ - 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.
16
+
3
17
  ## [0.44.7] - 2026-10-09
4
18
 
5
19
  ### Fixed
20
+
6
21
  - 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
22
  - Consume refresh notifications received while the latest conversation page is loading, without pulling scrolled readers forward or automatically retrying history errors.
8
23
  - 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 +25,7 @@
10
25
  ## [0.44.6] - 2026-10-09
11
26
 
12
27
  ### Fixed
28
+
13
29
  - 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
30
  - 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
31
  - 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 +33,27 @@
17
33
  ## [0.44.5] - 2026-10-08
18
34
 
19
35
  ### Added
36
+
20
37
  - 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
38
 
22
39
  ### Fixed
40
+
23
41
  - 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
42
  - 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
43
 
26
44
  ## [0.44.4] - 2026-10-04
27
45
 
28
46
  ### 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.
47
+
48
+ - 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
49
  - 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
50
 
32
51
  ### Changed
52
+
33
53
  - 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
54
 
35
55
  ### Fixed
56
+
36
57
  - 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
58
  - 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
59
  - 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 +64,35 @@
43
64
  ## [0.44.3] - 2026-10-02
44
65
 
45
66
  ### Changed
67
+
46
68
  - 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
69
 
48
70
  ## [0.44.2] - 2026-10-02
49
71
 
50
72
  ### Changed
73
+
51
74
  - 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
75
  - 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
76
 
54
77
  ## [0.44.1] - 2026-10-02
55
78
 
56
79
  ### Fixed
80
+
57
81
  - 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
82
 
59
83
  ### Changed
84
+
60
85
  - Clarify the performance guide’s full-step and per-step `maxItems` alternatives.
61
86
  - 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
87
 
63
88
  ## [0.44.0] - 2026-10-01
64
89
 
65
90
  ### Added
91
+
66
92
  - 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
93
 
68
94
  ### Changed
95
+
69
96
  - 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
97
  - 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
98
  - 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 +100,7 @@
73
100
  - 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
101
 
75
102
  ### Fixed
103
+
76
104
  - 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
105
  - 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
106
  - 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 +117,14 @@
89
117
  ## [0.43.1] - 2026-09-30
90
118
 
91
119
  ### Changed
120
+
92
121
  - 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
122
  - Keep native journal/model/streaming checks independent of mutable catalog entries and account for early host metadata persistence and fork discovery tools.
94
123
  - 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
124
  - 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
125
 
97
126
  ### Fixed
127
+
98
128
  - 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
129
  - 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
130
  - 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 +138,23 @@
108
138
  ## [0.43.0] - 2026-09-27
109
139
 
110
140
  ### Changed
141
+
111
142
  - 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
143
 
113
144
  ## [0.42.1] - 2026-09-26
114
145
 
115
146
  ### Changed
147
+
116
148
  - 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
149
 
118
150
  ## [0.42.0] - 2026-09-26
119
151
 
120
152
  ### Breaking Changes
153
+
121
154
  - Require Node 24 or later. CI and the shared compatibility fleet qualify only Node 24.
122
155
 
123
156
  ### Changed
157
+
124
158
  - 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
159
  - Build and typecheck with TypeScript 7.0.2 targeting ES2025. `verbatimModuleSyntax` and `erasableSyntaxOnly` now enforce the syntax Node's type stripping runs.
126
160
  - 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 +163,13 @@
129
163
  ## [0.41.0] - 2026-09-25
130
164
 
131
165
  ### Changed
166
+
132
167
  - 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
168
  - 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
169
  - 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
170
 
136
171
  ### Fixed
172
+
137
173
  - 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
174
  - Reserve Intercom's reply waiter before sending concurrent asks, so a rejected contender neither sends its question nor cancels the active wait.
139
175
  - Include the current run ID and predecessor in final continuation and answer results, including recovered native waits.
@@ -159,6 +195,7 @@
159
195
  ## [0.40.1] - 2026-09-22
160
196
 
161
197
  ### Fixed
198
+
162
199
  - 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
200
  - Keep restored ownership and controls ready for immediate native tool resume, including nested children.
164
201
  - 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 +205,7 @@
168
205
  ## [0.40.0] - 2026-09-22
169
206
 
170
207
  ### Changed
208
+
171
209
  - 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
210
  - 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
211
  - 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 +213,24 @@
175
213
  - 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
214
 
177
215
  ### Added
216
+
178
217
  - 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
218
  - 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
219
 
181
220
  ## [0.39.1] - 2026-09-22
182
221
 
183
222
  ### Fixed
223
+
184
224
  - 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
225
 
186
226
  ## [0.39.0] - 2026-09-21
187
227
 
188
228
  ### Added
229
+
189
230
  - 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
231
 
191
232
  ### Fixed
233
+
192
234
  - 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
235
  - 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
236
  - Undo explicit cwd requests rejected before launch so they cannot affect a later ordinary continuation.
@@ -196,18 +238,21 @@
196
238
  ## [0.38.2] - 2026-09-19
197
239
 
198
240
  ### Fixed
241
+
199
242
  - 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
243
  - 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
244
 
202
245
  ## [0.38.1] - 2026-09-18
203
246
 
204
247
  ### Fixed
248
+
205
249
  - Activate the structured-output capture tool after a saved session resumes, preserving the host's active tool selection.
206
250
  - 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
251
 
208
252
  ## [0.38.0] - 2026-09-15
209
253
 
210
254
  ### Added
255
+
211
256
  - 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
257
  - 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
258
  - 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 +261,11 @@
216
261
  - 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
262
 
218
263
  ### Changed
264
+
219
265
  - **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
266
 
221
267
  ### Fixed
268
+
222
269
  - Make `skill: false` disable inherited skills across foreground, async, parallel, chain, and resumed runs.
223
270
  - Keep Claude Code children leaf-only and map supported project-context and skill isolation settings to Claude Code CLI flags.
224
271
  - 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 +287,25 @@
240
287
  ## [0.37.2] - 2026-09-09
241
288
 
242
289
  ### Fixed
290
+
243
291
  - 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
292
 
245
293
  ## [0.37.1] - 2026-09-07
246
294
 
247
295
  ### Fixed
296
+
248
297
  - Skip unrelated sessions before nested-run discovery during startup and the first restore poll, preserving matching jobs and their reconciliation.
249
298
 
250
299
  ## [0.37.0] - 2026-09-07
251
300
 
252
301
  ### Added
302
+
253
303
  - 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
304
 
255
305
  ## [0.36.1] - 2026-09-07
256
306
 
257
307
  ### Fixed
308
+
258
309
  - Accept current validated finalization reports after successful native retries or settled-process cleanup, while preserving actual process and final assistant failures.
259
310
  - Require native Pi `952c27cd6` for correct prompt admission and settlement; verify rejected input and queued startup without receiver replay.
260
311
  - Deliver idle intercom batches in one wake while preserving the selected ask as the default reply target.
@@ -272,10 +323,12 @@
272
323
  ## [0.36.0] - 2026-09-06
273
324
 
274
325
  ### Added
326
+
275
327
  - Attention-first, paged owned-run lists and explicit parent review (`accepted` or `needs_changes`), separate from execution, acceptance checks, and notification.
276
328
  - Persistent root/predecessor/continuation history and inspectable effective launch configuration with profile provenance.
277
329
 
278
330
  ### Fixed
331
+
279
332
  - 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
333
  - Remove artificial message-count caps from broker replace queues, accepted-message recovery, and pending asks; retain milestone coalescing and ordinary peer ask timeouts.
281
334
  - 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 +346,7 @@
293
346
  - Stop smoke-test parents, detached workers, and their private broker before removing copied credentials or artifacts, including timeout and handled cancellation.
294
347
 
295
348
  ### Changed
349
+
296
350
  - 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
351
  - 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
352
  - 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 +355,13 @@
301
355
  ## [0.35.0] - 2026-09-06
302
356
 
303
357
  ### Added
358
+
304
359
  - Compact `delegate` and `agent_runs` tools for ordinary delegation, owned-run discovery, inspection, nudges, continuation, and stopping without loading the advanced workflow schema.
305
360
  - 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
361
  - Credential-free Linux validation on the supported Node floor and current Node, plus stronger real-Pi tool, settlement, and model-identity checks.
307
362
 
308
363
  ### Fixed
364
+
309
365
  - 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
366
  - Share child-process lifecycle handling, wait for native Pi settlement, stop descendant processes on cancellation, and distinguish explicit supervisor-question detachment from interruption.
311
367
  - 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 +371,26 @@
315
371
  - Keep deferred material updates until delivered or superseded, distinguish busy-peer refusal from successful delivery, and expose unconsumed intercom messages.
316
372
 
317
373
  ### Changed
374
+
318
375
  - Completion mutation checks are explicitly opt-in with `completionGuard: true`; task prose no longer determines whether a valid answer must edit files.
319
376
  - Support macOS and Linux only; remove Windows-specific runtime branches and old package promotional branding while retaining required license notices.
320
377
 
321
378
  ## [0.34.18] - 2026-09-05
322
379
 
323
380
  ### Fixed
381
+
324
382
  - 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
383
 
326
384
  ## [0.34.17] - 2026-09-04
327
385
 
328
386
  ### Fixed
387
+
329
388
  - 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
389
 
331
390
  ## [0.34.16] - 2026-09-03
332
391
 
333
392
  ### Changed
393
+
334
394
  - 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
395
  - Ground reviewer findings in the original request and concrete evidence, without speculative findings or a mandatory disposition taxonomy.
336
396
  - Explicitly disable nested delegation in every bundled profile and keep reviewer delegation with the parent.
@@ -339,63 +399,75 @@
339
399
  ## [0.34.15] - 2026-08-27
340
400
 
341
401
  ### Changed
402
+
342
403
  - 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
404
 
344
405
  ## [0.34.14] - 2026-08-26
345
406
 
346
407
  ### Fixed
408
+
347
409
  - Suppress npm stderr while probing global packages so npm config warnings do not leak into the Pi TUI during skill discovery.
348
410
 
349
411
  ## [0.34.13] - 2026-08-26
350
412
 
351
413
  ### Changed
414
+
352
415
  - 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
416
 
354
417
  ## [0.34.12] - 2026-08-25
355
418
 
356
419
  ### Changed
420
+
357
421
  - 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
422
 
359
423
  ## [0.34.11] - 2026-08-25
360
424
 
361
425
  ### Fixed
426
+
362
427
  - Ignore reserved `AGENTS.md` instruction files during recursive subagent discovery.
363
428
 
364
429
  ## [0.34.10] - 2026-08-20
365
430
 
366
431
  ### Changed
432
+
367
433
  - 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
434
 
369
435
  ## [0.34.9] - 2026-08-18
370
436
 
371
437
  ### Changed
438
+
372
439
  - 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
440
  - Respect Pi tool allowlists and exclusions, and reset deferred activation after compaction so guidance is restored on the next load.
374
441
 
375
442
  ## [0.34.8] - 2026-08-16
376
443
 
377
444
  ### Changed
445
+
378
446
  - 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
447
 
380
448
  ## [0.34.7] - 2026-08-16
381
449
 
382
450
  ### Changed
451
+
383
452
  - 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
453
  - Drop the resolved per-agent context note and the leftover peer-hint "counts only" wording now that the hint is a constant string.
385
454
 
386
455
  ## [0.34.6] - 2026-08-16
387
456
 
388
457
  ### Fixed
458
+
389
459
  - 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
460
 
391
461
  ## [0.34.5] - 2026-08-16
392
462
 
393
463
  ### Changed
464
+
394
465
  - 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
466
 
396
467
  ## [0.34.4] - 2026-08-14
397
468
 
398
469
  ### Changed
470
+
399
471
  - 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
472
  - `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
473
  - `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 +477,7 @@
405
477
  ## [0.34.3] - 2026-08-14
406
478
 
407
479
  ### Changed
480
+
408
481
  - `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
482
  - 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
483
  - 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 +485,7 @@
412
485
  ## [0.34.2] - 2026-08-14
413
486
 
414
487
  ### Changed
488
+
415
489
  - `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
490
  - 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
491
  - `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 +494,13 @@
420
494
  ## [0.34.1] - 2026-08-14
421
495
 
422
496
  ### Changed
497
+
423
498
  - `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
499
 
425
500
  ## [0.34.0] - 2026-08-13
426
501
 
427
502
  ### Changed
503
+
428
504
  - 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
505
  - 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
506
  - 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 +508,30 @@
432
508
  ## [0.33.7] - 2026-08-13
433
509
 
434
510
  ### Fixed
511
+
435
512
  - Bound outstanding inbound redelivery to the same 100-message recipient queue limit.
436
513
 
437
514
  ### Changed
515
+
438
516
  - Document that Esc before consume re-delivers steered intercom messages after the turn settles.
439
517
 
440
518
  ## [0.33.6] - 2026-08-13
441
519
 
442
520
  ### Fixed
521
+
443
522
  - Re-deliver inbound intercom steers and follow-ups after the recipient aborts, including a second Esc, so unconsumed peer messages are not dropped.
444
523
  - Retry detached runner startup when an in-place extension update temporarily removes its runtime dependencies.
445
524
 
446
525
  ## [0.33.5] - 2026-08-11
447
526
 
448
527
  ### Fixed
528
+
449
529
  - 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
530
 
451
531
  ## [0.33.4] - 2026-08-11
452
532
 
453
533
  ### Fixed
534
+
454
535
  - 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
536
  - 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
537
  - Keep composed tool-schema constraints compatible with Fireworks-hosted models without weakening validation for other providers.
@@ -458,17 +539,20 @@
458
539
  ## [0.33.3] - 2026-08-09
459
540
 
460
541
  ### Changed
542
+
461
543
  - 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
544
  - 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
545
 
464
546
  ## [0.33.2] - 2026-08-08
465
547
 
466
548
  ### Fixed
549
+
467
550
  - 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
551
 
469
552
  ## [0.33.1] - 2026-08-08
470
553
 
471
554
  ### Fixed
555
+
472
556
  - Keep the required `structured_output` tool enabled when a child agent defines an explicit tool allowlist.
473
557
  - Render multiline doctor and management results as readable, expandable slash-command cards instead of truncating the whole report as one terminal line.
474
558
  - Tell nested orchestrators when a foreground child call has completed so model-sensitive loops do not relaunch the same successful task.
@@ -477,14 +561,17 @@
477
561
  ## [0.33.0] - 2026-08-08
478
562
 
479
563
  ### Added
564
+
480
565
  - 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
566
 
482
567
  ### Changed
568
+
483
569
  - 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
570
  - 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
571
  - 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
572
 
487
573
  ### Fixed
574
+
488
575
  - 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
576
  - 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
577
  - 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 +583,15 @@
496
583
  ## [0.32.0] - 2026-08-06
497
584
 
498
585
  ### Added
586
+
499
587
  - 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
588
 
501
589
  ### Fixed
590
+
502
591
  - 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
592
 
504
593
  ### Changed
594
+
505
595
  - 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
596
  - 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
597
  - 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 +603,47 @@
513
603
  ## [0.31.0] - 2026-08-04
514
604
 
515
605
  ### Changed
606
+
516
607
  - 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
608
  - 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
609
 
519
610
  ## [0.30.0] - 2026-08-04
520
611
 
521
612
  ### Added
613
+
522
614
  - 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
615
 
524
616
  ### Changed
617
+
525
618
  - Aligned `contact_supervisor` progress guidance around concise material updates while preserving deferred/coalesced delivery and normal completion handoffs.
526
619
 
527
620
  ## [0.29.2] - 2026-08-04
528
621
 
529
622
  ### Changed
623
+
530
624
  - Route the bundled `reviewer-claude` profile through `anthropic/claude-opus-5`, with Fable and Grok as fallbacks.
531
625
  - 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
626
 
533
627
  ### Removed
628
+
534
629
  - Replaced the local `StringEnum` implementation and duplicate thinking-level declarations with TypeBox's native enum and the shared model helper.
535
630
  - Deleted the unreachable artifact JSONL writer and its isolated tests.
536
631
 
537
632
  ## [0.29.1] - 2026-08-04
538
633
 
539
634
  ### Changed
635
+
540
636
  - 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
637
 
542
638
  ### Removed
639
+
543
640
  - Deleted two non-shipped, planning-only refactor documents.
544
641
  - Removed the legacy result-animation timer cleanup path and its synthetic test; the current renderer never creates that timer.
545
642
 
546
643
  ## [0.29.0] - 2026-08-04
547
644
 
548
645
  ### Changed
646
+
549
647
  - 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
648
  - 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
649
  - Removed Cursor-hosted fallback routes from the seven affected bundled agent profiles while preserving their remaining direct-provider routes.
@@ -575,6 +673,7 @@
575
673
  - Run local test scripts through a small wrapper that clears inherited `PI_SUBAGENT_*` runtime variables before starting the Node test runner.
576
674
 
577
675
  ### Fixed
676
+
578
677
  - 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
678
  - 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
679
  - Preserve the user's Ctrl+O tool-output expansion setting when subagent tools and slash commands run instead of forcing it collapsed.
@@ -599,43 +698,52 @@
599
698
  ## [0.28.0] - 2026-06-03
600
699
 
601
700
  ### Added
701
+
602
702
  - 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
703
  - 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
704
 
605
705
  ### Changed
706
+
606
707
  - 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
708
 
608
709
  ### Fixed
710
+
609
711
  - 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
712
  - 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
713
 
612
714
  ## [0.27.0] - 2026-05-30
613
715
 
614
716
  ### Changed
717
+
615
718
  - 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
719
  - Documented goal-style acceptance guidance so `/goal`, “active goal”, and “work until evidence says done” requests map to run-scoped `acceptance` contracts.
617
720
  - Refined acceptance finalization prompts and status output to emphasize evidence, blockers, stop rules, and finalization progress such as `completed after 1/3 turns`.
618
721
 
619
722
  ### Fixed
723
+
620
724
  - 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
725
 
622
726
  ## [0.26.0] - 2026-05-29
623
727
 
624
728
  ### Added
729
+
625
730
  - 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
731
  - 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
732
  - 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
733
 
629
734
  ### Fixed
735
+
630
736
  - 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
737
  - 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
738
 
633
739
  ## [0.25.0] - 2026-05-21
634
740
 
635
741
  ### Added
742
+
636
743
  - 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
744
 
638
745
  ### Fixed
746
+
639
747
  - Preserve compact nested child summaries in grouped result/intercom payloads and async completion metadata before ordinary result files are processed and deleted.
640
748
  - Keep async result files retryable when nested registry enrichment temporarily fails, instead of marking them seen before a successful delivery pass.
641
749
  - 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 +753,7 @@
645
753
  ## [0.24.4] - 2026-05-20
646
754
 
647
755
  ### Fixed
756
+
648
757
  - Treat provider-coerced single-run `output: "false"` the same as boolean `false`, preventing literal `false` output files in foreground and async runs.
649
758
  - Include selected direct MCP tool names in explicit child `--tools` allowlists when metadata cache/config resolution is available.
650
759
  - Honor `PI_CODING_AGENT_DIR` for runtime config, agent/chain/settings discovery, skills, run history, artifact cleanup, and intercom defaults.
@@ -658,30 +767,36 @@
658
767
  ## [0.24.3] - 2026-05-14
659
768
 
660
769
  ### Added
770
+
661
771
  - Show provider-free model and thinking labels in async subagent widgets and status views.
662
772
  - 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
773
 
664
774
  ### Fixed
775
+
665
776
  - 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
777
 
667
778
  ## [0.24.2] - 2026-05-10
668
779
 
669
780
  ### Fixed
781
+
670
782
  - 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
783
 
672
784
  ## [0.24.1] - 2026-05-10
673
785
 
674
786
  ### Changed
787
+
675
788
  - 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
789
 
677
790
  ## [0.24.0] - 2026-05-03
678
791
 
679
792
  ### Changed
793
+
680
794
  - Consolidated async step activity and parallel-outcome formatting used by widgets and `subagent({ action: "status" })` output.
681
795
  - 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
796
  - 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
797
 
684
798
  ### Removed
799
+
685
800
  - 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
801
  - 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
802
  - 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 +805,11 @@
690
805
  ## [0.23.1] - 2026-05-02
691
806
 
692
807
  ### Added
808
+
693
809
  - 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
810
 
695
811
  ### Fixed
812
+
696
813
  - 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
814
  - 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
815
  - 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 +824,11 @@
707
824
  ## [0.23.0] - 2026-05-02
708
825
 
709
826
  ### Fixed
827
+
710
828
  - 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
829
 
712
830
  ### Changed
831
+
713
832
  - 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
833
  - Retry foreground subagent fallback models when Pi reports a retryable provider error, such as 429/quota, even if the child process exits successfully.
715
834
  - 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 +838,25 @@
719
838
  ## [0.22.0] - 2026-05-02
720
839
 
721
840
  ### Added
841
+
722
842
  - 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
843
  - 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
844
 
725
845
  ### Changed
846
+
726
847
  - 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
848
  - Hide unsupported thinking levels in subagent clarify and agent-manager pickers when Pi exposes per-model thinking metadata.
728
849
  - Updated builtin agent prompts, README, and bundled skill docs to prefer `contact_supervisor` for blocked decisions and avoid child-side routine completion handoffs.
729
850
  - Teach reviewer agents that repo-local `progress.md` files are intentional scratch files that should remain untracked and covered by `.gitignore`.
730
851
 
731
852
  ### Fixed
853
+
732
854
  - Added regression coverage for supervisor metadata propagation into child process environments.
733
855
 
734
856
  ## [0.21.5] - 2026-05-02
735
857
 
736
858
  ### Fixed
859
+
737
860
  - 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
861
  - Scoped `/subagents-status` to async runs launched from the current pi session instead of showing prior or unrelated sessions.
739
862
  - 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 +865,36 @@
742
865
  ## [0.21.4] - 2026-05-01
743
866
 
744
867
  ### Added
868
+
745
869
  - 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
870
  - Added recursive subdirectory discovery for user and project agent and chain definitions.
747
871
  - 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
872
 
749
873
  ### Fixed
874
+
750
875
  - 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
876
 
752
877
  ## [0.21.3] - 2026-04-30
753
878
 
754
879
  ### Fixed
880
+
755
881
  - 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
882
 
757
883
  ## [0.21.2] - 2026-04-30
758
884
 
759
885
  ### Added
886
+
760
887
  - Added a packaged `/parallel-context-build` prompt for parallel `context-builder` handoff passes.
761
888
  - Added a packaged `/parallel-handoff-plan` prompt for external-reference research plus local `context-builder` passes that produce an implementation handoff meta-prompt.
762
889
 
763
890
  ### Changed
891
+
764
892
  - Strengthened `context-builder` guidance so handoffs require reading all relevant files and doing needed tool-available research before summarizing.
765
893
  - 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
894
  - Updated `README.md` to explain the bundled `pi-subagents` skill, what it covers, and how it helps the orchestrating agent.
767
895
 
768
896
  ### Fixed
897
+
769
898
  - Make active-long-running notices time-based by default, with turn and token thresholds available only as explicit opt-in budget guards.
770
899
  - Stop async status listing from inventing `needs_attention` with default thresholds when the runner has not persisted a control state.
771
900
  - 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 +905,11 @@
776
905
  ## [0.21.1] - 2026-04-30
777
906
 
778
907
  ### Changed
908
+
779
909
  - Changed the `/agents` new-agent shortcut from `Alt+N` to `Shift+Ctrl+N`, and added `agentManager.newShortcut` config for overriding it.
780
910
 
781
911
  ### Fixed
912
+
782
913
  - Fall back to polling async result files when native result watching is unavailable due to `EMFILE` or `ENOSPC`.
783
914
  - Treat forced final-drain termination after a valid final assistant output as cleanup success instead of failing the subagent run.
784
915
  - Hide disabled builtin agents from `subagent({ action: "list" })` output so agent-facing choices match executable runtime discovery.
@@ -788,11 +919,13 @@
788
919
  ## [0.21.0] - 2026-04-29
789
920
 
790
921
  ### Changed
922
+
791
923
  - Document the recommended parent-agent workflow as `clarify → planner → worker → fresh reviewers → worker` in the docs and bundled skill.
792
924
  - 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
925
  - 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
926
 
795
927
  ### Fixed
928
+
796
929
  - Prevent child subagents from receiving parent orchestration tooling/history, and inject boundary instructions that forbid sub-delegation and pseudo tool calls.
797
930
  - Added active-long-running and repeated mutating-tool failure notices so supervised/forked workers cannot burn turns silently while still appearing healthy.
798
931
  - Fixed task editor wrapping so wide characters cannot push text past the right border.
@@ -809,35 +942,43 @@
809
942
  ## [0.20.1] - 2026-04-27
810
943
 
811
944
  ### Fixed
945
+
812
946
  - Made the packaged `/parallel-cleanup` prompt self-contained instead of referencing local-only cleanup skills.
813
947
 
814
948
  ## [0.20.0] - 2026-04-27
815
949
 
816
950
  ### Added
951
+
817
952
  - Added a packaged `/parallel-cleanup` prompt for focused cleanup review passes.
818
953
 
819
954
  ### Changed
955
+
820
956
  - 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
957
  - Updated the bundled `scout` agent model/thinking defaults.
822
958
  - 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
959
 
824
960
  ### Fixed
961
+
825
962
  - Fixed status and manager row rendering so multiline or tabbed content cannot overflow table rows.
826
963
 
827
964
  ### Removed
965
+
828
966
  - Removed the bundled `oracle-executor` agent and `/oracle-executor` prompt template in favor of using `worker` for approved oracle handoffs.
829
967
 
830
968
  ## [0.19.3] - 2026-04-27
831
969
 
832
970
  ### Changed
971
+
833
972
  - 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
973
 
835
974
  ## [0.19.2] - 2026-04-27
836
975
 
837
976
  ### Added
977
+
838
978
  - Added packaged prompt templates for common subagent workflows: `/parallel-research`, `/gather-context-and-clarify`, and `/oracle-executor`.
839
979
 
840
980
  ### Changed
981
+
841
982
  - Tightened the packaged `/parallel-review` prompt so fresh-context reviewers get distinct angles and return evidence-backed findings.
842
983
  - 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
984
  - 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 +986,32 @@
845
986
  ## [0.19.1] - 2026-04-26
846
987
 
847
988
  ### Added
989
+
848
990
  - Added `subagent({ action: "doctor" })` and `/subagents-doctor` for read-only subagent environment diagnostics.
849
991
  - Added `/run-chain` to launch saved `.chain.md` workflows directly from slash commands with completion, shared task input, and `--bg`/`--fork` support.
850
992
 
851
993
  ## [0.19.0] - 2026-04-26
852
994
 
853
995
  ### Added
996
+
854
997
  - Added top-level parallel task support for per-task `output`, `reads`, and `progress`, including `/parallel` inline forwarding and async preservation.
855
998
  - Added `/agents` launch toggles for forked context, background execution, and worktree-isolated parallel runs.
856
999
  - Added a read-only detail view to `/subagents-status` for inspecting selected async runs, including recent events, output tails, and useful run paths.
857
1000
  - Added a packaged `/parallel-review` prompt template for launching fresh-context adversarial review subagents.
858
1001
 
859
1002
  ### Fixed
1003
+
860
1004
  - Parallel and chain child runs now detach cleanly when a child uses intercom, preventing incoming handoff messages from aborting the parent foreground run.
861
1005
 
862
1006
  ## [0.18.1] - 2026-04-25
863
1007
 
864
1008
  ### Changed
1009
+
865
1010
  - Restyled live subagent rendering, async widgets, and background completion notifications with compact Claude-style visual grammar while preserving existing observability paths.
866
1011
  - Parallel subagent result rendering now labels parallel workers as `Agent N` instead of `Step N`, while chain rendering keeps step terminology.
867
1012
 
868
1013
  ### Fixed
1014
+
869
1015
  - `/run` and single-agent tool calls now allow self-contained agents to run without a task string.
870
1016
  - The `subagent` tool description no longer advertises hardcoded builtin agent names and management list output now separates disabled builtins from executable agents.
871
1017
  - Flexible `subagent` tool schema fields now include explicit JSON Schema types so llama.cpp and local OpenAI-compatible providers accept them.
@@ -875,57 +1021,70 @@
875
1021
  ## [0.18.0] - 2026-04-23
876
1022
 
877
1023
  ### Added
1024
+
878
1025
  - 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
1026
  - 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
1027
 
881
1028
  ### Changed
1029
+
882
1030
  - 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
1031
  - Added `subagent({ action: "status", id })` and `subagent({ action: "status" })` as the control-surface status checks, replacing the separate `subagent_status(...)` tool.
884
1032
  - Adjusted bundled agent defaults: most builtins now use `openai-codex/gpt-5.5`, while `scout` uses `openai-codex/gpt-5.4-mini`.
885
1033
  - Removed the incomplete e2e suite and stale `@marcfargas/pi-test-harness` dev dependency; `test:all` now runs the maintained unit and integration suites.
886
1034
 
887
1035
  ### Fixed
1036
+
888
1037
  - 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
1038
  - Async status output no longer shows stale activity-age lines for paused or completed runs.
890
1039
 
891
1040
  ## [0.17.5] - 2026-04-23
892
1041
 
893
1042
  ### Added
1043
+
894
1044
  - 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
1045
 
896
1046
  ### Changed
1047
+
897
1048
  - 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
1049
 
899
1050
  ### Fixed
1051
+
900
1052
  - 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
1053
  - 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
1054
 
903
1055
  ## [0.17.4] - 2026-04-22
904
1056
 
905
1057
  ### Added
1058
+
906
1059
  - 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
1060
 
908
1061
  ### Changed
1062
+
909
1063
  - 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
1064
  - 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
1065
 
912
1066
  ## [0.17.3] - 2026-04-22
913
1067
 
914
1068
  ### Added
1069
+
915
1070
  - 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
1071
 
917
1072
  ### Fixed
1073
+
918
1074
  - Migrated extension tool schemas from `@sinclair/typebox` to `typebox` 1.x so packaged installs follow Pi's current extension runtime contract.
919
1075
 
920
1076
  ### Changed
1077
+
921
1078
  - Moved TypeBox from `peerDependencies` to a real `dependencies` entry so `pi install` production installs keep the schema package available at runtime.
922
1079
 
923
1080
  ## [0.17.2] - 2026-04-21
924
1081
 
925
1082
  ### Added
1083
+
926
1084
  - Added `forceTopLevelAsync` so depth-0 delegated runs can be forced into background mode with `clarify: false`, while nested runs keep their existing behavior.
927
1085
 
928
1086
  ### Fixed
1087
+
929
1088
  - Background completion notifications now render `(no output)` instead of a blank body when a completion summary is empty or whitespace-only.
930
1089
  - 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
1090
  - Async/background startup now fails fast for invalid resolved `cwd` values and spawn failures instead of reporting false launch success.
@@ -934,23 +1093,28 @@
934
1093
  ## [0.17.1] - 2026-04-20
935
1094
 
936
1095
  ### Added
1096
+
937
1097
  - 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
1098
 
939
1099
  ### Changed
1100
+
940
1101
  - 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
1102
  - 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
1103
  - 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
1104
  - Builtin agent defaults now prefer `openai-codex` models for `planner`, `scout`, `researcher`, `context-builder`, and `worker`.
944
1105
 
945
1106
  ### Fixed
1107
+
946
1108
  - 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
1109
 
948
1110
  ## [0.17.0] - 2026-04-16
949
1111
 
950
1112
  ### Added
1113
+
951
1114
  - 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
1115
 
953
1116
  ### Fixed
1117
+
954
1118
  - 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
1119
  - `/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
1120
  - 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 +1122,21 @@
958
1122
  ## [0.16.1] - 2026-04-16
959
1123
 
960
1124
  ### Changed
1125
+
961
1126
  - 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
1127
 
963
1128
  ## [0.16.0] - 2026-04-16
964
1129
 
965
1130
  ### Added
1131
+
966
1132
  - 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
1133
 
968
1134
  ### Changed
1135
+
969
1136
  - 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
1137
 
971
1138
  ### Fixed
1139
+
972
1140
  - `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
1141
  - 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
1142
  - 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 +1144,18 @@
976
1144
  ## [0.15.0] - 2026-04-16
977
1145
 
978
1146
  ### Added
1147
+
979
1148
  - 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
1149
  - 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
1150
 
982
1151
  ### Changed
1152
+
983
1153
  - Builtin subagents now default to `systemPromptMode: replace`, with builtin `delegate` staying on `append`.
984
1154
  - Builtin agents now inherit project-level instruction files by default unless the user overrides them.
985
1155
  - 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
1156
 
987
1157
  ### Fixed
1158
+
988
1159
  - 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
1160
  - 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
1161
  - 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 +1165,7 @@
994
1165
  ## [0.14.1] - 2026-04-14
995
1166
 
996
1167
  ### Fixed
1168
+
997
1169
  - 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
1170
  - Prompt-template delegation now rebuilds minimal assistant messages from compact foreground results when raw message arrays are intentionally omitted.
999
1171
  - 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 +1174,11 @@
1002
1174
  ## [0.14.0] - 2026-04-14
1003
1175
 
1004
1176
  ### Added
1177
+
1005
1178
  - 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
1179
 
1007
1180
  ### Fixed
1181
+
1008
1182
  - 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
1183
  - 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
1184
  - 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 +1187,7 @@
1013
1187
  ## [0.13.4] - 2026-04-13
1014
1188
 
1015
1189
  ### Fixed
1190
+
1016
1191
  - 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
1192
  - 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
1193
  - 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 +1198,11 @@
1023
1198
  ## [0.13.3] - 2026-04-13
1024
1199
 
1025
1200
  ### Added
1201
+
1026
1202
  - Added `intercomBridge.instructionFile` so subagent intercom guidance can be overridden from a Markdown template with `{orchestratorTarget}` interpolation.
1027
1203
 
1028
1204
  ### Fixed
1205
+
1029
1206
  - Intercom-enabled delegated runs now detach only after the child actually starts the `intercom` tool, preserving clean sync behavior until coordination is needed.
1030
1207
  - 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
1208
  - Child process spawn failures now preserve the original error message instead of collapsing to a generic failure.
@@ -1033,43 +1210,52 @@
1033
1210
  ## [0.13.2] - 2026-04-13
1034
1211
 
1035
1212
  ### Changed
1213
+
1036
1214
  - `intercomBridge` now defaults to `always` so intercom coordination instructions are injected for both `fresh` and `fork` delegated runs when `pi-intercom` is available.
1037
1215
 
1038
1216
  ## [0.13.1] - 2026-04-13
1039
1217
 
1040
1218
  ### Added
1219
+
1041
1220
  - 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
1221
  - Added unit coverage for intercom bridge activation, config handling, and extension allowlist behavior.
1043
1222
 
1044
1223
  ### Changed
1224
+
1045
1225
  - Normalized `subagent-executor.ts` relative imports to `.ts` specifiers to match direct TypeScript runtime loading.
1046
1226
  - Documented `pi-intercom` installation and activation requirements in README.
1047
1227
 
1048
1228
  ### Fixed
1229
+
1049
1230
  - Tightened intercom extension allowlist matching to avoid false positives from similarly named extension paths.
1050
1231
 
1051
1232
  ## [0.13.0] - 2026-04-11
1052
1233
 
1053
1234
  ### Added
1235
+
1054
1236
  - 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
1237
 
1056
1238
  ### Fixed
1239
+
1057
1240
  - 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
1241
  - 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
1242
 
1060
1243
  ## [0.12.5] - 2026-04-09
1061
1244
 
1062
1245
  ### Fixed
1246
+
1063
1247
  - 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
1248
  - 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
1249
 
1066
1250
  ## [0.12.4] - 2026-04-04
1067
1251
 
1068
1252
  ### Added
1253
+
1069
1254
  - 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
1255
  - 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
1256
 
1072
1257
  ### Fixed
1258
+
1073
1259
  - Added support for loading agents and skills from `.agents/` and `~/.agents/` directories.
1074
1260
  - 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
1261
  - Declared pi runtime packages and `@sinclair/typebox` as peer dependencies so direct source-loading environments fail less often from missing package resolution.
@@ -1077,21 +1263,25 @@
1077
1263
  - 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
1264
 
1079
1265
  ### Changed
1266
+
1080
1267
  - Added release documentation for TypeScript direct-runtime loading support and related package requirements.
1081
1268
 
1082
1269
  ## [0.12.2] - 2026-04-04
1083
1270
 
1084
1271
  ### Changed
1272
+
1085
1273
  - 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
1274
 
1087
1275
  ## [0.12.1] - 2026-04-03
1088
1276
 
1089
1277
  ### Changed
1278
+
1090
1279
  - 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
1280
 
1092
1281
  ## [0.12.0] - 2026-03-31
1093
1282
 
1094
1283
  ### Added
1284
+
1095
1285
  - 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
1286
  - Added `worktree.ts` to manage worktree lifecycle, diff capture, patch generation, and cleanup for isolated parallel runs.
1097
1287
  - 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 +1290,13 @@
1100
1290
  - Documented worktree isolation, async status surfaces, and the reorganized test layout in the README.
1101
1291
 
1102
1292
  ### Changed
1293
+
1103
1294
  - 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
1295
  - 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
1296
  - 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
1297
 
1107
1298
  ### Fixed
1299
+
1108
1300
  - 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
1301
  - 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
1302
  - 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 +1310,7 @@
1118
1310
  ## [0.11.12] - 2026-03-28
1119
1311
 
1120
1312
  ### Changed
1313
+
1121
1314
  - 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
1315
  - 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
1316
  - 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 +1318,30 @@
1125
1318
  ## [0.11.11] - 2026-03-23
1126
1319
 
1127
1320
  ### Changed
1321
+
1128
1322
  - 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
1323
 
1130
1324
  ## [0.11.10] - 2026-03-21
1131
1325
 
1132
1326
  ### Changed
1327
+
1133
1328
  - 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
1329
 
1135
1330
  ## [0.11.9] - 2026-03-21
1136
1331
 
1137
1332
  ### Fixed
1333
+
1138
1334
  - `/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
1335
  - `/agents` overlay chain launches no longer bypass the executor for async fallback, fixing a path where async chain errors were silently swallowed.
1140
1336
 
1141
1337
  ### Changed
1338
+
1142
1339
  - 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
1340
  - 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
1341
  - `/parallel` now uses the native `tasks` parameter directly instead of wrapping through `{ chain: [{ parallel: tasks }] }`.
1145
1342
 
1146
1343
  ### Added
1344
+
1147
1345
  - `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
1346
  - `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
1347
  - Clarified README Usage section to distinguish LLM tool parameters from user-facing slash commands.
@@ -1151,43 +1349,51 @@
1151
1349
  ## [0.11.8] - 2026-03-21
1152
1350
 
1153
1351
  ### Added
1352
+
1154
1353
  - 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
1354
 
1156
1355
  ## [0.11.7] - 2026-03-20
1157
1356
 
1158
1357
  ### Changed
1358
+
1159
1359
  - 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
1360
 
1161
1361
  ## [0.11.6] - 2026-03-20
1162
1362
 
1163
1363
  ### Added
1364
+
1164
1365
  - 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
1366
 
1166
1367
  ## [0.11.5] - 2026-03-20
1167
1368
 
1168
1369
  ### Added
1370
+
1169
1371
  - 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
1372
  - 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
1373
  - Added delegated progress streaming via `prompt-template:subagent:update`, mapped from subagent executor `onUpdate` progress payloads.
1172
1374
 
1173
1375
  ### Changed
1376
+
1174
1377
  - Session lifecycle reset now preserves the latest extension context for event-bus delegated runs.
1175
1378
  - `[fork]` badge is now shown only on the result row, not duplicated on both the tool-call and result rows.
1176
1379
 
1177
1380
  ## [0.11.4] - 2026-03-19
1178
1381
 
1179
1382
  ### Added
1383
+
1180
1384
  - Added explicit execution context mode for tool calls: `context: "fresh" | "fork"` (default: `fresh`).
1181
1385
  - 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
1386
  - Added `--fork` slash-command flag for `/run`, `/chain`, and `/parallel` to forward `context: "fork"`.
1183
1387
  - Added regression coverage for fork execution/session wiring and fork badge rendering, including slash command forwarding tests.
1184
1388
 
1185
1389
  ### Changed
1390
+
1186
1391
  - Session argument wiring now supports `--session <file>` in addition to `--session-dir`, enabling exact leaf-preserving forks without summary injection.
1187
1392
  - Async runner step payloads now carry per-step session files so background single/chain/parallel executions can also honor `context: "fork"`.
1188
1393
  - Clarified docs for foreground vs background semantics so `--bg` behavior is explicit.
1189
1394
 
1190
1395
  ### Fixed
1396
+
1191
1397
  - `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
1398
  - Fork-session creation errors are now surfaced as tool errors instead of bubbling as uncaught exceptions during execution.
1193
1399
  - Session directory preparation now fails loudly with actionable errors (instead of silently swallowing mkdir failures).
@@ -1199,6 +1405,7 @@
1199
1405
  ## [0.11.3] - 2026-03-17
1200
1406
 
1201
1407
  ### Changed
1408
+
1202
1409
  - 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
1410
  - Extracted shared pi CLI arg-builder (`pi-args.ts`) from duplicated logic in `execution.ts` and `subagent-runner.ts`.
1204
1411
  - 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 +1413,46 @@
1206
1413
  ## [0.11.2] - 2026-03-11
1207
1414
 
1208
1415
  ### Fixed
1416
+
1209
1417
  - `--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
1418
  - `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
1419
  - 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
1420
 
1213
1421
  ### Removed
1422
+
1214
1423
  - 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
1424
 
1216
1425
  ## [0.11.1] - 2026-03-08
1217
1426
 
1218
1427
  ### Changed
1428
+
1219
1429
  - **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
1430
 
1221
1431
  ## [0.11.0] - 2026-02-23
1222
1432
 
1223
1433
  ### Added
1434
+
1224
1435
  - **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
1436
  - **`--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
1437
 
1227
1438
  ### Fixed
1439
+
1228
1440
  - 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
1441
 
1230
1442
  ## [0.10.0] - 2026-02-23
1231
1443
 
1232
1444
  ### Added
1445
+
1233
1446
  - **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
1447
  - **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
1448
  - GitHub Actions CI workflow running tests on both Ubuntu and Windows with Node.js 24.
1236
1449
 
1237
1450
  ### Changed
1451
+
1238
1452
  - **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
1453
 
1240
1454
  ### Fixed
1455
+
1241
1456
  - `mapConcurrent` with `limit=0` returned array of undefined values instead of processing items sequentially. Now clamps limit to at least 1.
1242
1457
  - 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
1458
  - `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 +1469,14 @@
1254
1469
  ## [0.9.2] - 2026-02-19
1255
1470
 
1256
1471
  ### Fixed
1472
+
1257
1473
  - 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
1474
  - Agent Manager scope badge showed `[built]` instead of `[builtin]` in list and detail views. Widened scope column to fit.
1259
1475
 
1260
1476
  ## [0.9.1] - 2026-02-17
1261
1477
 
1262
1478
  ### Fixed
1479
+
1263
1480
  - 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
1481
  - `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
1482
  - 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 +1486,7 @@
1269
1486
  - `handleCreate` now warns when creating an agent that shadows a builtin (informational, not an error).
1270
1487
 
1271
1488
  ### Changed
1489
+
1272
1490
  - Simplified Agent Manager header from per-scope breakdown to total count (per-row badges already show scope).
1273
1491
  - Reviewer builtin model changed from `openai/gpt-5.2` to `openai-codex/gpt-5.3-codex`.
1274
1492
  - Removed `code-reviewer` builtin agent (redundant with `reviewer`).
@@ -1276,6 +1494,7 @@
1276
1494
  ## [0.9.0] - 2026-02-17
1277
1495
 
1278
1496
  ### Added
1497
+
1279
1498
  - **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
1499
  - `scout` — fast codebase recon (claude-haiku-4-5)
1281
1500
  - `planner` — implementation plans from context (claude-opus-4-6, thinking: high)
@@ -1286,17 +1505,20 @@
1286
1505
  - **`"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
1506
 
1288
1507
  ### Fixed
1508
+
1289
1509
  - 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
1510
 
1291
1511
  ## [0.8.5] - 2026-02-16
1292
1512
 
1293
1513
  ### Fixed
1514
+
1294
1515
  - 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
1516
  - Improved the "jiti not found" error message to explain what's needed and how to fix it.
1296
1517
 
1297
1518
  ## [0.8.4] - 2026-02-13
1298
1519
 
1299
1520
  ### Fixed
1521
+
1300
1522
  - 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
1523
  - 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
1524
  - 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 +1526,11 @@
1304
1526
  ## [0.8.3] - 2026-02-11
1305
1527
 
1306
1528
  ### Added
1529
+
1307
1530
  - 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
1531
 
1309
1532
  ### Fixed
1533
+
1310
1534
  - Parallel chain aggregation now surfaces step failures and warnings in `{previous}` instead of silently passing empty output.
1311
1535
  - 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
1536
  - Async execution now respects agent `extensions` sandbox settings, matching sync behavior.
@@ -1319,6 +1543,7 @@
1319
1543
  - Async notifications now standardize on canonical `subagent:started` and `subagent:complete` events (legacy enhanced event emissions removed).
1320
1544
 
1321
1545
  ### Changed
1546
+
1322
1547
  - 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
1548
  - Skill discovery now normalizes and prioritizes collisions by source so project-scoped skills consistently win over user-scoped skills.
1324
1549
  - Documentation now references `<tmpdir>` instead of hardcoded `/tmp` paths for cross-platform clarity.
@@ -1326,16 +1551,19 @@
1326
1551
  ## [0.8.2] - 2026-02-11
1327
1552
 
1328
1553
  ### Added
1554
+
1329
1555
  - 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
1556
 
1331
1557
  ## [0.8.1] - 2026-02-10
1332
1558
 
1333
1559
  ### Added
1560
+
1334
1561
  - **`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
1562
 
1336
1563
  ## [0.8.0] - 2026-02-09
1337
1564
 
1338
1565
  ### Added
1566
+
1339
1567
  - **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
1568
  - `list` — discover agents and chains with scope + description
1341
1569
  - `get` — full detail for agent or chain, including path and system prompt/steps
@@ -1359,6 +1587,7 @@
1359
1587
  ## [0.7.0] - 2026-02-09
1360
1588
 
1361
1589
  ### Added
1590
+
1362
1591
  - **Agents Manager overlay** — browse, view, edit, create, and delete agent definitions from a TUI opened via `Ctrl+Shift+A` or the `/agents` command
1363
1592
  - List screen with search/filter, scope badges (user/project), chain badges
1364
1593
  - Detail screen showing resolved prompt, recent runs, all frontmatter fields
@@ -1396,10 +1625,11 @@
1396
1625
  - Displayed on agent detail screen
1397
1626
 
1398
1627
  ### Fixed
1628
+
1399
1629
  - **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
1630
  - **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
1631
  - **`/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 ` -- `.
1632
+ - **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
1633
  - **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
1634
  - **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
1635
  - **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 +1639,7 @@
1409
1639
  - **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
1640
 
1411
1641
  ### Changed
1642
+
1412
1643
  - 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
1644
  - Extracted `applyThinkingSuffix(model, thinking)` helper from inline logic in `execution.ts`, shared with `async-execution.ts`
1414
1645
  - Text editor: added word navigation (Alt+Left/Right, Ctrl+Left/Right), word delete (Alt+Backspace), paste support
@@ -1417,17 +1648,20 @@
1417
1648
  ## [0.6.0] - 2026-02-02
1418
1649
 
1419
1650
  ### Added
1651
+
1420
1652
  - **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
1653
  - **`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
1654
 
1423
1655
  ## [0.5.3] - 2026-02-01
1424
1656
 
1425
1657
  ### Fixed
1658
+
1426
1659
  - Adapt execute signatures to pi v0.51.0: reorder signal, onUpdate, ctx parameters for subagent tool; add missing parameters to subagent_status tool
1427
1660
 
1428
1661
  ## [0.5.2] - 2026-01-28
1429
1662
 
1430
1663
  ### Improved
1664
+
1431
1665
  - **README: Added agent file locations** - New "Agents" section near top of README clearly documents:
1432
1666
  - User agents: `~/.pi/agent/agents/{name}.md`
1433
1667
  - Project agents: `.pi/agents/{name}.md` (searches up directory tree)
@@ -1438,11 +1672,13 @@
1438
1672
  ## [0.5.1] - 2026-01-27
1439
1673
 
1440
1674
  ### Fixed
1675
+
1441
1676
  - Google API compatibility: Use `Type.Any()` for mixed-type unions (`SkillOverride`, `output`, `reads`, `ChainItem`) to avoid unsupported `anyOf`/`const` JSON Schema patterns
1442
1677
 
1443
1678
  ## [0.5.0] - 2026-01-27
1444
1679
 
1445
1680
  ### Added
1681
+
1446
1682
  - **Skill support** - Agents can declare skills in frontmatter that get injected into system prompts
1447
1683
  - Agent frontmatter: `skill: tmux, chrome-devtools` (comma-separated)
1448
1684
  - Runtime override: `skill: "name"` or `skill: false` to disable all skills
@@ -1458,6 +1694,7 @@
1458
1694
  - **Parallel task skills** - Each parallel task can specify its own skills via `skill` parameter
1459
1695
 
1460
1696
  ### Fixed
1697
+
1461
1698
  - **Chain summary formatting** - Fixed extra blank line when no skills are present
1462
1699
  - **Duplicate skill deduplication** - `skill: "foo,foo"` now correctly deduplicates to `["foo"]`
1463
1700
  - **Consistent skill tracking in async mode** - Both chain and single modes now track only resolved skills
@@ -1465,11 +1702,13 @@
1465
1702
  ## [0.4.1] - 2026-01-26
1466
1703
 
1467
1704
  ### Changed
1705
+
1468
1706
  - Added `pi-package` keyword for npm discoverability (pi v0.50.0 package system)
1469
1707
 
1470
1708
  ## [0.4.0] - 2026-01-25
1471
1709
 
1472
1710
  ### Added
1711
+
1473
1712
  - **Clarify TUI for single and parallel modes** - Use `clarify: true` to preview/edit before execution
1474
1713
  - Single mode: Edit task, model, thinking level, output file
1475
1714
  - Parallel mode: Edit each task independently, model, thinking level
@@ -1478,15 +1717,18 @@
1478
1717
  - **Model override for single/parallel** - TUI model selection now works for all modes
1479
1718
 
1480
1719
  ### Fixed
1720
+
1481
1721
  - **MAX_PARALLEL error mode** - Now correctly returns `mode: 'parallel'` (was incorrectly `mode: 'single'`)
1482
1722
  - **`output: true` handling** - Now correctly treats `true` as "use agent's default output" instead of creating a file literally named "true"
1483
1723
 
1484
1724
  ### Changed
1725
+
1485
1726
  - **Schema description** - `clarify` parameter now documents all modes: "default: true for chains, false for single/parallel"
1486
1727
 
1487
1728
  ## [0.3.3] - 2026-01-25
1488
1729
 
1489
1730
  ### Added
1731
+
1490
1732
  - **Thinking level selector in chain TUI** - Press `[t]` to set thinking level for any step
1491
1733
  - Options: off, minimal, low, medium, high, xhigh (ultrathink)
1492
1734
  - Appends to model as suffix (e.g., `anthropic/claude-sonnet-4-5:high`)
@@ -1505,6 +1747,7 @@
1505
1747
  - Example: Change scout's output from `context.md` to `summary.md`, planner's reads updates automatically
1506
1748
 
1507
1749
  ### Changed
1750
+
1508
1751
  - **Progress is now chain-level** - `[p]` toggles progress for ALL steps at once
1509
1752
  - Progress setting shown at chain level (not per-step)
1510
1753
  - Chains share a single progress.md, so chain-wide toggle is more intuitive
@@ -1517,6 +1760,7 @@
1517
1760
  - Chain TUI footer updated: `[e]dit [m]odel [t]hinking [w]rites [r]eads [p]rogress`
1518
1761
 
1519
1762
  ### Fixed
1763
+
1520
1764
  - **Chain READ/WRITE instructions now prepended** - Instructions restructured:
1521
1765
  - `[Read from: /path/file.md]` and `[Write to: /path/file.md]` prepended BEFORE task
1522
1766
  - Overrides any hardcoded filenames in task text from parent agent
@@ -1530,6 +1774,7 @@
1530
1774
  now correctly resolve to `anthropic/claude-sonnet-4-5:high` instead of losing the provider prefix
1531
1775
 
1532
1776
  ### Improved
1777
+
1533
1778
  - **Per-step progress indicators** - When progress is enabled, each step shows its role:
1534
1779
  - Step 1: `writes progress.md`
1535
1780
  - Step 2+: `reads progress.md`
@@ -1542,6 +1787,7 @@
1542
1787
  ## [0.3.2] - 2026-01-25
1543
1788
 
1544
1789
  ### Performance
1790
+
1545
1791
  - **4x faster polling** - Reduced poll interval from 1000ms to 250ms (efficient with mtime caching)
1546
1792
  - **Mtime-based caching** - status.json and output tail reads cached to avoid redundant I/O
1547
1793
  - **Unified throttled updates** - All onUpdate calls consolidated under 50ms throttle
@@ -1549,13 +1795,15 @@
1549
1795
  - **Array optimizations** - Use concat instead of spread for chain progress updates
1550
1796
 
1551
1797
  ### Fixed
1798
+
1552
1799
  - **Timer leaks** - Track and clear pendingTimer and cleanupTimers properly
1553
- - **Updates after close** - processClosed flag prevents updates after process terminates
1800
+ - **Updates after close** - processClosed flag prevents updates after process terminates
1554
1801
  - **Session cleanup** - Clear cleanup timers on session_start/switch/branch/shutdown
1555
1802
 
1556
1803
  ## [0.3.1] - 2026-01-24
1557
1804
 
1558
1805
  ### Changed
1806
+
1559
1807
  - **Major code refactor** - Split monolithic index.ts into focused modules:
1560
1808
  - `execution.ts` - Core runSync function for single agent execution
1561
1809
  - `chain-execution.ts` - Chain orchestration (sequential + parallel steps)
@@ -1567,6 +1815,7 @@
1567
1815
  - `types.ts` - Shared type definitions and constants
1568
1816
 
1569
1817
  ### Fixed
1818
+
1570
1819
  - **Expanded view visibility** - Running chains now properly show:
1571
1820
  - Task preview (truncated to 80 chars) for each step
1572
1821
  - Recent tools fallback when between tool calls
@@ -1577,6 +1826,7 @@
1577
1826
  ## [0.3.0] - 2026-01-24
1578
1827
 
1579
1828
  ### Added
1829
+
1580
1830
  - **Full edit mode for chain TUI** - Press `e`, `o`, or `r` to enter a full-screen editor with:
1581
1831
  - Word wrapping for long text that spans multiple display lines
1582
1832
  - Scrolling viewport (12 lines visible) with scroll indicators (↑↓)
@@ -1586,6 +1836,7 @@
1586
1836
  - Esc saves, Ctrl+C discards changes
1587
1837
 
1588
1838
  ### Improved
1839
+
1589
1840
  - **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
1841
  - **Chain execution observability** - Now shows:
1591
1842
  - Chain visualization with status labels: `done scout → running planner` (`done`, `running`, `pending`, `failed`) - sequential chains only
@@ -1594,17 +1845,15 @@
1594
1845
 
1595
1846
  ## [0.2.0] - 2026-01-24
1596
1847
 
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
1848
  ### Added
1849
+
1602
1850
  - Chain TUI now supports editing output paths, reads lists, and toggling progress per step
1603
1851
  - New keybindings: `o` (output), `r` (reads), `p` (progress toggle)
1604
1852
  - Output and reads support full file paths, not just relative to chain_dir
1605
1853
  - Each step shows all editable fields: task, output, reads, progress
1606
1854
 
1607
1855
  ### Fixed
1856
+
1608
1857
  - Chain clarification TUI edit mode now properly re-renders after state changes (was unresponsive)
1609
1858
  - Changed edit shortcut from Tab to 'e' (Tab can be problematic in terminals)
1610
1859
  - Edit mode cursor now starts at beginning of first line for better UX
@@ -1615,6 +1864,7 @@
1615
1864
  - Absolute paths for output/reads now work correctly (were incorrectly prepended with chainDir)
1616
1865
 
1617
1866
  ### Added
1867
+
1618
1868
  - Parallel-in-chain execution with `{ parallel: [...] }` step syntax for fan-out/fan-in patterns
1619
1869
  - Configurable concurrency and fail-fast options for parallel steps
1620
1870
  - Output aggregation with clear separators (`=== Parallel Task N (agent) ===`) for `{previous}`
@@ -1622,11 +1872,13 @@
1622
1872
  - Pre-created progress.md for parallel steps to avoid race conditions
1623
1873
 
1624
1874
  ### Changed
1875
+
1625
1876
  - TUI clarification skipped for chains with parallel steps (runs directly in sync mode)
1626
1877
  - Async mode rejects chains with parallel steps with clear error message
1627
1878
  - Chain completion now returns summary blurb with progress.md and artifacts paths instead of raw output
1628
1879
 
1629
1880
  ### Added
1881
+
1630
1882
  - Live progress display for sync subagents (single and chain modes)
1631
1883
  - Shows current tool, recent output lines, token count, and duration during execution
1632
1884
  - Ctrl+O hint during sync execution to expand full streaming view
@@ -1634,10 +1886,12 @@
1634
1886
  - Updates on tool_execution_start/end events for more responsive feedback
1635
1887
 
1636
1888
  ### Fixed
1889
+
1637
1890
  - Async widget elapsed time now freezes when job completes instead of continuing to count up
1638
1891
  - Progress data now correctly linked to results during execution (was showing "ok" instead of "...")
1639
1892
 
1640
1893
  ### Added
1894
+
1641
1895
  - Extension API support (registerTool) with `subagent` tool name
1642
1896
  - Session logs (JSONL + HTML export) and optional share links via GitHub Gist
1643
1897
  - `share` and `sessionDir` parameters for session retention control
@@ -1648,11 +1902,13 @@
1648
1902
  - Async TUI widget for background runs
1649
1903
 
1650
1904
  ### Changed
1905
+
1651
1906
  - Parallel mode auto-downgrades to sync when async:true is passed (with note in output)
1652
1907
  - TUI now shows "parallel (no live progress)" label to set expectations
1653
1908
  - Tools passed via agent config can include extension paths (forwarded via `--extension`)
1654
1909
 
1655
1910
  ### Fixed
1911
+
1656
1912
  - Chain mode now sums step durations instead of taking max (was showing incorrect total time)
1657
1913
  - Async notifications no longer leak across pi sessions in different directories
1658
1914
 
@@ -1661,6 +1917,7 @@
1661
1917
  Initial release.
1662
1918
 
1663
1919
  ### Added
1920
+
1664
1921
  - Output truncation with configurable byte/line limits
1665
1922
  - Real-time progress tracking (tools, tokens, duration)
1666
1923
  - Debug artifacts (input, output, JSONL, metadata)