@desplega.ai/agent-swarm 2.7.10 → 2.8.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 (281) hide show
  1. package/dist/acp-adapter-t949vbbp.js +15 -0
  2. package/dist/{actions-b8aqhrsg.js → actions-7e9czc7s.js} +18 -19
  3. package/dist/{amp-adapter-4c165vgn.js → amp-adapter-gv6cbb7d.js} +2 -3
  4. package/dist/{app-m9khefrh.js → app-b9fbkp9v.js} +3 -3
  5. package/dist/{assistant-rh4v3ntz.js → assistant-wjb7v4c7.js} +20 -21
  6. package/dist/{boot-args-schema-hwkc8bzv.js → boot-args-schema-2t37e0fe.js} +1 -1
  7. package/dist/{boot-reembed-5y6yw9sj.js → boot-reembed-a35nkyr1.js} +1 -1
  8. package/dist/{boot-reembed-fdyk55h4.js → boot-reembed-gka3zas7.js} +1 -1
  9. package/dist/{boot-scrub-sweep-r5r8kqsn.js → boot-scrub-sweep-65sdnp6c.js} +3 -3
  10. package/dist/{boot-seeds-8f9zt5cm.js → boot-seeds-x42tzytw.js} +4 -5
  11. package/dist/{claude-adapter-s5df247c.js → claude-adapter-v221b2fd.js} +7 -8
  12. package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-29eq09wd.js} +2 -2
  13. package/dist/{claude-managed-setup-9gsmwzyx.js → claude-managed-setup-9m6450zk.js} +2 -2
  14. package/dist/{claude-sdk-session-dq1j4nz9.js → claude-sdk-session-0q0ptaba.js} +9066 -8818
  15. package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
  16. package/dist/{cli-5wfz00be.js → cli-0jzra9ad.js} +2 -2
  17. package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
  18. package/dist/{cli-eqk5p56g.js → cli-2wnq8jkz.js} +9 -9
  19. package/dist/{cli-hfkwwy1h.js → cli-2zp0et3v.js} +21 -2
  20. package/dist/{cli-rt0ag4x1.js → cli-334z18y3.js} +4 -4
  21. package/dist/{cli-6m6b4bep.js → cli-3rkdne1h.js} +2 -2
  22. package/dist/{cli-3xddv0rk.js → cli-4txa0ter.js} +5 -7
  23. package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
  24. package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
  25. package/dist/{cli-n07eecjs.js → cli-6t09sdhy.js} +3 -3
  26. package/dist/{cli-38yww4e9.js → cli-6wxjceza.js} +8 -8
  27. package/dist/{cli-5xcb8gxq.js → cli-7b8sbmag.js} +8 -8
  28. package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
  29. package/dist/{cli-mp9aa8g5.js → cli-7p1kvkck.js} +6 -6
  30. package/dist/{cli-w3bk0dgv.js → cli-8aes17e4.js} +2 -2
  31. package/dist/{cli-n9abj89w.js → cli-8fknbnhw.js} +8 -8
  32. package/dist/{cli-xd5ebp64.js → cli-8kzasymh.js} +3 -3
  33. package/dist/{cli-2tsfpc70.js → cli-a7wvp2km.js} +1 -1
  34. package/dist/{cli-kx4c8j05.js → cli-abejgen1.js} +63 -19
  35. package/dist/{cli-36wdfzgn.js → cli-bsywb58a.js} +8 -8
  36. package/dist/{cli-yz7v0sh4.js → cli-c55z5chy.js} +4 -6
  37. package/dist/{cli-18qt3few.js → cli-deefvewm.js} +1 -1
  38. package/dist/{cli-jg24scat.js → cli-ee0b971j.js} +3 -3
  39. package/dist/cli-f3vq58d2.js +242 -0
  40. package/dist/{cli-3xcwp3z8.js → cli-ffhtssbp.js} +2 -2
  41. package/dist/{cli-rjyghzg4.js → cli-g70vxtjh.js} +2 -2
  42. package/dist/{cli-g1px1g2e.js → cli-gxkx0zzp.js} +1 -1
  43. package/dist/{cli-j7d73g1y.js → cli-h38x262p.js} +3035 -354
  44. package/dist/{cli-zjphdj1a.js → cli-j790gp2w.js} +40 -18
  45. package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
  46. package/dist/{cli-td33w98c.js → cli-m23zjcy2.js} +10 -10
  47. package/dist/{cli-8ewkreqd.js → cli-m28atx8q.js} +7 -9
  48. package/dist/{cli-x9exydey.js → cli-m4dqmnbp.js} +1 -1
  49. package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
  50. package/dist/{cli-mr97t7cc.js → cli-p1bq50aa.js} +263 -14
  51. package/dist/{cli-ttbqe3q4.js → cli-p1w18yhx.js} +1 -1
  52. package/dist/{cli-nj3x45rw.js → cli-p2gfst4m.js} +52 -43
  53. package/dist/{cli-z9cs5m0w.js → cli-pasjcnmj.js} +12 -12
  54. package/dist/{cli-an1knn2k.js → cli-qa4wdgsy.js} +5 -5
  55. package/dist/{cli-xncjscpm.js → cli-qfedvmcr.js} +50 -24
  56. package/dist/{cli-tmft5dz2.js → cli-qmqk2yc2.js} +1 -1
  57. package/dist/{cli-bxz823sz.js → cli-qsnnd04k.js} +1 -1
  58. package/dist/{cli-cr14kftt.js → cli-qwca7s44.js} +3 -3
  59. package/dist/{cli-7wz05bx3.js → cli-rfywm85n.js} +460 -737
  60. package/dist/{cli-v2fwbnsk.js → cli-rmmpt0wm.js} +6 -6
  61. package/dist/{cli-xbtq4d6s.js → cli-rzsy6nc6.js} +12 -8
  62. package/dist/{cli-0m7rtm11.js → cli-s7t6p9my.js} +1 -1
  63. package/dist/{cli-16phend6.js → cli-sdtt3men.js} +1 -1
  64. package/dist/{cli-pyrxt9gw.js → cli-tk7cjj8h.js} +1 -1
  65. package/dist/{cli-xvymtmv4.js → cli-tqegb8eq.js} +3 -3
  66. package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
  67. package/dist/{cli-h49ejvmc.js → cli-wcg8x116.js} +1 -1
  68. package/dist/{cli-q581b386.js → cli-wk18cm92.js} +5 -5
  69. package/dist/{cli-4vwxp550.js → cli-x1wa213s.js} +1 -1
  70. package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
  71. package/dist/{cli-eb2azq8n.js → cli-y97qxcfx.js} +9 -9
  72. package/dist/{cli-55bkx8hh.js → cli-yq3zak69.js} +1 -1
  73. package/dist/cli.js +17 -17
  74. package/dist/{codex-adapter-yr60sme6.js → codex-adapter-30j9bpzd.js} +5 -6
  75. package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
  76. package/dist/{codex-session-runner-pch8x584.js → codex-session-runner-8vp57v8w.js} +5 -6
  77. package/dist/{commands-phjfbkv0.js → commands-bngnz9g7.js} +3 -3
  78. package/dist/{controller-jkx994pz.js → controller-hxx8wwy1.js} +2 -2
  79. package/dist/{controllers-connect-c4448kwa.js → controllers-connect-e2b4gyxc.js} +19 -20
  80. package/dist/{cursor-adapter-ndebqnm8.js → cursor-adapter-n5nc3mfe.js} +1 -2
  81. package/dist/{db-ez6egt6v.js → db-bgm7vkc0.js} +3 -3
  82. package/dist/{db-ef32tbfc.js → db-c6np41ca.js} +10 -2
  83. package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
  84. package/dist/{dispatcher-g3tt9hs9.js → dispatcher-jnybck15.js} +17 -18
  85. package/dist/{dsh-adapter-tcyn3099.js → dsh-adapter-nrhbrjz8.js} +1 -2
  86. package/dist/{easter-egg-3d-e36hk5td.js → easter-egg-3d-533knw22.js} +1 -1
  87. package/dist/{embedding-space-4kyh5qqj.js → embedding-space-crsm2zp0.js} +6 -6
  88. package/dist/{embeddings-6a8v4a6t.js → embeddings-e7z3f27f.js} +1 -1
  89. package/dist/{execute-3cbg0twf.js → execute-b3mrb1mv.js} +1 -1
  90. package/dist/{external-channel-se646snz.js → external-channel-m77wf5z3.js} +2 -2
  91. package/dist/{fx-adapter-yw795hqq.js → fx-adapter-b6w0kf56.js} +7 -8
  92. package/dist/{grok-adapter-ttmcss2j.js → grok-adapter-4sqtebdk.js} +7 -8
  93. package/dist/handlers-kdjcyzdj.js +32 -0
  94. package/dist/heartbeat-xgb036sx.js +43 -0
  95. package/dist/{hook-g3nhexsy.js → hook-5h02c9ga.js} +6 -6
  96. package/dist/{hook-hq93y5ej.js → hook-xsk1jbha.js} +5 -5
  97. package/dist/{http-5a9p4h6y.js → http-txe7qhvn.js} +282 -140
  98. package/dist/{index-6haqt3v5.js → index-4a0670yh.js} +8917 -8476
  99. package/dist/index-835xdgnm.js +33 -0
  100. package/dist/index-d469300x.js +37 -0
  101. package/dist/index-rzqwp11g.js +32 -0
  102. package/dist/{index-s72rqgsx.js → index-tvfafeyy.js} +1 -1
  103. package/dist/{index-hgn3c961.js → index-vk63emp7.js} +978 -35
  104. package/dist/{index-3c5pxbge.js → index-ysvbhg5m.js} +1 -1
  105. package/dist/{keepalive-1j4n4dmk.js → keepalive-4zsrce78.js} +3 -3
  106. package/dist/lead-yqt47dkr.js +70 -0
  107. package/dist/{maintenance-dmghacy5.js → maintenance-86jvartk.js} +1 -1
  108. package/dist/{oauth-refresh-sweep-yy06c03c.js → oauth-refresh-sweep-j52kg9pr.js} +2 -2
  109. package/dist/{onboard-52f9t5dm.js → onboard-c2aj5p8q.js} +3 -3
  110. package/dist/{opencode-adapter-krnh9jkn.js → opencode-adapter-dsagkhtw.js} +5 -6
  111. package/dist/{otel-impl-xjqz6wjj.js → otel-impl-yyy203z8.js} +1 -1
  112. package/dist/{pi-mono-adapter-dbxyp0qv.js → pi-mono-adapter-546cd1cc.js} +9 -9
  113. package/dist/{pricing-refresh-ctdr74pd.js → pricing-refresh-1rgzqyzz.js} +2 -3
  114. package/dist/{rbac-roles-q0gr8eyj.js → rbac-roles-e70xfeyj.js} +4 -6
  115. package/dist/{rbac-roles-ehv8s10n.js → rbac-roles-q89qe8er.js} +3 -3
  116. package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
  117. package/dist/{render-v2-5b6chvcq.js → render-v2-k6tt107q.js} +3 -3
  118. package/dist/{resume-5a5d2845.js → resume-cnnrjfxa.js} +6 -6
  119. package/dist/{runtime-khxszyfp.js → runtime-1hv06jsn.js} +1 -1
  120. package/dist/{session-access-gj0bjhqg.js → session-access-xkxkjw3n.js} +4 -4
  121. package/dist/{session-source-backfill-2sy0krfk.js → session-source-backfill-1d5pdwww.js} +2 -2
  122. package/dist/{setup-7ssfakk1.js → setup-se8q7gkc.js} +1 -1
  123. package/dist/{virtual-modules-pjj0knwf.js → virtual-modules-gazyapte.js} +3 -3
  124. package/dist/{work-objects-bf3syvhq.js → work-objects-1kxnbzy5.js} +20 -21
  125. package/dist/{worker-follow-up-38xevga6.js → worker-follow-up-zqm8apt4.js} +17 -18
  126. package/dist/worker-j6xxtq7p.js +70 -0
  127. package/openapi.json +334 -7
  128. package/package.json +4 -4
  129. package/src/apps/definition.ts +11 -0
  130. package/src/apps/store.ts +28 -8
  131. package/src/be/db/model-profiles.ts +147 -38
  132. package/src/be/db/tasks/read.ts +5 -1
  133. package/src/be/db/workflow-run-definitions.ts +117 -0
  134. package/src/be/db.ts +24 -3
  135. package/src/be/memory/constants.ts +14 -1
  136. package/src/be/memory/key-paths.ts +8 -0
  137. package/src/be/memory/providers/sqlite-store.ts +160 -10
  138. package/src/be/memory/task-learning.ts +79 -14
  139. package/src/be/memory/types.ts +24 -1
  140. package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
  141. package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
  142. package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
  143. package/src/be/model-profile-check.ts +284 -0
  144. package/src/be/model-tier-resolution.ts +112 -12
  145. package/src/be/multi-runtime.ts +27 -0
  146. package/src/be/runtime-pools/routing.ts +52 -4
  147. package/src/be/scripts/typecheck.ts +1 -0
  148. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
  149. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
  150. package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
  151. package/src/be/seed-scripts/index.ts +9 -0
  152. package/src/be/steering.ts +8 -2
  153. package/src/commands/onboard/agent-fs-version.ts +1 -1
  154. package/src/commands/runner.ts +32 -1
  155. package/src/fs/provider.ts +17 -3
  156. package/src/heartbeat/heartbeat.ts +12 -1
  157. package/src/heartbeat/index.ts +1 -0
  158. package/src/http/agents.ts +56 -4
  159. package/src/http/apps.ts +3 -1
  160. package/src/http/config.ts +2 -6
  161. package/src/http/index.ts +2 -3
  162. package/src/http/model-profiles.ts +58 -10
  163. package/src/http/poll.ts +36 -3
  164. package/src/http/schedules.ts +42 -3
  165. package/src/http/tasks.ts +37 -12
  166. package/src/http/workflows.ts +15 -2
  167. package/src/prompts/session-templates.ts +1 -1
  168. package/src/providers/acp-targets.ts +11 -6
  169. package/src/providers/amp-adapter.ts +1 -1
  170. package/src/providers/claude-sdk-session.ts +132 -23
  171. package/src/providers/codex-skill-resolver.ts +10 -4
  172. package/src/providers/cursor-adapter.ts +1 -1
  173. package/src/providers/devin-skill-resolver.ts +5 -5
  174. package/src/providers/dsh-adapter.ts +1 -1
  175. package/src/scheduler/schedule-task.ts +1 -0
  176. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  177. package/src/scripts-runtime/swarm-sdk.ts +18 -1
  178. package/src/scripts-runtime/types/stdlib.d.ts +1 -0
  179. package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
  180. package/src/server.ts +2 -0
  181. package/src/slack/app.ts +93 -0
  182. package/src/slack/inbound-dispatch.ts +18 -1
  183. package/src/slack/workspace-guard.ts +345 -0
  184. package/src/tasks/task-terminal-effects.ts +4 -0
  185. package/src/tasks/worker-follow-up.ts +102 -2
  186. package/src/tests/acp-adapter.test.ts +82 -0
  187. package/src/tests/apps-icon.test.ts +120 -0
  188. package/src/tests/chained-task-follow-up.test.ts +248 -0
  189. package/src/tests/check-pr-body.test.ts +40 -0
  190. package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
  191. package/src/tests/claude-sdk-process.fixture.ts +57 -0
  192. package/src/tests/codex-skill-resolver.test.ts +31 -0
  193. package/src/tests/credentials-allowlist.test.ts +470 -0
  194. package/src/tests/db-task-read-contract.test.ts +5 -0
  195. package/src/tests/db-task-write-contract.test.ts +5 -0
  196. package/src/tests/deferred-wake-follow-up.test.ts +47 -0
  197. package/src/tests/docs-index-footprint.test.js +3 -3
  198. package/src/tests/dreaming-learnings.test.ts +1395 -0
  199. package/src/tests/dsh-adapter.test.ts +1 -1
  200. package/src/tests/explicit-model-validation.test.ts +2 -0
  201. package/src/tests/fs-provider.test.ts +42 -0
  202. package/src/tests/heartbeat.test.ts +28 -1
  203. package/src/tests/human-free-reclassify.test.ts +5 -1
  204. package/src/tests/list-endpoint-slimming.test.ts +17 -0
  205. package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
  206. package/src/tests/model-profile-check.test.ts +387 -0
  207. package/src/tests/model-profiles-api.test.ts +528 -1
  208. package/src/tests/profile-claim.test.ts +415 -3
  209. package/src/tests/profile-tier-alias.test.ts +382 -0
  210. package/src/tests/schedule-profile.test.ts +359 -0
  211. package/src/tests/script-connections.test.ts +6 -0
  212. package/src/tests/script-per-script-executor.test.ts +1 -0
  213. package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
  214. package/src/tests/seed-scripts.test.ts +2 -2
  215. package/src/tests/slack-inbound-receipts.test.ts +22 -2
  216. package/src/tests/slack-socket-ack.test.ts +16 -1
  217. package/src/tests/slack-workspace-guard.test.ts +905 -0
  218. package/src/tests/steering-core.test.ts +40 -0
  219. package/src/tests/store-progress-learning.test.ts +605 -20
  220. package/src/tests/tool-annotations.test.ts +1 -1
  221. package/src/tests/workflow-convergence.test.ts +46 -40
  222. package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
  223. package/src/tests/workflow-definition-pinning.test.ts +645 -0
  224. package/src/tests/workflow-executors.test.ts +16 -7
  225. package/src/tests/workflow-foreach.test.ts +43 -20
  226. package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
  227. package/src/tests/workflow-profile.test.ts +328 -0
  228. package/src/tools/app-upsert.ts +1 -1
  229. package/src/tools/memory-edit.ts +2 -1
  230. package/src/tools/model-profiles/check-model-profile.ts +63 -0
  231. package/src/tools/schedules/create-schedule.ts +45 -4
  232. package/src/tools/schedules/patch-schedule.ts +50 -4
  233. package/src/tools/schedules/update-schedule.ts +50 -4
  234. package/src/tools/send-task.ts +17 -2
  235. package/src/tools/store-progress.ts +15 -3
  236. package/src/tools/task-action.ts +9 -1
  237. package/src/tools/templates.ts +13 -0
  238. package/src/tools/tool-config.ts +2 -1
  239. package/src/tools/utils.ts +61 -4
  240. package/src/tools/workflows/create-workflow.ts +1 -1
  241. package/src/tools/workflows/retry-workflow-run.ts +1 -1
  242. package/src/tools/workflows/update-workflow.ts +10 -1
  243. package/src/types.ts +56 -1
  244. package/src/utils/credentials.ts +89 -12
  245. package/src/workflows/engine.ts +10 -1
  246. package/src/workflows/executors/agent-task.ts +21 -2
  247. package/src/workflows/executors/foreach.ts +4 -1
  248. package/src/workflows/executors/notify.ts +62 -6
  249. package/src/workflows/executors/sub-workflow.ts +1 -1
  250. package/src/workflows/executors/swarm-script.ts +4 -1
  251. package/src/workflows/foreach-driver.ts +8 -5
  252. package/src/workflows/limits.ts +2 -1
  253. package/src/workflows/model-validation.ts +27 -2
  254. package/src/workflows/patch-definition.ts +3 -1
  255. package/src/workflows/recovery.ts +6 -6
  256. package/src/workflows/resume.ts +9 -9
  257. package/src/workflows/retry-poller.ts +2 -2
  258. package/templates/skills/apps/SKILL.md +2 -0
  259. package/templates/skills/apps/content.md +2 -0
  260. package/templates/skills/code-quality/content.md +12 -0
  261. package/templates/skills/memory/content.md +8 -0
  262. package/templates/skills/scheduling/config.json +1 -1
  263. package/templates/skills/scheduling/content.md +2 -2
  264. package/templates/skills/swarm-docs/content.md +4 -0
  265. package/templates/skills/swarm-extensions/content.md +1 -1
  266. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  267. package/templates/skills/swarm-scripts/content.md +1 -1
  268. package/templates/skills/work-on-task/SKILL.md +2 -0
  269. package/templates/skills/work-on-task/content.md +2 -0
  270. package/templates/workflows/dreaming/content.md +174 -7
  271. package/dist/acp-adapter-srfhs1s9.js +0 -16
  272. package/dist/cli-bzvs88tv.js +0 -339
  273. package/dist/cli-cyn9v8zr.js +0 -748
  274. package/dist/cli-ed6yqpf1.js +0 -779
  275. package/dist/handlers-17wha3ze.js +0 -33
  276. package/dist/heartbeat-gwewgdms.js +0 -42
  277. package/dist/index-8arwq8mw.js +0 -34
  278. package/dist/index-tpw054az.js +0 -38
  279. package/dist/index-waq75j2j.js +0 -31
  280. package/dist/lead-re73kdgc.js +0 -72
  281. package/dist/worker-r8mz7a65.js +0 -72
@@ -11,13 +11,22 @@ import {
11
11
  getWorkflow,
12
12
  isExtensionAgent,
13
13
  } from "@/be/db";
14
+ import { modelProfileRefError, taskProfileError } from "@/be/db/model-profiles";
14
15
  import { explicitModelErrorForAgent } from "@/be/model-validation";
15
16
  import { getScript } from "@/be/scripts/db";
16
17
  import { calculateNextRun } from "@/scheduler";
17
- import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
18
+ import {
19
+ createToolRegistrar,
20
+ modelTierDeprecatedOutputSchema,
21
+ modelTierDeprecation,
22
+ swarmToolOutputSchema,
23
+ toolErr,
24
+ toolOk,
25
+ } from "@/tools/utils";
18
26
  import {
19
27
  AssetKeySchema,
20
28
  ModelTierSchema,
29
+ type ProviderName,
21
30
  ScheduledTaskTargetTypeSchema,
22
31
  splitLegacyModelAlias,
23
32
  } from "../../types";
@@ -105,11 +114,19 @@ export const createScheduleInputSchema = z.object({
105
114
  .min(1)
106
115
  .optional()
107
116
  .describe(
108
- "Concrete model override for tasks created by this schedule. Interpreted by each assignee's harness/provider and does not switch providers. Prefer modelTier for portable intent. The model must run on the assignee's harness (an Anthropic model on a Claude agent, an OpenAI model on a Codex agent); a mismatch is rejected.",
117
+ "Concrete model override for tasks created by this schedule. Interpreted by each assignee's harness/provider and does not switch providers. Prefer `profile` for a named harness + model + effort. The model must run on the assignee's harness (an Anthropic model on a Claude agent, an OpenAI model on a Codex agent); a mismatch is rejected.",
109
118
  ),
110
119
  modelTier: ModelTierSchema.optional().describe(
111
- "Portable model tier for tasks created by this schedule: 'smol', 'regular', 'smart', or 'ultra'. Resolved by each assignee's harness/provider at run time.",
120
+ "Deprecated: pass profile \"<harness>-<tier>\" instead (same model). Portable model tier for tasks created by this schedule: 'smol', 'regular', 'smart', or 'ultra'. Resolved at claim time through the seeded <harness>-<tier> profile of each assignee's harness.",
112
121
  ),
122
+ profile: z
123
+ .string()
124
+ .trim()
125
+ .min(1)
126
+ .optional()
127
+ .describe(
128
+ "Model profile name for tasks created by this schedule (see list-model-profiles): a named harness + model + effort, applied when each task is claimed. Must run on the target agent. Exclusive with model and modelTier.",
129
+ ),
113
130
  allowCustomModel: z
114
131
  .boolean()
115
132
  .optional()
@@ -138,6 +155,7 @@ const scheduleDataShape = {
138
155
  timezone: z.string().optional(),
139
156
  model: z.string().optional(),
140
157
  modelTier: ModelTierSchema.optional(),
158
+ profile: z.string().optional(),
141
159
  scheduleType: z.string().optional(),
142
160
  targetType: ScheduledTaskTargetTypeSchema.optional(),
143
161
  workflowId: z.string().optional(),
@@ -159,6 +177,7 @@ export const registerCreateScheduleTool = (server: McpServer) => {
159
177
  outputSchema: swarmToolOutputSchema({
160
178
  yourAgentId: z.string().optional(),
161
179
  schedule: z.looseObject(scheduleDataShape).optional(),
180
+ modelTierDeprecated: modelTierDeprecatedOutputSchema.optional(),
162
181
  }),
163
182
  },
164
183
  async (
@@ -184,6 +203,7 @@ export const registerCreateScheduleTool = (server: McpServer) => {
184
203
  enabled,
185
204
  model,
186
205
  modelTier,
206
+ profile,
187
207
  allowCustomModel,
188
208
  },
189
209
  requestInfo,
@@ -239,6 +259,7 @@ export const registerCreateScheduleTool = (server: McpServer) => {
239
259
  }
240
260
 
241
261
  // Validate targetAgentId if provided
262
+ let targetHarness: ProviderName | null | undefined = null;
242
263
  if (targetAgentId) {
243
264
  const agent = await getAgentById(targetAgentId);
244
265
  if (!agent) {
@@ -247,6 +268,7 @@ export const registerCreateScheduleTool = (server: McpServer) => {
247
268
  if (isExtensionAgent(agent)) {
248
269
  return toolErr(extensionAgentAssignmentError(agent));
249
270
  }
271
+ targetHarness = agent.harnessProvider;
250
272
  }
251
273
 
252
274
  // Cross-field targetType validation
@@ -278,6 +300,13 @@ export const registerCreateScheduleTool = (server: McpServer) => {
278
300
  agentId: targetAgentId,
279
301
  });
280
302
  if (modelError) return toolErr(modelError);
303
+ const profileError = await taskProfileError({
304
+ profile,
305
+ model,
306
+ modelTier,
307
+ agentId: targetAgentId,
308
+ });
309
+ if (profileError) return toolErr(profileError);
281
310
 
282
311
  try {
283
312
  // Calculate initial nextRunAt
@@ -321,6 +350,7 @@ export const registerCreateScheduleTool = (server: McpServer) => {
321
350
  createdByAgentId: requestInfo.agentId,
322
351
  model: normalizedModel.model,
323
352
  modelTier: normalizedModel.modelTier,
353
+ profile,
324
354
  scheduleType: scheduleType ?? "recurring",
325
355
  createdBy,
326
356
  });
@@ -328,13 +358,24 @@ export const registerCreateScheduleTool = (server: McpServer) => {
328
358
  const scheduleDesc = isOneTime
329
359
  ? `one-time at ${schedule.nextRunAt}`
330
360
  : cronExpression || `every ${intervalMs}ms`;
361
+ const modelTierDeprecated = modelTierDeprecation(modelTier, targetHarness);
331
362
  return toolOk(
332
363
  `Created schedule "${name}" (${scheduleDesc}). Next run: ${schedule.nextRunAt || "disabled"}`,
333
364
  {
334
- data: { yourAgentId: requestInfo.agentId, schedule },
365
+ data: {
366
+ yourAgentId: requestInfo.agentId,
367
+ schedule,
368
+ ...(modelTierDeprecated ? { modelTierDeprecated } : {}),
369
+ },
335
370
  },
336
371
  );
337
372
  } catch (error) {
373
+ // The profile was deleted between taskProfileError and the insert.
374
+ if (modelProfileRefError(error) === "missing") {
375
+ return toolErr(`Unknown model profile "${profile}".`, {
376
+ data: { yourAgentId: requestInfo.agentId },
377
+ });
378
+ }
338
379
  const message = error instanceof Error ? error.message : "Unknown error";
339
380
  return toolErr(`Failed to create schedule: ${message}`, {
340
381
  data: { yourAgentId: requestInfo.agentId },
@@ -12,12 +12,20 @@ import {
12
12
  isExtensionAgent,
13
13
  updateScheduledTask,
14
14
  } from "@/be/db";
15
+ import { modelProfileRefError, scheduleProfileUpdate } from "@/be/db/model-profiles";
15
16
  import { explicitModelErrorForAgent } from "@/be/model-validation";
16
17
  import { mergeScheduleTiming, validateRecurringTiming } from "@/be/schedules/validate";
17
18
  import { getScript } from "@/be/scripts/db";
18
19
  import { can } from "@/rbac";
19
20
  import { calculateNextRun } from "@/scheduler";
20
- import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
21
+ import {
22
+ createToolRegistrar,
23
+ modelTierDeprecatedOutputSchema,
24
+ modelTierDeprecation,
25
+ swarmToolOutputSchema,
26
+ toolErr,
27
+ toolOk,
28
+ } from "@/tools/utils";
21
29
  import {
22
30
  AssetKeySchema,
23
31
  ModelTierSchema,
@@ -76,7 +84,18 @@ export const patchScheduleInputSchema = z.object({
76
84
  ),
77
85
  modelTier: ModelTierSchema.nullable()
78
86
  .optional()
79
- .describe("Portable model tier for tasks created by this schedule. Set to null to clear."),
87
+ .describe(
88
+ 'Deprecated: pass profile "<harness>-<tier>" instead (same model). Portable model tier for tasks created by this schedule, resolved at claim time through the seeded <harness>-<tier> profile. Set to null to clear.',
89
+ ),
90
+ profile: z
91
+ .string()
92
+ .trim()
93
+ .min(1)
94
+ .nullable()
95
+ .optional()
96
+ .describe(
97
+ "Model profile name for tasks created by this schedule (see list-model-profiles). Must run on the target agent. Exclusive with model and modelTier: setting a profile clears them, and setting either clears the profile. Set to null to clear.",
98
+ ),
80
99
  allowCustomModel: z
81
100
  .boolean()
82
101
  .optional()
@@ -105,6 +124,7 @@ const scheduleDataShape = {
105
124
  timezone: z.string().optional(),
106
125
  model: z.string().optional(),
107
126
  modelTier: ModelTierSchema.optional(),
127
+ profile: z.string().optional(),
108
128
  scheduleType: z.string().optional(),
109
129
  targetType: ScheduledTaskTargetTypeSchema.optional(),
110
130
  workflowId: z.string().optional(),
@@ -126,6 +146,7 @@ export const registerPatchScheduleTool = (server: McpServer) => {
126
146
  outputSchema: swarmToolOutputSchema({
127
147
  yourAgentId: z.string().optional(),
128
148
  schedule: z.looseObject(scheduleDataShape).optional(),
149
+ modelTierDeprecated: modelTierDeprecatedOutputSchema.optional(),
129
150
  }),
130
151
  },
131
152
  async (
@@ -150,6 +171,7 @@ export const registerPatchScheduleTool = (server: McpServer) => {
150
171
  enabled,
151
172
  model,
152
173
  modelTier,
174
+ profile,
153
175
  allowCustomModel,
154
176
  },
155
177
  requestInfo,
@@ -278,6 +300,13 @@ export const registerPatchScheduleTool = (server: McpServer) => {
278
300
  // A move to another agent re-judges the stored model against the new harness.
279
301
  const agentChanged =
280
302
  targetAgentId !== undefined && targetAgentId !== schedule.targetAgentId;
303
+ const profileUpdate = await scheduleProfileUpdate(schedule, {
304
+ profile,
305
+ model,
306
+ modelTier,
307
+ targetAgentId,
308
+ });
309
+ if (profileUpdate.error !== undefined) return toolErr(profileUpdate.error);
281
310
  if (model !== undefined || modelTier !== undefined) {
282
311
  const normalizedModel = splitLegacyModelAlias({ model, modelTier });
283
312
  // A model the schedule already stores is not re-judged, so an unrelated edit still saves.
@@ -293,7 +322,7 @@ export const registerPatchScheduleTool = (server: McpServer) => {
293
322
  if (modelTier !== undefined || normalizedModel.modelTier) {
294
323
  updateData.modelTier = normalizedModel.modelTier ?? null;
295
324
  }
296
- } else if (agentChanged && schedule.model) {
325
+ } else if (agentChanged && schedule.model && !profileUpdate.fields.profile) {
297
326
  // Harness only: the stored id already passed the catalog check when it was written.
298
327
  const modelError = await explicitModelErrorForAgent({
299
328
  model: schedule.model,
@@ -302,6 +331,7 @@ export const registerPatchScheduleTool = (server: McpServer) => {
302
331
  });
303
332
  if (modelError) return toolErr(modelError);
304
333
  }
334
+ Object.assign(updateData, profileUpdate.fields);
305
335
 
306
336
  // Recalculate nextRunAt based on schedule type
307
337
  if (schedule.scheduleType === "one_time") {
@@ -357,13 +387,29 @@ export const registerPatchScheduleTool = (server: McpServer) => {
357
387
  return toolErr("Failed to update schedule.");
358
388
  }
359
389
 
390
+ const modelTierDeprecated = modelTierDeprecation(
391
+ modelTier,
392
+ updated.targetAgentId
393
+ ? (await getAgentById(updated.targetAgentId))?.harnessProvider
394
+ : null,
395
+ );
360
396
  return toolOk(
361
397
  `Patched schedule "${updated.name}". Next run: ${updated.nextRunAt || "disabled"}`,
362
398
  {
363
- data: { yourAgentId: requestInfo.agentId, schedule: updated },
399
+ data: {
400
+ yourAgentId: requestInfo.agentId,
401
+ schedule: updated,
402
+ ...(modelTierDeprecated ? { modelTierDeprecated } : {}),
403
+ },
364
404
  },
365
405
  );
366
406
  } catch (error) {
407
+ // The profile was deleted between scheduleProfileUpdate and the write.
408
+ if (modelProfileRefError(error) === "missing") {
409
+ return toolErr(`Unknown model profile "${profile}".`, {
410
+ data: { yourAgentId: requestInfo.agentId },
411
+ });
412
+ }
367
413
  const message = error instanceof Error ? error.message : "Unknown error";
368
414
  return toolErr(`Failed to update schedule: ${message}`, {
369
415
  data: { yourAgentId: requestInfo.agentId },
@@ -12,12 +12,20 @@ import {
12
12
  isExtensionAgent,
13
13
  updateScheduledTask,
14
14
  } from "@/be/db";
15
+ import { modelProfileRefError, scheduleProfileUpdate } from "@/be/db/model-profiles";
15
16
  import { explicitModelErrorForAgent } from "@/be/model-validation";
16
17
  import { mergeScheduleTiming, validateRecurringTiming } from "@/be/schedules/validate";
17
18
  import { getScript } from "@/be/scripts/db";
18
19
  import { can } from "@/rbac";
19
20
  import { calculateNextRun } from "@/scheduler";
20
- import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
21
+ import {
22
+ createToolRegistrar,
23
+ modelTierDeprecatedOutputSchema,
24
+ modelTierDeprecation,
25
+ swarmToolOutputSchema,
26
+ toolErr,
27
+ toolOk,
28
+ } from "@/tools/utils";
21
29
  import {
22
30
  AssetKeySchema,
23
31
  ModelTierSchema,
@@ -76,7 +84,18 @@ export const updateScheduleInputSchema = z.object({
76
84
  ),
77
85
  modelTier: ModelTierSchema.nullable()
78
86
  .optional()
79
- .describe("Portable model tier for tasks created by this schedule. Set to null to clear."),
87
+ .describe(
88
+ 'Deprecated: pass profile "<harness>-<tier>" instead (same model). Portable model tier for tasks created by this schedule, resolved at claim time through the seeded <harness>-<tier> profile. Set to null to clear.',
89
+ ),
90
+ profile: z
91
+ .string()
92
+ .trim()
93
+ .min(1)
94
+ .nullable()
95
+ .optional()
96
+ .describe(
97
+ "Model profile name for tasks created by this schedule (see list-model-profiles). Must run on the target agent. Exclusive with model and modelTier: setting a profile clears them, and setting either clears the profile. Set to null to clear.",
98
+ ),
80
99
  allowCustomModel: z
81
100
  .boolean()
82
101
  .optional()
@@ -105,6 +124,7 @@ const scheduleDataShape = {
105
124
  timezone: z.string().optional(),
106
125
  model: z.string().optional(),
107
126
  modelTier: ModelTierSchema.optional(),
127
+ profile: z.string().optional(),
108
128
  scheduleType: z.string().optional(),
109
129
  targetType: ScheduledTaskTargetTypeSchema.optional(),
110
130
  workflowId: z.string().optional(),
@@ -125,6 +145,7 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
125
145
  outputSchema: swarmToolOutputSchema({
126
146
  yourAgentId: z.string().optional(),
127
147
  schedule: z.looseObject(scheduleDataShape).optional(),
148
+ modelTierDeprecated: modelTierDeprecatedOutputSchema.optional(),
128
149
  }),
129
150
  },
130
151
  async (
@@ -149,6 +170,7 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
149
170
  enabled,
150
171
  model,
151
172
  modelTier,
173
+ profile,
152
174
  allowCustomModel,
153
175
  },
154
176
  requestInfo,
@@ -277,6 +299,13 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
277
299
  // A move to another agent re-judges the stored model against the new harness.
278
300
  const agentChanged =
279
301
  targetAgentId !== undefined && targetAgentId !== schedule.targetAgentId;
302
+ const profileUpdate = await scheduleProfileUpdate(schedule, {
303
+ profile,
304
+ model,
305
+ modelTier,
306
+ targetAgentId,
307
+ });
308
+ if (profileUpdate.error !== undefined) return toolErr(profileUpdate.error);
280
309
  if (model !== undefined || modelTier !== undefined) {
281
310
  const normalizedModel = splitLegacyModelAlias({ model, modelTier });
282
311
  // A model the schedule already stores is not re-judged, so an unrelated edit still saves.
@@ -292,7 +321,7 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
292
321
  if (modelTier !== undefined || normalizedModel.modelTier) {
293
322
  updateData.modelTier = normalizedModel.modelTier ?? null;
294
323
  }
295
- } else if (agentChanged && schedule.model) {
324
+ } else if (agentChanged && schedule.model && !profileUpdate.fields.profile) {
296
325
  // Harness only: the stored id already passed the catalog check when it was written.
297
326
  const modelError = await explicitModelErrorForAgent({
298
327
  model: schedule.model,
@@ -301,6 +330,7 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
301
330
  });
302
331
  if (modelError) return toolErr(modelError);
303
332
  }
333
+ Object.assign(updateData, profileUpdate.fields);
304
334
 
305
335
  // Recalculate nextRunAt based on schedule type
306
336
  if (schedule.scheduleType === "one_time") {
@@ -356,13 +386,29 @@ export const registerUpdateScheduleTool = (server: McpServer) => {
356
386
  return toolErr("Failed to update schedule.");
357
387
  }
358
388
 
389
+ const modelTierDeprecated = modelTierDeprecation(
390
+ modelTier,
391
+ updated.targetAgentId
392
+ ? (await getAgentById(updated.targetAgentId))?.harnessProvider
393
+ : null,
394
+ );
359
395
  return toolOk(
360
396
  `Updated schedule "${updated.name}". Next run: ${updated.nextRunAt || "disabled"}`,
361
397
  {
362
- data: { yourAgentId: requestInfo.agentId, schedule: updated },
398
+ data: {
399
+ yourAgentId: requestInfo.agentId,
400
+ schedule: updated,
401
+ ...(modelTierDeprecated ? { modelTierDeprecated } : {}),
402
+ },
363
403
  },
364
404
  );
365
405
  } catch (error) {
406
+ // The profile was deleted between scheduleProfileUpdate and the write.
407
+ if (modelProfileRefError(error) === "missing") {
408
+ return toolErr(`Unknown model profile "${profile}".`, {
409
+ data: { yourAgentId: requestInfo.agentId },
410
+ });
411
+ }
366
412
  const message = error instanceof Error ? error.message : "Unknown error";
367
413
  return toolErr(`Failed to update schedule: ${message}`, {
368
414
  data: { yourAgentId: requestInfo.agentId },
@@ -30,6 +30,8 @@ import { findDuplicateTask } from "@/tools/task-dedup";
30
30
  import { ownerCtx, type ToolCtx } from "@/tools/task-tool-ctx";
31
31
  import {
32
32
  createToolRegistrar,
33
+ modelTierDeprecatedOutputSchema,
34
+ modelTierDeprecation,
33
35
  type SwarmToolResult,
34
36
  swarmToolOutputSchema,
35
37
  toolErr,
@@ -139,10 +141,10 @@ export const sendTaskInputSchema = z
139
141
  .min(1)
140
142
  .optional()
141
143
  .describe(
142
- "Concrete model override for this task, interpreted by the assignee's harness/provider. This does not switch providers. Prefer modelTier for portable intent. The model must run on the assignee's harness (an Anthropic model on a Claude agent, an OpenAI model on a Codex agent); a mismatch is rejected.",
144
+ "Concrete model override for this task, interpreted by the assignee's harness/provider. This does not switch providers. Prefer `profile` for a named harness + model + effort. The model must run on the assignee's harness (an Anthropic model on a Claude agent, an OpenAI model on a Codex agent); a mismatch is rejected.",
143
145
  ),
144
146
  modelTier: ModelTierSchema.optional().describe(
145
- "Portable model tier for this task: 'smol', 'regular', 'smart', or 'ultra'. Resolved at claim/run time using the assignee's harness/provider. Legacy model shortnames map as haiku→smol, sonnet→regular, opus→smart, fable→ultra.",
147
+ "Deprecated: pass profile \"<harness>-<tier>\" instead (same model). Portable model tier for this task: 'smol', 'regular', 'smart', or 'ultra'. Resolved at claim time through the seeded <harness>-<tier> profile of the assignee's harness. Legacy model shortnames map as haiku→smol, sonnet→regular, opus→smart, fable→ultra.",
146
148
  ),
147
149
  allowCustomModel: z
148
150
  .boolean()
@@ -238,6 +240,7 @@ export const sendTaskInputSchema = z
238
240
  export const sendTaskOutputSchema = swarmToolOutputSchema({
239
241
  yourAgentId: z.string().optional(),
240
242
  task: looseAgentTaskOutputSchema.optional(),
243
+ modelTierDeprecated: modelTierDeprecatedOutputSchema.optional(),
241
244
  });
242
245
 
243
246
  type SendTaskArgs = z.infer<typeof sendTaskInputSchema>;
@@ -499,6 +502,8 @@ export async function sendTaskHandler(
499
502
  model: normalizedModel.model,
500
503
  modelTier: normalizedModel.modelTier,
501
504
  agentId: effectiveAgentId,
505
+ // createTaskExtended fills an unset repo from the parent; judge that repo's config.
506
+ vcsRepo: effectiveVcsRepo || effectiveParentTask?.vcsRepo,
502
507
  });
503
508
  if (profileError) return toolErr(profileError, { data: { yourAgentId: creatorAgentId } });
504
509
  const effectiveRoutingReason =
@@ -758,9 +763,19 @@ export async function sendTaskHandler(
758
763
  return { success: false, message: `Unknown model profile "${profile}".`, task: undefined };
759
764
  });
760
765
 
766
+ // modelTier aliases the assignee harness's seeded profile; a pool task has no harness yet.
767
+ const assigneeId = result.task?.agentId ?? result.task?.offeredTo;
768
+ const modelTierDeprecated =
769
+ result.success && modelTier
770
+ ? modelTierDeprecation(
771
+ modelTier,
772
+ assigneeId ? (await getAgentById(assigneeId))?.harnessProvider : null,
773
+ )
774
+ : undefined;
761
775
  const data = {
762
776
  yourAgentId: creatorAgentId,
763
777
  task: result.task,
778
+ ...(modelTierDeprecated ? { modelTierDeprecated } : {}),
764
779
  };
765
780
 
766
781
  // Text channel must carry the created task too — most harnesses never show
@@ -14,8 +14,10 @@ import {
14
14
  updateAgentStatusFromCapacity,
15
15
  updateTaskProgress,
16
16
  } from "@/be/db";
17
+ import { LEARNING_TTL_DAYS } from "@/be/memory/constants";
17
18
  import {
18
19
  LEARNING_MAX_TAGS,
20
+ LEARNING_MIN_CHARS,
19
21
  storeTaskLearning,
20
22
  type TaskLearningResult,
21
23
  } from "@/be/memory/task-learning";
@@ -129,10 +131,11 @@ export const storeProgressOutputSchema = swarmToolOutputSchema({
129
131
  workstream: z.string().optional(),
130
132
  similarity: z.number().optional(),
131
133
  error: z.string().optional(),
134
+ noiseFloor: z.string().optional(),
132
135
  })
133
136
  .optional()
134
137
  .describe(
135
- "Present when the call carried a learning: stored, replayed (same text already stored for this task), duplicate (an existing swarm memory at key/memoryId says the same; similarity is the raw cosine), or failed with error.",
138
+ "Present when the call carried a learning: stored, replayed (same text already stored for this task), duplicate (an existing swarm memory at key/memoryId says the same; similarity is the raw cosine), or failed with error. A failed learning rejected as noise also carries noiseFloor: too-short or repeats-progress.",
136
139
  ),
137
140
  });
138
141
 
@@ -151,7 +154,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
151
154
  {
152
155
  title: "Store task progress",
153
156
  description:
154
- "Stores the progress of a specific task. Can also mark task as completed, failed, or skipped, which will set the agent back to idle. Use skipped only when the work is not yours to handle, such as a Slack thread message addressed to someone else; never skip an explicit @mention of you or work assigned to you.",
157
+ "Stores the progress of a specific task. Can also mark task as completed, failed, or skipped, which will set the agent back to idle. Use skipped only when the work is not yours to handle, such as a Slack thread message addressed to someone else; never skip an explicit @mention of you or work assigned to you. When a live child task you created continues the work, complete with chainedTaskId so the lead is not woken for this step.",
155
158
  annotations: { idempotentHint: true },
156
159
 
157
160
  inputSchema: z.object({
@@ -207,7 +210,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
207
210
  ])
208
211
  .optional()
209
212
  .describe(
210
- `A lesson to keep. Add one only when it would change how the next agent works: a gotcha, a dead end, a pattern that worked. Not a progress line. Stored as a swarm memory at /learnings/<workstream>/<slug>, tagged "learning" and tied to this task. The first line of text is the title. At most ~500 tokens and ${LEARNING_MAX_TAGS} kebab tags. workstream defaults to the task's repo name, else "general". Send it on or before the completing call: a call on a finished task stores nothing. A failed learning write is reported in the result and never blocks the progress update.`,
213
+ `A lesson to keep. Add one only when it would change how the next agent works: a gotcha, a dead end, a pattern that worked. Line 1 of text is the title. Line 2 is the rule, as "When X, do Y"; evidence goes after it, since recall shows only the first 300 characters. Not a learning: a status or pass/fail line, a restatement of this call's progress or output, text already in a skill, a claim you did not verify. Text under ${LEARNING_MIN_CHARS} characters, or contained in this call's progress or output, is rejected. Stored as a swarm memory at /learnings/<workstream>/<slug>, tagged "learning" and tied to this task. Expires after ${LEARNING_TTL_DAYS} days. At most ~500 tokens and ${LEARNING_MAX_TAGS} kebab tags. workstream defaults to the task's repo name, else "general". Send it on or before the completing call: a call on a finished task stores nothing. A failed learning write is reported in the result and never blocks the progress update.`,
211
214
  ),
212
215
  persistMemory: z
213
216
  .boolean()
@@ -215,6 +218,12 @@ export const registerStoreProgressTool = (server: McpServer) => {
215
218
  .describe(
216
219
  "Opt in to task_completion memory persistence for automatic/recurring tasks. Manual tasks are persisted by default; scheduled, system, heartbeat/boot-triage, monitor, and digest tasks are skipped unless this is true.",
217
220
  ),
221
+ chainedTaskId: z
222
+ .uuid()
223
+ .optional()
224
+ .describe(
225
+ "With status 'completed' only: the id of a live child task you created (send-task with parentTaskId set to this task) that carries this result forward. The engine then creates no lead follow-up for this completion and logs the handoff on this task. The child must exist, have this task as parentTaskId, be created by you, and be pending, offered, reviewing, in_progress or paused. If any check fails, the normal follow-up is created and names the reason; the completion itself never fails. Ignored for every other status: a failure always wakes the lead.",
226
+ ),
218
227
  force: z
219
228
  .boolean()
220
229
  .optional()
@@ -239,6 +248,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
239
248
  citations,
240
249
  learning,
241
250
  persistMemory,
251
+ chainedTaskId,
242
252
  force,
243
253
  },
244
254
  requestInfo,
@@ -507,6 +517,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
507
517
  isLead: agent.isLead === true,
508
518
  task: existingTask,
509
519
  learning,
520
+ sameCall: { progress, output },
510
521
  }).then(resolve, (err) =>
511
522
  resolve({ status: "failed", error: scrubSecrets(String(err)) }),
512
523
  ),
@@ -710,6 +721,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
710
721
  failureReason,
711
722
  agentId: requestInfo.agentId,
712
723
  persistMemory,
724
+ ...(status === "completed" && chainedTaskId ? { chainedTaskId } : {}),
713
725
  });
714
726
  }
715
727
 
@@ -35,6 +35,9 @@ import { applyPreTaskCreate } from "@/extensions/apply-task-create";
35
35
  import { assertOwnsTask, ownerCtx, type ToolCtx } from "@/tools/task-tool-ctx";
36
36
  import {
37
37
  createToolRegistrar,
38
+ type ModelTierDeprecated,
39
+ modelTierDeprecatedOutputSchema,
40
+ modelTierDeprecation,
38
41
  type SwarmToolResult,
39
42
  swarmToolOutputSchema,
40
43
  toolErr,
@@ -99,7 +102,7 @@ export const taskActionInputSchema = z.object({
99
102
  "Concrete model override for the created task, interpreted by the claiming worker's harness/provider. This does not switch providers. Only used with 'create' action. The model must run on the assignee's harness (an Anthropic model on a Claude agent, an OpenAI model on a Codex agent); a mismatch is rejected.",
100
103
  ),
101
104
  modelTier: ModelTierSchema.optional().describe(
102
- "Portable model tier for the created task: 'smol', 'regular', 'smart', or 'ultra'. Resolved when a worker claims/runs the task. Only used with 'create' action.",
105
+ "Deprecated: pass profile \"<harness>-<tier>\" instead (same model). Portable model tier for the created task: 'smol', 'regular', 'smart', or 'ultra'. Resolved when a worker claims the task, through the seeded <harness>-<tier> profile of its harness. Only used with 'create' action.",
103
106
  ),
104
107
  allowCustomModel: z
105
108
  .boolean()
@@ -143,6 +146,7 @@ export const taskActionOutputSchema = swarmToolOutputSchema({
143
146
  userSpend: z.number().optional(),
144
147
  userBudget: z.number().optional(),
145
148
  resetAt: z.string().optional(),
149
+ modelTierDeprecated: modelTierDeprecatedOutputSchema.optional(),
146
150
  });
147
151
 
148
152
  type TaskActionArgs = z.infer<typeof taskActionInputSchema>;
@@ -159,6 +163,7 @@ type TaskActionResult = {
159
163
  userBudget?: number;
160
164
  resetAt?: string;
161
165
  refusalSideEffects?: unknown;
166
+ modelTierDeprecated?: ModelTierDeprecated;
162
167
  };
163
168
 
164
169
  function agentOnlyActionResult(): SwarmToolResult {
@@ -365,10 +370,13 @@ export async function taskActionHandler(
365
370
  preparedCreate!.description,
366
371
  preparedCreate!.options,
367
372
  );
373
+ // A pool task has no harness until claim, so there is no profile to suggest.
374
+ const modelTierDeprecated = modelTierDeprecation(input.modelTier, null);
368
375
  return {
369
376
  success: true,
370
377
  message: `Created unassigned task "${newTask.id}".`,
371
378
  task: newTask,
379
+ ...(modelTierDeprecated ? { modelTierDeprecated } : {}),
372
380
  };
373
381
  }
374
382
 
@@ -82,6 +82,19 @@ Use \`get-task-details\` with taskId "{{task_id}}" for full details.`,
82
82
  category: "task_lifecycle",
83
83
  });
84
84
 
85
+ registerTemplate({
86
+ eventType: "task.worker.chain_rejected",
87
+ header: "",
88
+ defaultBody: `
89
+
90
+ The worker completed with chainedTaskId {{chained_task_id}} to say its result continues in that task. The engine rejected it because {{reason}}, so this follow-up was created. Check whether the work really continues somewhere.`,
91
+ variables: [
92
+ { name: "chained_task_id", description: "The chainedTaskId passed to store-progress" },
93
+ { name: "reason", description: "Why the engine did not accept the chained task" },
94
+ ],
95
+ category: "task_lifecycle",
96
+ });
97
+
85
98
  // ============================================================================
86
99
  // HITL follow-up (created when a standalone approval request is resolved)
87
100
  // ============================================================================
@@ -81,8 +81,9 @@ export const DEFERRED_TOOLS = new Set([
81
81
  "model-catalog-refresh",
82
82
  "model-catalog-overlay-upsert",
83
83
 
84
- // Model profiles (1)
84
+ // Model profiles (2)
85
85
  "list-model-profiles",
86
+ "check-model-profile",
86
87
 
87
88
  // Repos (1)
88
89
  "update-repo",