Pull requests / #3049

#3049 serve: synchronize cache metrics after completed recovery clears

open · @oscarlius · 0 commentaires · Sur GitHub

Server & APIWindows

Description

Completed non-finite-logit recovery clears every parked conversation and retained K/V, but its log messages lack the observer's `conversation cache:` tag. Match the two complete native clear messages and set current `parked` and `bytes` to zero, preserving eviction totals, park/restore counters, and last-event metadata.

Add local-log and HTTP regressions for both native formats, zero/one/multiple entries, deferred partial lines, subsequent cache activity, and diagnostics containing recovery text. Matching requires the whole native message so an unrelated line cannot clear the displayed cache. Native recovery/cache behavior and API fields are unchanged; this is separate from #3034's refused-parking handling.

Validation on Windows with Python 3.12.7:

- Baseline regressions failed before the fix; all 4 new test methods now pass, including a review-driven negative-match regression.
- `python -m unittest serve.test_cache_log_clear serve.test_monitor serve.test_server serve.test_prometheus`: 357 tests, 354 passed and 3 existing signal-related skips.
- Python compilation, `git diff --check`, and comparison against existing Ruff findings passed.
- Independent review completed. Tests use CPU fixtures and local mock HTTP only; no native backend files changed and no live model service was restarted.

Closes #3047.

Sur le site

Liens install, modèles, releases.