Repository navigation
Commit 270624b
authored
fix(tui): flush mailbox mail before ask wake on settle and gate close (#1105)
* fix(tui): flush mailbox mail before ask wake on settle and gate close
settleRunToIdle (idle-with-fleet) and gateClosed flushed the ask wake before mailbox mail, letting a re-surface wake steal the turn occupancy should take. Match the #1080 abort-path rule: mail first, wake only if mail did not start a turn (isProcessing guard, deliveredAskWake dedupe — no duplicate wake).
Tests: 4 new CL-8061 order/suppression cases in agent-ask-wake.test.ts (failed pre-fix, pass post-fix).
Fixes CL-8061
* fix(tui): claim the primary turn for occupancy before ask wake
Mailbox mail collect is async, so isProcessing is still false
while occupancy already owns the slot. A shared mail-then-wake
guard uses the latch claim so ask-wake cannot send on that stack.1 parent 127ec5a commit 270624b
5 files changed
Lines changed: 339 additions & 24 deletions
File tree
- src
- subagent
- tui
- runner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
332 | 354 | | |
333 | 355 | | |
334 | 356 | | |
| |||
395 | 417 | | |
396 | 418 | | |
397 | 419 | | |
| 420 | + | |
398 | 421 | | |
399 | 422 | | |
| 423 | + | |
400 | 424 | | |
401 | 425 | | |
402 | 426 | | |
| |||
410 | 434 | | |
411 | 435 | | |
412 | 436 | | |
| 437 | + | |
413 | 438 | | |
414 | 439 | | |
415 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
416 | 459 | | |
417 | 460 | | |
418 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
112 | 134 | | |
113 | 135 | | |
| 136 | + | |
| 137 | + | |
114 | 138 | | |
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
120 | 144 | | |
121 | | - | |
| 145 | + | |
| 146 | + | |
122 | 147 | | |
123 | 148 | | |
124 | 149 | | |
| |||
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
| 166 | + | |
141 | 167 | | |
142 | 168 | | |
143 | 169 | | |
| |||
169 | 195 | | |
170 | 196 | | |
171 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
172 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
173 | 215 | | |
174 | 216 | | |
175 | | - | |
| 217 | + | |
176 | 218 | | |
177 | | - | |
| 219 | + | |
178 | 220 | | |
179 | 221 | | |
180 | 222 | | |
| |||
184 | 226 | | |
185 | 227 | | |
186 | 228 | | |
| 229 | + | |
187 | 230 | | |
0 commit comments