Commit 66e35e8
committed
fix(memory-core): skip zero-hit forced sync for one-shot CLI managers
The bounded zero-hit forced sync prevents a slow/stuck sync from hanging
the interactive memory_search deadline for long-lived (gateway) managers.
But one-shot CLI runs (oneShotCliRun -> purpose=cli) tear the manager down
in the tool's finally block, and close() awaits any in-flight sync
UNBOUNDED (manager.ts awaitCurrentSync / qmd-manager pendingUpdate). That
relocated the exact hang the bound prevents into cleanup.
Skip the optional forced refresh entirely for purpose=cli: a one-shot run
has no 'next call' to benefit from a warmed index, and search() already
force-syncs a cold index inline + schedules a background sync, so nothing
is lost. Addresses the ClawSweeper P1 on PR #94564.
Adds a regression test: a one-shot run with a never-settling sync returns
an available empty result, never starts the sync, and closes once.1 parent 207da36 commit 66e35e8
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
402 | 437 | | |
403 | 438 | | |
404 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
612 | 616 | | |
613 | 617 | | |
614 | 618 | | |
615 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
616 | 627 | | |
617 | 628 | | |
618 | 629 | | |
| |||
0 commit comments