Repository navigation
Commit eac6d35
fix(server): worktree cleanup no longer runs sweeps back to back
Every thread.deleted and provider-session.updated event queued another
full sweep, and the worker never merged them. Each eligible worktree also
re-read the full active and archived thread snapshot under its lease, so
one sweep cost 2 + 2N snapshot reads for N eligible worktrees.
- At most one automatic sweep waits at a time. The hourly schedule,
settings changes and domain events all request it; later requests join
it. Each manual run still gets its own sweep and report.
- Request a sweep only for session updates that reach "stopped" or
"error". Moves between live statuses cannot free a worktree.
- Under the worktree lease, recheck the project list, the threads that
use this path (new ProjectionStore.getThreadWorktreePaths), this
thread's shell and the live sessions. The snapshot is read once per
sweep, and recheck skips report the same reasons as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 0caa95d commit eac6d35
6 files changed
Lines changed: 582 additions & 23 deletions
File tree
- apps/server/src
- orchestration-v2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 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 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
330 | 395 | | |
331 | 396 | | |
332 | 397 | | |
| |||
350 | 415 | | |
351 | 416 | | |
352 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
353 | 422 | | |
354 | 423 | | |
355 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
411 | 420 | | |
412 | 421 | | |
413 | 422 | | |
| |||
5566 | 5575 | | |
5567 | 5576 | | |
5568 | 5577 | | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
5569 | 5593 | | |
5570 | 5594 | | |
5571 | 5595 | | |
| |||
5906 | 5930 | | |
5907 | 5931 | | |
5908 | 5932 | | |
| 5933 | + | |
5909 | 5934 | | |
5910 | 5935 | | |
5911 | 5936 | | |
| |||
6048 | 6073 | | |
6049 | 6074 | | |
6050 | 6075 | | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
| 6081 | + | |
| 6082 | + | |
| 6083 | + | |
| 6084 | + | |
| 6085 | + | |
6051 | 6086 | | |
6052 | 6087 | | |
6053 | 6088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
0 commit comments