Commit cfad7fc
committed
fix(vc-agent): durable 启动失败 gate 覆盖 fork-error 与 pre-ready exit
复审(Codex)揪出的 blocker:#3 的 gate 只堵了带 dispatchAttempt 的 structured
error;durable 投递被 dispatch(queued)进还没 ready 的 worker、worker 崩在 ready 前时,
fork-level `error`(直接 sessionReply)和 abrupt pre-ready `exit`(notifyStartupFailure
无 attempt)两条 fallback 仍会 out-of-band 发 Lark,silent 投递尤其会被误发、且与
receipt/lease 重试双发,绕过副作用边界。
修法:
- 把 initTurnId/initDispatchAttempt 冻进 WorkerStartupState(fork 时)。
- fork-level `error` 与 pre-ready `exit` 都走同一 durable gate:VC receiver +
有 dispatchAttempt → 交给 receipt/lease→ambiguous,不 out-of-band reply。
- worker.ts crash-loop relaunch 显式透传 msg.dispatchAttempt(不再退回 stale current)。
- 补测:durable pre-ready exit / durable fork-error 各 0 reply;VC receiver 的 IM turn
(无 attempt)fork-error 仍通知一次(证明 gate 精确,不 blanket 抑制)。1 parent 7630f3d commit cfad7fc
4 files changed
Lines changed: 88 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| |||
1859 | 1866 | | |
1860 | 1867 | | |
1861 | 1868 | | |
1862 | | - | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1863 | 1872 | | |
1864 | 1873 | | |
1865 | 1874 | | |
| |||
1869 | 1878 | | |
1870 | 1879 | | |
1871 | 1880 | | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
1872 | 1891 | | |
1873 | 1892 | | |
1874 | 1893 | | |
| |||
3001 | 3020 | | |
3002 | 3021 | | |
3003 | 3022 | | |
3004 | | - | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
3005 | 3027 | | |
3006 | 3028 | | |
3007 | 3029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7332 | 7332 | | |
7333 | 7333 | | |
7334 | 7334 | | |
7335 | | - | |
| 7335 | + | |
| 7336 | + | |
| 7337 | + | |
| 7338 | + | |
7336 | 7339 | | |
7337 | 7340 | | |
7338 | 7341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
319 | 375 | | |
320 | 376 | | |
321 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
0 commit comments