Repository navigation
Commit b216a01
feat(server): delegated tasks continue across rounds (#1653)
## Problem
A parent can't keep one delegated child across review rounds.
Each `delegate_task` round spawns a fresh child, which loses its context.
Sending to the child with `t3_thread_send` keeps context, but the parent is never woken, and `task_status` can't see that round.
## Change
`delegate_task` accepts `continueTaskId`: it reopens a finished app-owned task and sends the new brief to that task's child.
| Concern | Behavior |
| --- | --- |
| Task | same `taskId`, same child thread |
| Wake | each round wakes the parent |
| Result | one result transfer per child run |
| Status | `task_status` reads the current round |
| Cancel | `task_cancel` stops the current round |
| Release | archiving the child releases it; unarchiving makes it continuable again |
| Refusals | task still running, child busy, released, or unknown |
| Design | Detail |
| --- | --- |
| Fork-owned | `delegatedRounds.fork.ts`, behind `fork-hook: delegated-rounds/*` seams in `Orchestrator.ts` |
| Upstream paths | finalize and delivery stay upstream's; later rounds leave the original node and turn item unchanged |
| Delivery reset | the reopened row sets `completionDelivery` to `pending`; the projection keeps a stored value when the payload omits it |
| Docs | new `delegated-rounds` domain in `fork-delta.md`; retires when upstream ships delegated follow-ups |
## Scope and approval
Fork feature tracked in #1652.
Server, contracts, and MCP instructions only; no client changes.
## Verification
| Check | Result |
| --- | --- |
| `vp test run`, two new fork tests | exit 0 (3 tests) |
| `vp test run`, MCP service, control-reads, instructions, toolkit integration | exit 0 (22 tests) |
| `vp exec tsc --noEmit`, server and contracts | exit 0 |
| `vp run fork:ci` | exit 0 |
| `vp run build` in `apps/server` | exit 0 |
| Mutation: delivery reset removed | orchestrator test fails, `expected 'acknowledged' to equal 'claimed'` |
Live run on a dev server: a Claude Sonnet 5.5 parent had a Claude Sonnet 5.5 child remember `PELICAN-42`, then continued the same task and asked for it back.
Both rounds woke the parent, and the child recalled the codeword.
`task_status` reported `completed`, summary `PELICAN-42`, run `ordinal:2`, and a new transfer ID.
https://github.com/user-attachments/assets/ac99f00f-f561-4b8e-b1c6-403708464b54
| Span | Real | Clip |
| --- | --- | --- |
| prompt typed | 24s | 8x |
| two rounds | 51s | 6x |
| result | 7s | 1x |
**Not checked:** release by archiving in the UI; the orchestrator test covers it.
**Known quirk:** each round's activity row reads the one task, so round 1's row shows the latest summary.
Claude Opus 5.5 in Claude Code, hosted in T3 Code.
Refs #1652
## Fork trailers
Squashes:
- 0157b4f feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 1e2a604 fixup! feat(server): delegated tasks continue across rounds (#1653) (#1653)
- f8cba10 feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 75bbd2a fixup! feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 9a9dfd2 feat(server): delegated tasks continue across rounds (#1653) (#1653)
- bf1ea32 fixup! feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 19887ba fixup! feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 94ff1f9 feat(server): delegated tasks continue across rounds (#1653) (#1653)
- 8b5fc68 fixup! feat(server): delegated tasks continue across rounds (#1653) (#1653)
Fork-Domain: delegated-rounds
Fork-Tier: core
Co-authored-by: donjor <[email protected]>1 parent 1a5ce45 commit b216a01
11 files changed
Lines changed: 671 additions & 18 deletions
File tree
- apps/server/src
- mcp
- orchestration-v2
- docs/fork/internals
- packages
- contracts/src
- provider-core/src/server
- scripts/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 88 | + | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
1428 | 1426 | | |
1429 | 1427 | | |
1430 | 1428 | | |
1431 | | - | |
| 1429 | + | |
1432 | 1430 | | |
1433 | 1431 | | |
1434 | 1432 | | |
| |||
1502 | 1500 | | |
1503 | 1501 | | |
1504 | 1502 | | |
1505 | | - | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
| |||
2280 | 2280 | | |
2281 | 2281 | | |
2282 | 2282 | | |
| 2283 | + | |
2283 | 2284 | | |
2284 | 2285 | | |
2285 | 2286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
0 commit comments